Jakub Kicinski aec7961916 tls: fix race between async notify and socket close
The submitting thread (one which called recvmsg/sendmsg)
may exit as soon as the async crypto handler calls complete()
so any code past that point risks touching already freed data.

Try to avoid the locking and extra flags altogether.
Have the main thread hold an extra reference, this way
we can depend solely on the atomic ref counter for
synchronization.

Don't futz with reiniting the completion, either, we are now
tightly controlling when completion fires.

Reported-by: valis <sec@valis.email>
Fixes: 0cada33241d9 ("net/tls: fix race condition causing kernel panic")
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Sabrina Dubroca <sd@queasysnail.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2024-02-10 21:38:19 +00:00
..
2023-12-29 07:46:38 +00:00
2024-01-12 13:52:21 -08:00
2024-01-02 12:41:16 +00:00
2022-08-09 22:14:02 -07:00
2023-10-24 13:08:14 -07:00
2023-10-25 18:04:29 -07:00
2023-11-02 09:31:02 +01:00
2021-10-15 11:33:08 +01:00
2024-01-21 18:09:30 +00:00
2023-04-22 01:39:41 +02:00
2023-10-30 14:36:57 -07:00
2021-10-13 09:40:46 -07:00
2023-08-22 17:31:18 -07:00
2022-05-11 12:43:10 +01:00
2023-07-14 20:39:30 -07:00
2023-12-12 14:24:14 +01:00
2024-01-21 18:09:30 +00:00
2023-10-04 11:49:20 -07:00
2024-01-02 12:41:16 +00:00
2023-10-23 15:01:53 -07:00
2023-07-28 14:07:59 -07:00
2022-12-12 15:04:39 -08:00
2023-09-14 16:16:36 +02:00
2023-12-14 16:38:59 +01:00