]> git.baikalelectronics.ru Git - kernel.git/commit
mptcp: fix race in msk status update
authorPaolo Abeni <pabeni@redhat.com>
Fri, 24 Apr 2020 11:15:21 +0000 (13:15 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sun, 26 Apr 2020 03:38:54 +0000 (20:38 -0700)
commit64d9115182db81e28e7c748e36851f89f6d9df3d
treeac7289c7ae0723ae43b97911c830be0efcac2cab
parenta0e8f1903e8065f48e9fb8b58d496d8a256219a2
mptcp: fix race in msk status update

Currently subflow_finish_connect() changes unconditionally
any msk socket status other than TCP_ESTABLISHED.

If an unblocking connect() races with close(), we can end-up
triggering:

IPv4: Attempt to release TCP socket in state 1 00000000e32b8b7e

when the msk socket is disposed.

Be sure to enter the established status only from SYN_SENT.

Fixes: 48e8536295ba ("net: mptcp: don't hang in mptcp_sendmsg() after TCP fallback")
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/mptcp/subflow.c