mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-09-22 09:34:56 +02:00
tcp: fix TIME_WAIT socket reference leak on PSP policy failure
[ Upstream commit2c1931a811] Release the TIME_WAIT socket reference and jump to discard_it upon PSP policy failure in both IPv4 and IPv6 receive paths. This prevents a memory leak of tcp_tw_bucket structures. Fixes:659a2899a5("tcp: add datapath logic for PSP with inline key exchange") Signed-off-by: Eric Dumazet <edumazet@google.com> Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com> Reviewed-by: Daniel Zahka <daniel.zahka@gmail.com> Link: https://patch.msgid.link/20260710181317.4060230-1-edumazet@google.com Signed-off-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
6875ee2bef
commit
e666af5dcc
+4
-2
@@ -2452,8 +2452,10 @@ do_time_wait:
|
||||
}
|
||||
|
||||
drop_reason = psp_twsk_rx_policy_check(inet_twsk(sk), skb);
|
||||
if (drop_reason)
|
||||
break;
|
||||
if (drop_reason) {
|
||||
inet_twsk_put(inet_twsk(sk));
|
||||
goto discard_it;
|
||||
}
|
||||
}
|
||||
/* to ACK */
|
||||
fallthrough;
|
||||
|
||||
+4
-2
@@ -1984,8 +1984,10 @@ do_time_wait:
|
||||
}
|
||||
|
||||
drop_reason = psp_twsk_rx_policy_check(inet_twsk(sk), skb);
|
||||
if (drop_reason)
|
||||
break;
|
||||
if (drop_reason) {
|
||||
inet_twsk_put(inet_twsk(sk));
|
||||
goto discard_it;
|
||||
}
|
||||
}
|
||||
/* to ACK */
|
||||
fallthrough;
|
||||
|
||||
Reference in New Issue
Block a user