[PATCH] mptcp: pm: don't WARN on re-announced addr in kernel PM

Kalpan Jani posted 1 patch 5 hours ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/multipath-tcp/mptcp_net-next tags/patchew/20260525121911.2410171-1-kalpan.jani@mpiricsoftware.com
net/mptcp/pm.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
[PATCH] mptcp: pm: don't WARN on re-announced addr in kernel PM
Posted by Kalpan Jani 5 hours ago
syzkaller hit the WARN_ON_ONCE() in mptcp_pm_alloc_anno_list() with
the in-kernel path manager, reached via
mptcp_pm_create_subflow_or_signal_addr().

The WARN assumes the kernel PM can never reselect an address that is
still in msk->pm.anno_list. That is not true: when an endpoint is
removed and re-added while a previously sent ADD_ADDR is still
awaiting its echo, the endpoint id becomes available again in
id_avail_bitmap, but the matching anno_list entry (with its
retransmit timer) is still alive. The in-progress guard in
mptcp_pm_create_subflow_or_signal_addr() only checks
BIT(MPTCP_ADD_ADDR_SIGNAL), which is already cleared once the option
has been transmitted, so the address gets reselected and reaches
mptcp_pm_alloc_anno_list() a second time.

This is a benign transient state, so drop the WARN. For the kernel
PM, just bail out: the ADD_ADDR is already in flight, and the PM will
be rescheduled once it completes (or once the stale entry's timer
expires).

Fixes: cd7c957f936f ("mptcp: pm: don't try to create sf if alloc failed")
Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/620
Signed-off-by: Kalpan Jani <kalpan.jani@mpiricsoftware.com>
---
 net/mptcp/pm.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/net/mptcp/pm.c b/net/mptcp/pm.c
index 3e770c7407e1..e75c97c1f1f2 100644
--- a/net/mptcp/pm.c
+++ b/net/mptcp/pm.c
@@ -443,7 +443,14 @@ bool mptcp_pm_alloc_anno_list(struct mptcp_sock *msk,
 	add_entry = mptcp_lookup_anno_list_by_saddr(msk, addr);
 
 	if (add_entry) {
-		if (WARN_ON_ONCE(mptcp_pm_is_kernel(msk)))
+		/* The kernel PM can legitimately reselect an address whose
+		 * previous ADD_ADDR is still pending (option already sent,
+		 * echo not yet received) when the matching endpoint is
+		 * removed and re-added before the announcement completes.
+		 * Don't re-announce it: the in-flight ADD_ADDR will finish
+		 * on its own and the PM will be rescheduled afterwards.
+		 */
+		if (mptcp_pm_is_kernel(msk))
 			return false;
 
 		goto reset_timer;
-- 
2.43.0
Re: [PATCH] mptcp: pm: don't WARN on re-announced addr in kernel PM
Posted by MPTCP CI 3 hours ago
Hi Kalpan,

Thank you for your modifications, that's great!

Our CI did some validations and here is its report:

- KVM Validation: normal (except selftest_mptcp_join): Success! ✅
- KVM Validation: normal (only selftest_mptcp_join): Success! ✅
- KVM Validation: debug (except selftest_mptcp_join): Unstable: 1 failed test(s): packetdrill_dss ⚠️ 
- KVM Validation: debug (only selftest_mptcp_join): Success! ✅
- KVM Validation: btf-normal (only bpftest_all): Success! ✅
- KVM Validation: btf-debug (only bpftest_all): Success! ✅
- Task: https://github.com/multipath-tcp/mptcp_net-next/actions/runs/26401003887

Initiator: Patchew Applier
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/0d0a433a605b
Patchwork: https://patchwork.kernel.org/project/mptcp/list/?series=1100453


If there are some issues, you can reproduce them using the same environment as
the one used by the CI thanks to a docker image, e.g.:

    $ cd [kernel source code]
    $ docker run -v "${PWD}:${PWD}:rw" -w "${PWD}" --privileged --rm -it \
        --pull always mptcp/mptcp-upstream-virtme-docker:latest \
        auto-normal

For more details:

    https://github.com/multipath-tcp/mptcp-upstream-virtme-docker


Please note that despite all the efforts that have been already done to have a
stable tests suite when executed on a public CI like here, it is possible some
reported issues are not due to your modifications. Still, do not hesitate to
help us improve that ;-)

Cheers,
MPTCP GH Action bot
Bot operated by Matthieu Baerts (NGI0 Core)