MPTCP Linux Development
 help / color / mirror / Atom feed
* [PATCH] mptcp: pm: don't WARN on re-announced addr in kernel PM
@ 2026-05-25 12:19 Kalpan Jani
  2026-05-25 13:31 ` MPTCP CI
  2026-05-26  8:39 ` Matthieu Baerts
  0 siblings, 2 replies; 5+ messages in thread
From: Kalpan Jani @ 2026-05-25 12:19 UTC (permalink / raw)
  To: mptcp
  Cc: matttbe, martineau, pabeni, janak, shardul.b, kalpanjani009,
	shardulsb08, Kalpan Jani

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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-05-27  0:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-25 12:19 [PATCH] mptcp: pm: don't WARN on re-announced addr in kernel PM Kalpan Jani
2026-05-25 13:31 ` MPTCP CI
2026-05-26  8:39 ` Matthieu Baerts
2026-05-26 11:15   ` [PATCH net] " Kalpan Jani
2026-05-27  0:59     ` Matthieu Baerts

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox