]> git.baikalelectronics.ru Git - kernel.git/commit
net: tls: fix possible race condition between do_tls_getsockopt_conf() and do_tls_set...
authorHangyu Hua <hbh25y@gmail.com>
Tue, 28 Feb 2023 02:33:44 +0000 (10:33 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Mar 2023 07:50:23 +0000 (08:50 +0100)
commit864bdfec990b944fcecc26e87d4e3c392e8e9ffa
tree5c8fa8fefcfedec2189336bdbedcc50e1cc8de4e
parentea9e211a7a1cae3fe6e19d66f5877ffd7bbb3623
net: tls: fix possible race condition between do_tls_getsockopt_conf() and do_tls_setsockopt_conf()

[ Upstream commit b2ff0e91c737d9bc2ff7658db03555d695bcb3a3 ]

ctx->crypto_send.info is not protected by lock_sock in
do_tls_getsockopt_conf(). A race condition between do_tls_getsockopt_conf()
and error paths of do_tls_setsockopt_conf() may lead to a use-after-free
or null-deref.

More discussion:  https://lore.kernel.org/all/Y/ht6gQL+u6fj3dG@hog/

Fixes: c2c217d10788 ("tls: kernel TLS support")
Signed-off-by: Hangyu Hua <hbh25y@gmail.com>
Link: https://lore.kernel.org/r/20230228023344.9623-1-hbh25y@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/tls/tls_main.c