]> git.baikalelectronics.ru Git - kernel.git/commit
mptcp: enable JOIN requests even if cookies are in use
authorFlorian Westphal <fw@strlen.de>
Thu, 30 Jul 2020 19:25:56 +0000 (21:25 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 31 Jul 2020 23:55:32 +0000 (16:55 -0700)
commitc57deaf73b09fe4d0220d90c968f553f24dd6a94
treeb63b7b800c1f51d16b26cf41029f27f4e478270f
parent3c55aa58f6d7c9fdebb745f5742cd9a3e08ccd63
mptcp: enable JOIN requests even if cookies are in use

JOIN requests do not work in syncookie mode -- for HMAC validation, the
peers nonce and the mptcp token (to obtain the desired connection socket
the join is for) are required, but this information is only present in the
initial syn.

So either we need to drop all JOIN requests once a listening socket enters
syncookie mode, or we need to store enough state to reconstruct the request
socket later.

This adds a state table (1024 entries) to store the data present in the
MP_JOIN syn request and the random nonce used for the cookie syn/ack.

When a MP_JOIN ACK passed cookie validation, the table is consulted
to rebuild the request socket from it.

An alternate approach would be to "cancel" syn-cookie mode and force
MP_JOIN to always use a syn queue entry.

However, doing so brings the backlog over the configured queue limit.

v2: use req->syncookie, not (removed) want_cookie arg

Suggested-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/syncookies.c
net/mptcp/Makefile
net/mptcp/ctrl.c
net/mptcp/protocol.h
net/mptcp/subflow.c
net/mptcp/syncookies.c [new file with mode: 0644]