Hi Tao, Matt,
Thank you Tao for identifying the port mismatch in v3 and providing a
deterministic reproducer — both are incorporated in this series.
The problem with v3: mptcp_remove_anno_list_by_saddr() compares
addresses with use_port=true. Signal endpoints added without an
explicit port are stored in the anno_list with port 0, but msk_local
carries the connection's actual local port. So the v3 lookup always
missed the stale entry, making the patch a no-op. Confirmed with a
temporary printk showing msk_local.port=5000 and announced=0 on v3,
and announced=1 after clearing the port.
This series:
Patch 1 fixes mptcp_nl_remove_id_zero_address() to tear down the
pending ADD_ADDR symmetrically with the non-zero id path: copy
msk_local, clear the port, call mptcp_remove_anno_list_by_saddr(),
and decrement add_addr_signaled if announced.
Patch 2 adds the regression test based on Tao's reproducer. Verified:
- unpatched kernel: WARNING: net/mptcp/pm fires, test reports FAIL
- patched kernel: no WARNING, test reports PASS
Tested with mptcp/mptcp-upstream-virtme-docker auto-normal. All
existing selftests pass (packetdrill_add_addr failure is pre-existing
and unrelated to this series).
Kalpan Jani (2):
mptcp: pm: drop pending ADD_ADDR when removing id 0 endpoint
selftests: mptcp: add regression test for stale ADD_ADDR on id 0
removal
net/mptcp/pm_kernel.c | 8 ++
.../net/mptcp/mptcp_id0_stale_anno.sh | 85 +++++++++++++++++++
2 files changed, 93 insertions(+)
create mode 100755 tools/testing/selftests/net/mptcp/mptcp_id0_stale_anno.sh
--
2.43.0