]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: tls: fix use-after-free with partial reads and async decrypt
authorSabrina Dubroca <sd@queasysnail.net>
Wed, 7 Feb 2024 01:18:22 +0000 (17:18 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 Feb 2024 08:51:27 +0000 (09:51 +0100)
commit754c9bab77a1b895b97bd99d754403c505bc79df
tree96525f60461285d3284a8ce946a3d58f57439333
parentab6397f072e5097f267abf5cb08a8004e6b17694
net: tls: fix use-after-free with partial reads and async decrypt

[ Upstream commit 32b55c5ff9103b8508c1e04bfa5a08c64e7a925f ]

tls_decrypt_sg doesn't take a reference on the pages from clear_skb,
so the put_page() in tls_decrypt_done releases them, and we trigger
a use-after-free in process_rx_list when we try to read from the
partially-read skb.

Fixes: fd31f3996af2 ("tls: rx: decrypt into a fresh skb")
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/tls/tls_sw.c