tcp: fix a request socket leak
While the cited commit fixed a possible deadlock, it added a leak
of the request socket, since reqsk_put() must be called if the BPF
filter decided the ACK packet must be dropped.
Fixes: d624d276d1
("tcp: fix possible deadlock in TCP stack vs BPF filter")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
1080746110
commit
1f3b359f10
|
@ -1669,9 +1669,9 @@ int tcp_v4_rcv(struct sk_buff *skb)
|
|||
*/
|
||||
sock_hold(sk);
|
||||
refcounted = true;
|
||||
if (tcp_filter(sk, skb))
|
||||
goto discard_and_relse;
|
||||
nsk = tcp_check_req(sk, skb, req, false);
|
||||
nsk = NULL;
|
||||
if (!tcp_filter(sk, skb))
|
||||
nsk = tcp_check_req(sk, skb, req, false);
|
||||
if (!nsk) {
|
||||
reqsk_put(req);
|
||||
goto discard_and_relse;
|
||||
|
|
|
@ -1460,9 +1460,9 @@ static int tcp_v6_rcv(struct sk_buff *skb)
|
|||
}
|
||||
sock_hold(sk);
|
||||
refcounted = true;
|
||||
if (tcp_filter(sk, skb))
|
||||
goto discard_and_relse;
|
||||
nsk = tcp_check_req(sk, skb, req, false);
|
||||
nsk = NULL;
|
||||
if (!tcp_filter(sk, skb))
|
||||
nsk = tcp_check_req(sk, skb, req, false);
|
||||
if (!nsk) {
|
||||
reqsk_put(req);
|
||||
goto discard_and_relse;
|
||||
|
|
Loading…
Reference in New Issue