linux/net/mptcp
Matthieu Baerts (NGI0) 9de74c227c mptcp: pm: in-kernel: C-flag: handle late ADD_ADDR
commit e84cb860ac upstream.

The special C-flag case expects the ADD_ADDR to be received when
switching to 'fully-established'. But for various reasons, the ADD_ADDR
could be sent after the "4th ACK", and the special case doesn't work.

On NIPA, the new test validating this special case for the C-flag failed
a few times, e.g.

  102 default limits, server deny join id 0
        syn rx                 [FAIL] got 0 JOIN[s] syn rx expected 2

  Server ns stats
  (...)
  MPTcpExtAddAddrTx  1
  MPTcpExtEchoAdd    1

  Client ns stats
  (...)
  MPTcpExtAddAddr    1
  MPTcpExtEchoAddTx  1

        synack rx              [FAIL] got 0 JOIN[s] synack rx expected 2
        ack rx                 [FAIL] got 0 JOIN[s] ack rx expected 2
        join Rx                [FAIL] see above
        syn tx                 [FAIL] got 0 JOIN[s] syn tx expected 2
        join Tx                [FAIL] see above

I had a suspicion about what the issue could be: the ADD_ADDR might have
been received after the switch to the 'fully-established' state. The
issue was not easy to reproduce. The packet capture shown that the
ADD_ADDR can indeed be sent with a delay, and the client would not try
to establish subflows to it as expected.

A simple fix is not to mark the endpoints as 'used' in the C-flag case,
when looking at creating subflows to the remote initial IP address and
port. In this case, there is no need to try.

Note: newly added fullmesh endpoints will still continue to be used as
expected, thanks to the conditions behind mptcp_pm_add_addr_c_flag_case.

Fixes: 4b1ff850e0 ("mptcp: pm: in-kernel: usable client side with C-flag")
Cc: stable@vger.kernel.org
Reviewed-by: Geliang Tang <geliang@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/20251020-net-mptcp-c-flag-late-add-addr-v1-1-8207030cb0e8@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2025-10-29 14:10:24 +01:00
..
bpf.c bpf: Add update_socket_protocol hook 2023-08-16 10:22:16 -07:00
crypto.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
crypto_test.c mptcp: fill in missing MODULE_DESCRIPTION() 2023-12-17 20:54:22 +00:00
ctrl.c mptcp: reset blackhole on success with non-loopback ifaces 2025-10-19 16:37:36 +02:00
diag.c tcp: ulp: diag: more info without CAP_NET_ADMIN 2025-03-07 19:39:53 -08:00
fastopen.c mptcp: cleanup mem accounting 2025-02-19 19:05:28 -08:00
Kconfig kunit: mptcp: adhere to KUNIT formatting standard 2021-04-16 17:10:40 -07:00
Makefile mptcp: pm: split in-kernel PM specific code 2025-03-10 13:35:50 -07:00
mib.c mptcp: track fallbacks accurately via mibs 2025-07-25 11:29:04 -07:00
mib.h mptcp: track fallbacks accurately via mibs 2025-07-25 11:29:04 -07:00
mptcp_diag.c mptcp: drop duplicate header inclusions 2024-03-06 20:24:10 -08:00
mptcp_pm_gen.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2024-11-07 13:44:16 -08:00
mptcp_pm_gen.h mptcp: add token for get-addr in yaml 2024-03-04 13:07:45 +00:00
options.c mptcp: tfo: record 'deny join id0' info 2025-09-15 18:12:05 -07:00
pm.c mptcp: pm: in-kernel: usable client side with C-flag 2025-10-19 16:37:36 +02:00
pm_kernel.c mptcp: pm: in-kernel: C-flag: handle late ADD_ADDR 2025-10-29 14:10:24 +01:00
pm_netlink.c mptcp: pm: nl: announce deny-join-id0 flag 2025-09-15 18:12:05 -07:00
pm_userspace.c mptcp: pm: Defer freeing of MPTCP userspace path manager entries 2025-04-23 16:27:58 -07:00
protocol.c mptcp: propagate shutdown to subflows when possible 2025-09-15 18:10:36 -07:00
protocol.h mptcp: pm: in-kernel: usable client side with C-flag 2025-10-19 16:37:36 +02:00
sched.c mptcp: sched: split validation part 2025-04-15 08:21:46 -07:00
sockopt.c mptcp: sockopt: make sync_socket_options propagate SOCK_KEEPOPEN 2025-09-09 18:38:06 -07:00
subflow.c mptcp: Fix up subflow's memcg when CONFIG_SOCK_CGROUP_DATA=n. 2025-10-15 12:03:44 +02:00
syncookies.c mptcp: don't return sockets in foreign netns 2021-09-24 10:51:36 +01:00
token.c mptcp: add statistics for mptcp socket in use 2023-01-09 07:30:50 +00:00
token_test.c mptcp: token kunit: set protocol 2024-02-26 18:42:12 -08:00