]> git.baikalelectronics.ru Git - kernel.git/commit
mptcp: fix splat when closing unaccepted socket
authorPaolo Abeni <pabeni@redhat.com>
Fri, 7 May 2021 00:16:38 +0000 (17:16 -0700)
committerJakub Kicinski <kuba@kernel.org>
Fri, 7 May 2021 22:53:40 +0000 (15:53 -0700)
commitc3cab6682a8f13b9021b56a4869bd236a8c64b4f
tree1bb5df2788d0050e312c619a82cf9081df1b1da4
parent5025c70b06f495b95b4d0786f6f3c64950f3a50c
mptcp: fix splat when closing unaccepted socket

If userspace exits before calling accept() on a listener that had at least
one new connection ready, we get:

   Attempt to release TCP socket in state 8

This happens because the mptcp socket gets cloned when the TCP connection
is ready, but the socket is never exposed to userspace.

The client additionally sends a DATA_FIN, which brings connection into
CLOSE_WAIT state.  This in turn prevents the orphan+state reset fixup
in mptcp_sock_destruct() from doing its job.

Fixes: 0d4ab06450504 ("mptcp: Track received DATA_FIN sequence number and add related helpers")
Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/185
Tested-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Link: https://lore.kernel.org/r/20210507001638.225468-1-mathew.j.martineau@linux.intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/mptcp/subflow.c