]> git.baikalelectronics.ru Git - kernel.git/commit
mptcp: avoid flipping mp_capable field in syn_recv_sock()
authorPaolo Abeni <pabeni@redhat.com>
Mon, 20 Apr 2020 14:25:05 +0000 (16:25 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 20 Apr 2020 19:59:32 +0000 (12:59 -0700)
commitacf9be66301b6e39f0a66b2dafd3438774156c03
treee8ff0a201d2de1a6ac95477b601181fdfb2f9c96
parent17f98d4d9bfc53b826ce2d0247170ef74b129751
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: 3839e3e2f8d7 ("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>
net/mptcp/subflow.c