linux/net/mptcp
Paolo Abeni a1a10328dd mptcp: avoid race on msk state changes
[ Upstream commit 490274b474 ]

The msk socket state is currently updated in a few spots without
owning the msk socket lock itself.

Some of such operations are safe, as they happens before exposing
the msk socket to user-space and can't race with other changes.

A couple of them, at connect time, can actually race with close()
or shutdown(), leaving breaking the socket state machine.

This change addresses the issue moving such update under the msk
socket lock with the usual:

<acquire spinlock>
<check sk lock onwers>
<ev defer to release_cb>

scheme.

Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/56
Fixes: 8fd738049a ("mptcp: fallback in case of simultaneous connect")
Fixes: c3c123d16c ("net: mptcp: don't hang in mptcp_sendmsg() after TCP fallback")
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2021-07-14 17:07:15 +02:00
..
crypto.c kunit: mptcp: adhere to KUNIT formatting standard 2021-04-16 17:10:40 -07:00
crypto_test.c mptcp: move crypto test to KUNIT 2020-06-26 16:21:39 -07:00
ctrl.c mptcp: add a new sysctl add_addr_timeout 2020-11-04 17:45:53 -08:00
diag.c mptcp: allow dumping subflow context to userspace 2020-03-29 22:14:48 -07:00
Kconfig kunit: mptcp: adhere to KUNIT formatting standard 2021-04-16 17:10:40 -07:00
Makefile kunit: mptcp: adhere to KUNIT formatting standard 2021-04-16 17:10:40 -07:00
mib.c mptcp: add active MPC mibs 2021-04-02 14:21:50 -07:00
mib.h mptcp: add active MPC mibs 2021-04-02 14:21:50 -07:00
mptcp_diag.c mptcp: add local addr info in mptcp_info 2021-02-15 15:09:14 -08:00
options.c mptcp: fix bad handling of 32 bit ack wrap-around 2021-07-14 17:07:13 +02:00
pm.c mptcp: rename mptcp_pm_nl_add_addr_send_ack 2021-03-26 15:05:15 -07:00
pm_netlink.c mptcp: make sure flag signal is set when add addr with port 2021-07-14 17:07:00 +02:00
protocol.c mptcp: avoid race on msk state changes 2021-07-14 17:07:15 +02:00
protocol.h mptcp: avoid race on msk state changes 2021-07-14 17:07:15 +02:00
sockopt.c mptcp: avoid OOB access in setsockopt() 2021-05-25 15:56:20 -07:00
subflow.c mptcp: avoid race on msk state changes 2021-07-14 17:07:15 +02:00
syncookies.c mptcp: fix syncookie build error on UP 2020-08-01 11:52:55 -07:00
token.c mptcp: fix pr_debug in mptcp_token_new_connect 2021-07-14 17:07:00 +02:00
token_test.c mptcp: introduce token KUNIT self-tests 2020-06-26 16:21:39 -07:00