linux-stable/net/tls
Sabrina Dubroca 30fabe50a7 tls: get psock ref after taking rxlock to avoid leak
[ Upstream commit 417e91e856 ]

At the start of tls_sw_recvmsg, we take a reference on the psock, and
then call tls_rx_reader_lock. If that fails, we return directly
without releasing the reference.

Instead of adding a new label, just take the reference after locking
has succeeded, since we don't need it before.

Fixes: 4cbc325ed6 ("tls: rx: allow only one reader at a time")
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://lore.kernel.org/r/fe2ade22d030051ce4c3638704ed58b67d0df643.1711120964.git.sd@queasysnail.net
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-04-10 16:28:22 +02:00
..
Kconfig net/tls: Select SOCK_RX_QUEUE_MAPPING from TLS_DEVICE 2021-02-11 19:08:06 -08:00
Makefile tls: rx: async: hold onto the input skb 2022-07-18 11:24:11 +01:00
tls.h tls/sw: Use splice_eof() to flush 2024-02-23 09:12:30 +01:00
tls_device.c net: tls: avoid discarding data on record close 2023-08-16 18:27:27 +02:00
tls_device_fallback.c net/tls: Fix memory leak in tls_enc_skb() and tls_sw_fallback_init() 2022-11-11 20:08:17 -08:00
tls_main.c mptcp: fix lockless access in subflow ULP diag 2024-03-01 13:26:34 +01:00
tls_proc.c tls: rx: add counter for NoPad violations 2022-07-11 19:48:33 -07:00
tls_strp.c tls: improve lockless access safety of tls_err_abort() 2023-06-09 10:34:01 +02:00
tls_sw.c tls: get psock ref after taking rxlock to avoid leak 2024-04-10 16:28:22 +02:00
tls_toe.c tls: create an internal header 2022-07-08 18:38:45 -07:00
trace.c
trace.h