mptcp: set msk local address earlier
authorPaolo Abeni <pabeni@redhat.com>
Fri, 21 Oct 2022 22:58:54 +0000 (15:58 -0700)
committerJakub Kicinski <kuba@kernel.org>
Tue, 25 Oct 2022 04:13:55 +0000 (21:13 -0700)
commite72e4032637f4646554794ac28a3abecc6c2416d
tree450eaea62bb1923c1b52664e71b4558b079285bc
parent4a4b6848d1e932b977e6a00cda393adf7e839ff8
mptcp: set msk local address earlier

The mptcp_pm_nl_get_local_id() code assumes that the msk local address
is available at that point. For passive sockets, we initialize such
address at accept() time.

Depending on the running configuration and the user-space timing, a
passive MPJ subflow can join the msk socket before accept() completes.

In such case, the PM assigns a wrong local id to the MPJ subflow
and later PM netlink operations will end-up touching the wrong/unexpected
subflow.

All the above causes sporadic self-tests failures, especially when
the host is heavy loaded.

Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/308
Fixes: 01cacb00b35c ("mptcp: add netlink-based PM")
Fixes: d045b9eb95a9 ("mptcp: introduce implicit endpoints")
Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/mptcp/protocol.c
net/mptcp/protocol.h
net/mptcp/subflow.c