summaryrefslogtreecommitdiff
path: root/net/ipv4/syncookies.c
diff options
context:
space:
mode:
authorPaolo Abeni <pabeni@redhat.com>2020-10-02 13:39:44 +0300
committerDavid S. Miller <davem@davemloft.net>2020-10-03 01:34:38 +0300
commit9d8c05ad5627b3a650087c14c67dd1d22a6368ab (patch)
tree282d7791eb4e2ec0c7db9172f2a5f547a0bc4865 /net/ipv4/syncookies.c
parente7d4005d48e248a5bd30db780a67164ccdc37f16 (diff)
downloadlinux-9d8c05ad5627b3a650087c14c67dd1d22a6368ab.tar.xz
tcp: fix syn cookied MPTCP request socket leak
If a syn-cookies request socket don't pass MPTCP-level validation done in syn_recv_sock(), we need to release it immediately, or it will be leaked. Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/89 Fixes: 9466a1ccebbe ("mptcp: enable JOIN requests even if cookies are in use") Reported-and-tested-by: Geliang Tang <geliangtang@gmail.com> Reviewed-by: Matthieu Baerts <matthieu.baerts@tessares.net> Signed-off-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/syncookies.c')
-rw-r--r--net/ipv4/syncookies.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/syncookies.c b/net/ipv4/syncookies.c
index f0794f0232ba..e03756631541 100644
--- a/net/ipv4/syncookies.c
+++ b/net/ipv4/syncookies.c
@@ -214,7 +214,7 @@ struct sock *tcp_get_cookie_sock(struct sock *sk, struct sk_buff *skb,
sock_rps_save_rxhash(child, skb);
if (rsk_drop_req(req)) {
- refcount_set(&req->rsk_refcnt, 2);
+ reqsk_put(req);
return child;
}