]> git.itanic.dy.fi Git - linux-stable/commit
tls: fix race between tx work scheduling and socket close
authorJakub Kicinski <kuba@kernel.org>
Wed, 7 Feb 2024 01:18:20 +0000 (17:18 -0800)
committerDavid S. Miller <davem@davemloft.net>
Sat, 10 Feb 2024 21:38:19 +0000 (21:38 +0000)
commite01e3934a1b2d122919f73bc6ddbe1cdafc4bbdb
tree037591b7e2e7a07d702479b0205d382739e8f839
parentaec7961916f3f9e88766e2688992da6980f11b8d
tls: fix race between tx work scheduling and socket close

Similarly to previous commit, the submitting thread (recvmsg/sendmsg)
may exit as soon as the async crypto handler calls complete().
Reorder scheduling the work before calling complete().
This seems more logical in the first place, as it's
the inverse order of what the submitting thread will do.

Reported-by: valis <sec@valis.email>
Fixes: a42055e8d2c3 ("net/tls: Add support for async encryption of records for performance")
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Reviewed-by: Sabrina Dubroca <sd@queasysnail.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tls/tls_sw.c