Skip to content

Commit 9d8c05a

Browse files
Paolo Abenidavem330
authored andcommitted
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: multipath-tcp/mptcp_net-next#89 Fixes: 9466a1c ("mptcp: enable JOIN requests even if cookies are in use") Reported-and-tested-by: Geliang Tang <[email protected]> Reviewed-by: Matthieu Baerts <[email protected]> Signed-off-by: Paolo Abeni <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent e7d4005 commit 9d8c05a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/ipv4/syncookies.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ struct sock *tcp_get_cookie_sock(struct sock *sk, struct sk_buff *skb,
214214
sock_rps_save_rxhash(child, skb);
215215

216216
if (rsk_drop_req(req)) {
217-
refcount_set(&req->rsk_refcnt, 2);
217+
reqsk_put(req);
218218
return child;
219219
}
220220

0 commit comments

Comments
 (0)