linux/net/mptcp
Paolo Abeni 4c8941de78 mptcp: avoid flipping mp_capable field in syn_recv_sock()
If multiple CPUs races on the same req_sock in syn_recv_sock(),
flipping such field can cause inconsistent child socket status.

When racing, the CPU losing the req ownership may still change
the mptcp request socket mp_capable flag while the CPU owning
the request is cloning the socket, leaving the child socket with
'is_mptcp' set but no 'mp_capable' flag.

Such socket will stay with 'conn' field cleared, heading to oops
in later mptcp callback.

Address the issue tracking the fallback status in a local variable.

Fixes: 58b0991962 ("mptcp: create msk early")
Co-developed-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2020-04-20 12:59:32 -07:00
..
crypto.c mptcp: Add ADD_ADDR handling 2020-03-29 22:14:48 -07:00
ctrl.c mptcp: new sysctl to control the activation per NS 2020-01-24 13:44:08 +01:00
diag.c mptcp: allow dumping subflow context to userspace 2020-03-29 22:14:48 -07:00
Kconfig mptcp: select CRYPTO 2020-02-16 19:37:16 -08:00
Makefile mptcp: add netlink-based PM 2020-03-29 22:14:49 -07:00
mib.c mptcp: add and use MIB counter infrastructure 2020-03-29 22:14:49 -07:00
mib.h mptcp: add and use MIB counter infrastructure 2020-03-29 22:14:49 -07:00
options.c mptcp: add some missing pr_fmt defines 2020-04-03 16:06:32 -07:00
pm.c mptcp: add some missing pr_fmt defines 2020-04-03 16:06:32 -07:00
pm_netlink.c mptcp: add some missing pr_fmt defines 2020-04-03 16:06:32 -07:00
protocol.c mptcp: handle mptcp listener destruction via rcu 2020-04-20 12:59:32 -07:00
protocol.h mptcp: subflow: check parent mptcp socket on subflow state change 2020-04-02 06:59:21 -07:00
subflow.c mptcp: avoid flipping mp_capable field in syn_recv_sock() 2020-04-20 12:59:32 -07:00
token.c mptcp: fix "fn parameter not described" warnings 2020-04-02 06:59:21 -07:00