[PATCH mptcp-net v3 0/2] mptcp: pm: fix ADD_ADDR timer infinite retry on option space shortage

Li Xiasong posted 2 patches 2 weeks, 3 days ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/multipath-tcp/mptcp_net-next tags/patchew/20260507125224.3536507-1-lixiasong1@huawei.com
net/mptcp/pm.c                                | 56 +++++++++++++++----
.../testing/selftests/net/mptcp/mptcp_join.sh | 31 ++++++++++
2 files changed, 77 insertions(+), 10 deletions(-)
[PATCH mptcp-net v3 0/2] mptcp: pm: fix ADD_ADDR timer infinite retry on option space shortage
Posted by Li Xiasong 2 weeks, 3 days ago
This series fixes a bug where the ADD_ADDR timer can keep rescheduling
indefinitely when TCP option space is insufficient, blocking subsequent
addresses in the endpoint list from being announced.

The issue is reproducible when sending an IPv6 ADD_ADDR with port while
tcp_timestamps is enabled. In that case, option space may be exhausted on
pure ACKs, and ADD_ADDR retransmission can stall PM forward progress.

Patch 1 clears the signal in this path, skips the matching ADD_ADDR
retransmission entry, and preserves PM state-machine progression.

Note on concurrency: timer cancellation in this path is best-effort.
A concurrent add_timer callback that acquires pm.lock first may still
perform one final ADD_ADDR send attempt before cancel state is applied.
After cancel sets entry->retrans_times to ADD_ADDR_RETRANS_MAX, the
callback-side check prevents further ADD_ADDR retransmissions.

Patch 2 adds a selftest to cover this behavior and prevent regressions.

Patch summary:
  - patch 1: mptcp: pm: fix ADD_ADDR timer infinite retry on option space
    insufficient
  - patch 2: selftests: mptcp: join: cover ADD_ADDR tx drop and list
    progress

Changes since v2:
  - document the possible timer-cancel race window in the commit message
    and code comments
  - keep best-effort cancellation semantics (possible one extra send
    attempt under lock-order race), while preventing further retries via
    retrans_times gating
  - selftests: remove the redundant ADD_ADDR tx-drop subtest that
    duplicated existing coverage for list progression behavior
  - link to v2:
    https://lore.kernel.org/mptcp/20260430112026.343691-1-lixiasong1@huawei.com/

Changes since v1:
  - add explicit MIB accounting for this drop path:
    - MPTCP_MIB_ADDADDRTXDROP for non-echo ADD_ADDR
    - MPTCP_MIB_ECHOADDTXDROP for echo ADD_ADDR
  - add explicit handling to stop the matching ADD_ADDR retransmission
    timer when skipping non-echo ADD_ADDR on pure-ACK option-space
    exhaustion
  - keep PM forward progress by advancing PM state after a successful
    skip of the matching ADD_ADDR entry
  - add selftest to verify IPv6 ADD_ADDR with port tx-drop when
    tcp_timestamps is enabled
  - link to v1:
    https://lore.kernel.org/netdev/20260418100018.2219500-1-lixiasong1@huawei.com/

Thanks to Matthieu Baerts for the detailed review and suggestions.

Li Xiasong (2):
  mptcp: pm: fix ADD_ADDR timer infinite retry on option space
    insufficient
  selftests: mptcp: join: cover ADD_ADDR tx drop and list progress

 net/mptcp/pm.c                                | 56 +++++++++++++++----
 .../testing/selftests/net/mptcp/mptcp_join.sh | 31 ++++++++++
 2 files changed, 77 insertions(+), 10 deletions(-)

-- 
2.34.1
Re: [PATCH mptcp-net v3 0/2] mptcp: pm: fix ADD_ADDR timer infinite retry on option space shortage
Posted by Matthieu Baerts 2 weeks, 2 days ago
Hi Li,

On 07/05/2026 14:52, Li Xiasong wrote:
> This series fixes a bug where the ADD_ADDR timer can keep rescheduling
> indefinitely when TCP option space is insufficient, blocking subsequent
> addresses in the endpoint list from being announced.
> 
> The issue is reproducible when sending an IPv6 ADD_ADDR with port while
> tcp_timestamps is enabled. In that case, option space may be exhausted on
> pure ACKs, and ADD_ADDR retransmission can stall PM forward progress.

Now in our tree:

New patches for t/upstream-net and t/upstream:
- 89d79b9cc99b: mptcp: pm: fix ADD_ADDR timer infinite retry on option
space insufficient
- 330dfb1d1df7: selftests: mptcp: join: cover ADD_ADDR tx drop and list
progress
- Results: 112def6c73e7..67f6d956336b (export-net)
- Results: 3fc124e79727..1b5f90649a5a (export)

Tests are now in progress:

- export-net:
https://github.com/multipath-tcp/mptcp_net-next/commit/292cba7c4eb827d0bf79fa02422e6c3daacf8229/checks
- export:
https://github.com/multipath-tcp/mptcp_net-next/commit/63b133728231ebba5167bd1e53dda9bcf0bee7c7/checks

Cheers,
Matt
-- 
Sponsored by the NGI0 Core fund.
Re: [PATCH mptcp-net v3 0/2] mptcp: pm: fix ADD_ADDR timer infinite retry on option space shortage
Posted by Matthieu Baerts 2 weeks, 2 days ago
Hi Li,

On 07/05/2026 14:52, Li Xiasong wrote:
> This series fixes a bug where the ADD_ADDR timer can keep rescheduling
> indefinitely when TCP option space is insufficient, blocking subsequent
> addresses in the endpoint list from being announced.
> 
> The issue is reproducible when sending an IPv6 ADD_ADDR with port while
> tcp_timestamps is enabled. In that case, option space may be exhausted on
> pure ACKs, and ADD_ADDR retransmission can stall PM forward progress.
> 
> Patch 1 clears the signal in this path, skips the matching ADD_ADDR
> retransmission entry, and preserves PM state-machine progression.
> 
> Note on concurrency: timer cancellation in this path is best-effort.
> A concurrent add_timer callback that acquires pm.lock first may still
> perform one final ADD_ADDR send attempt before cancel state is applied.
> After cancel sets entry->retrans_times to ADD_ADDR_RETRANS_MAX, the
> callback-side check prevents further ADD_ADDR retransmissions.
> 
> Patch 2 adds a selftest to cover this behavior and prevent regressions.
> 
> Patch summary:
>   - patch 1: mptcp: pm: fix ADD_ADDR timer infinite retry on option space
>     insufficient
>   - patch 2: selftests: mptcp: join: cover ADD_ADDR tx drop and list
>     progress
> 
> Changes since v2:
>   - document the possible timer-cancel race window in the commit message
>     and code comments
>   - keep best-effort cancellation semantics (possible one extra send
>     attempt under lock-order race), while preventing further retries via
>     retrans_times gating
>   - selftests: remove the redundant ADD_ADDR tx-drop subtest that
>     duplicated existing coverage for list progression behavior
>   - link to v2:
>     https://lore.kernel.org/mptcp/20260430112026.343691-1-lixiasong1@huawei.com/
Thank you for the v3, it looks good to me!

Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>

Cheers,
Matt
-- 
Sponsored by the NGI0 Core fund.
Re: [PATCH mptcp-net v3 0/2] mptcp: pm: fix ADD_ADDR timer infinite retry on option space shortage
Posted by MPTCP CI 2 weeks, 3 days ago
Hi Li,

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): Success! ✅
- 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/25496768062

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


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)