Netdev List
 help / color / mirror / Atom feed
* [PATCH net] mptcp: pm: preserve the port when removing ID 0
@ 2026-12-04  5:11 Kyuwon Cho
  2026-12-04 11:05 ` Matthieu Baerts
  0 siblings, 1 reply; 2+ messages in thread
From: Kyuwon Cho @ 2026-12-04  5:11 UTC (permalink / raw)
  To: Matthieu Baerts, Mat Martineau, Geliang Tang
  Cc: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Willem de Bruijn, Simon Horman, Kalpan Jani, netdev, mptcp

The ID 0 removal path copies the MPTCP socket's local address, then clears
its port before looking for a pending ADD_ADDR.  An ID 0 ADD_ADDR that was
announced with a port is stored with that port, so removal misses the
entry.  A later announcement of the same address finds the stale entry and
warns:

  WARNING: net/mptcp/pm.c:451 at mptcp_pm_announced_alloc
  RIP: 0010:mptcp_pm_announced_alloc (net/mptcp/pm.c:451)
  Call Trace:
   mptcp_pm_create_subflow_or_signal_addr (net/mptcp/pm_kernel.c:377)
   mptcp_pm_nl_add_addr_doit
     (net/mptcp/pm_kernel.c:983 net/mptcp/pm_kernel.c:1049)
   genl_family_rcv_msg_doit (net/netlink/genetlink.c:1114)

Use the port supplied with the removal request.  Portless removals continue
to use zero, while port-specific entries can now be found and removed.

Fixes: 2ac7d6e62076 ("mptcp: pm: kernel: drop pending ADD_ADDR when removing ID0")
Signed-off-by: Kyuwon Cho <kyuwon.cho@skku.edu>
---
This issue was found by an LLM-guided test generator used in our research prototype.
A reproducer is available on request.

 net/mptcp/pm_kernel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/mptcp/pm_kernel.c b/net/mptcp/pm_kernel.c
index f7396628490e..99bc851408a4 100644
--- a/net/mptcp/pm_kernel.c
+++ b/net/mptcp/pm_kernel.c
@@ -1151,7 +1151,7 @@ static int mptcp_nl_remove_id_zero_address(struct net *net,
 		lock_sock(sk);
 		/* Drop a possibly pending ADD_ADDR for this address. */
 		anno_addr = msk_local;
-		anno_addr.port = 0;
+		anno_addr.port = addr->port;
 		announced = mptcp_pm_announced_remove(msk, &anno_addr);
 		spin_lock_bh(&msk->pm.lock);
 		if (announced)
-- 
2.43.0


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

end of thread, other threads:[~2026-12-04 11:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-04  5:11 [PATCH net] mptcp: pm: preserve the port when removing ID 0 Kyuwon Cho
2026-12-04 11:05 ` Matthieu Baerts

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