diff options
| author | Eric Dumazet <[email protected]> | 2017-09-08 19:44:47 +0000 |
|---|---|---|
| committer | David S. Miller <[email protected]> | 2017-09-08 23:07:17 +0000 |
| commit | 1f3b359f1004bd34b7b0bad70b93e3c7af92a37b (patch) | |
| tree | 40485d37c352b90d936c2c95239ea9d4e7d2f140 /net/ipv6/tcp_ipv6.c | |
| parent | Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf (diff) | |
| download | kernel-1f3b359f1004bd34b7b0bad70b93e3c7af92a37b.tar.gz kernel-1f3b359f1004bd34b7b0bad70b93e3c7af92a37b.zip | |
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: d624d276d1dd ("tcp: fix possible deadlock in TCP stack vs BPF filter")
Signed-off-by: Eric Dumazet <[email protected]>
Acked-by: Alexei Starovoitov <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'net/ipv6/tcp_ipv6.c')
| -rw-r--r-- | net/ipv6/tcp_ipv6.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index 38f76d8b231e..64d94afa427f 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c @@ -1460,9 +1460,9 @@ process: } 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; |
