mptcp: add regression test for stale ADD_ADDR on id 0 removal (issue #620) - #201
Conversation
matttbe
left a comment
There was a problem hiding this comment.
Thank you for the new test! Here is a first global comment
007821e to
7150307
Compare
|
Hi Matt, Thanks for the review. Fixed in the latest push:
Cheers, |
|
|
||
| --tolerance_usecs=100000 | ||
| `../common/defaults.sh` | ||
| `sysctl -wq net.mptcp.add_addr_timeout=1` |
There was a problem hiding this comment.
mmh, how did you test this?
parse error at '`sysctl -wq net.mptcp.add_addr_timeout=1`': syntax error
after having fixed that, I get an error at line 35:
semantic error: TCP options are not padded correctly to ensure TCP header is a multiple of 4 bytes: 2 excess bytes
There was a problem hiding this comment.
Mmmh, I continued debugging this, and it really looks like this .pkt was generated by AI... It looks correct, but full of errors. Plus untested.
I just sent what I modified so far, but I didn't finish, and late for other meetings. I hope this is just a one off...
7150307 to
492bf80
Compare
|
Hi @matttbe I apologize — the test was not validated locally before submission. I do have a working tested reproducer from an earlier version: a Sorry for the wasted time. |
matttbe
left a comment
There was a problem hiding this comment.
@k-jani-git : with what happened here, I do think it is best if you fix this packetdrill test.
| +0.0 `ip mptcp endpoint delete id 0 $OPT_LOCAL_IP` | ||
|
|
||
| // ---- Signal saddr0 as id 0; kernel sends ADD_ADDR(id=0); echo withheld ---- | ||
| +0.0 `ip mptcp endpoint add $OPT_LOCAL_IP signal` |
There was a problem hiding this comment.
here, better add a small delay like .5 sec
|
|
||
| // ---- Re-add id 0 to force PM reselection ---- | ||
| +0.0 `ip mptcp endpoint add $OPT_LOCAL_IP signal` | ||
|
|
There was a problem hiding this comment.
here, we should see the ADD_ADDR, the echo can be injected.
| // 3. Signal saddr0 as id 0: kernel sends ADD_ADDR(id=0); echo withheld | ||
| // 4. Delete id 0: fixed kernel cancels anno entry; unfixed leaves it stale | ||
| // 5. Re-add id 0: fixed kernel finds no stale entry; unfixed hits WARN | ||
| // 6. Inject data, expect plain DSS ACK (no ADD_ADDR piggybacked) |
There was a problem hiding this comment.
the sequence can be removed: no longer correct, and it was redundant with the comments below
|
@k-jani-git : did you manage to have a working reproducer with packetdrill? Note that the current implementation has some limitations, it is possible that it is not possible to reproduce the bug with the current version, and that's fine, but in this case, it would be good to know the limitations. Knowing them, I can also help to find workarounds (if possible). |
|
Hi @matttbe Not yet, I haven't been able to get back to this. I'll send an update once I have something tested. Thanks for the offer — once I've had a proper look I'll come back with the specific point where packetdrill blocks it, so you can see whether there's a workaround. Happy to take any input you have at that stage. |
|
@k-jani-git thank you for your reply. No problem, we can hold this and the attached kernel patch a bit longer. |
f4e8f77 to
b59c4d4
Compare
|
Hi @matttbe Pushed a rewritten test. This time I validated it in the virtme-docker On export/20260622T173908, without the fix: With the "mptcp: pm: drop pending ADD_ADDR when removing id 0 endpoint" patch While getting there I also confirmed the WARNING itself is reachable from this Your explanation about the endpoint linked to the initial subflow is what Three limitations I hit, since you asked about them:
Sorry again for the earlier untested submission, and thanks for the time you |
Regression test for issue #620: multipath-tcp/mptcp_net-next#620 Removing the endpoint linked to the initial subflow with "delete id 0" used to skip cancelling a pending ADD_ADDR announcement: the anno_list entry was left alive and add_addr_signaled was not decremented. A later PM reselection would then re-announce that address and trip WARN_ON_ONCE() in mptcp_pm_announced_alloc(). The test establishes an MPC connection and lets the kernel create a second subflow from a 'subflow' endpoint. The 'signal' endpoint is then added after the connection is established: mptcp_mpc_endpoint_setup() has already run without clearing its bit, so the address is announced with ID 0. The echo is withheld, the endpoint is removed with "delete id 0", and the PM counter is checked via ss(8): add_addr_signal must be back to 0. On an unfixed kernel the counter stays at 1 and the test fails. Note that the reselection itself is not asserted: after "delete id 0" no second ADD_ADDR is emitted even on a fixed kernel, so the check is on the path manager counter rather than on a packet. Suggested-by: Matthieu Baerts (NGI0) <matttbe@kernel.org> Signed-off-by: Kalpan Jani <kalpan.jani@mpiricsoftware.com> [ Disable TCP TS, fix alignment, expect RM_ADDR, remove sleep ] Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
b59c4d4 to
4bbbd09
Compare
Regression test for the kernel fix at:
https://lore.kernel.org/mptcp/ (v5 patch 1)
Issue: multipath-tcp/mptcp_net-next#620
The id 0 endpoint removal path used to skip cancelling a pending
ADD_ADDR announcement, leaving the anno_list entry alive. A subsequent
PM reselection would re-announce that address and trip WARN_ON_ONCE()
in mptcp_pm_announced_alloc().
The test establishes an MPC connection with a second MP_JOIN subflow,
signals the MPC address as id 0 (creating a pending anno_list entry),
withholds the echo, then deletes and re-adds id 0. It probes with a
data segment and expects a plain DSS ACK back with no ADD_ADDR
piggybacked. On an unfixed kernel a spurious ADD_ADDR(id=0) appears
on that ACK and the test fails.
Co-developed-by: Tao Cui cuitao@kylinos.cn
Signed-off-by: Kalpan Jani kalpan.jani@mpiricsoftware.com