From: netdev-bot+sashiko@kernel.org
To: matttbe@kernel.org
Cc: mptcp@lists.linux.dev, mason@kernel.org, pabeni@redhat.com,
kuba@kernel.org
Subject: Re: [PATCH mptcp-net 06/34] mptcp: pm: don't drop an RM_ADDR because of an ADD_ADDR
Date: Sun, 15 Nov 2026 10:53:07 +0000 [thread overview]
Message-ID: <179473998707.488855.15378426192045808798@kernel.org> (raw)
In-Reply-To: <20261113-mptcp-cmason-fixes-v1-6-9205b77e9a2f@kernel.org>
Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.
Critical: 0 · High: 1 · Medium: 1 · Low: 0
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [High] The RM_ADDR that this patch now leaves pending behind an
ADD_ADDR/echo has no reliable carrier, so a removal in the window the…
- [Medium] After this patch an RM_ADDR that has to wait behind a pending
ADD_ADDR or echo loses the rule from commit 2f79a7def595 ('avoid…
--
mptcp: pm: don't drop an RM_ADDR because of an ADD_ADDR
This patch relaxes the check in mptcp_pm_remove_addr(). An RM_ADDR is now
refused only when another RM_ADDR is pending, not whenever any bit of
pm.addr_signal is set. A pending ADD_ADDR or echo goes out first, and the
RM_ADDR is expected to follow with the next packet.
> diff --git a/net/mptcp/pm.c b/net/mptcp/pm.c
> index 32885e80486ee..5f844b9a32d81 100644
> --- a/net/mptcp/pm.c
> +++ b/net/mptcp/pm.c
> @@ -529,7 +529,7 @@ int mptcp_pm_remove_addr(struct mptcp_sock *msk, const struct mptcp_rm_list *rm_
>
> pr_debug("msk=%p, rm_list_nr=%d\n", msk, rm_list->nr);
>
> - if (rm_addr) {
> + if (mptcp_pm_should_rm_signal(msk)) {
> MPTCP_ADD_STATS(sock_net((struct sock *)msk),
> MPTCP_MIB_RMADDRTXDROP, rm_list->nr);
> return -EINVAL;
[Severity: Medium]
When an ADD_ADDR or echo is pending, which subflow carries this RM_ADDR on
the in-kernel PM endpoint removal path?
mptcp_pm_remove_addr() sets the RM bit and calls
mptcp_pm_addr_send_ack_avoid_list(). That picks a subflow that is not in
rm_list and sends one pure ACK. mptcp_established_options() checks
ADD_ADDR first:
net/mptcp/options.c:mptcp_established_options() {
...
if (mptcp_established_options_add_addr(sk, skb, &opt_size, remaining,
has_ts, opts)) {
...
} else if (mptcp_established_options_rm_addr(sk, &opt_size, remaining, opts)) {
...
}
So that ACK carries the ADD_ADDR or echo, and the RM bit stays set.
Right after that, mptcp_nl_remove_subflow_and_signal_addr() shuts down the
matching subflows:
mptcp_nl_remove_subflow_and_signal_addr()
mptcp_pm_remove_announced()
mptcp_pm_remove_addr() <- RM bit left pending
mptcp_pm_rm_subflow()
mptcp_pm_rm_addr_or_subflow()
mptcp_subflow_shutdown()
tcp_send_ack(ssk) <- DATA_FIN ACK on the removed subflow
No ADD is pending any more at that point, so
mptcp_established_options_rm_addr() puts the RM_ADDR into this DATA_FIN
ACK. That ACK goes out on the subflow being removed.
Doesn't this get around the rule from commit 2f79a7def595 ("mptcp: avoid
sending RM_ADDR over same subflow")? That commit says endpoints are
"likely removed because the attached network is no longer available". In
that case the pure ACK is lost and is not retransmitted. The RM bit has
already been cleared, so the peer still never learns that the address is
gone.
This is no worse than before the patch, when the RM_ADDR was dropped
outright. But it leaves part of the targeted case unfixed.
The commit message says:
The ACK that is sent at once carries the ADD_ADDR or the
echo then, and the RM_ADDR goes with the next packet, e.g. the ACK that
the PM worker sends for the pending echo.
On this path, isn't the next packet the DATA_FIN ACK on the removed
subflow, which is sent before the PM worker runs?
[Severity: High]
What guarantees that this deferred RM_ADDR actually gets sent?
The only transmission triggered here is the avoid-list ACK, and that ACK
takes the pending ADD_ADDR or echo. Worker ACKs are only scheduled for the
ADD bits:
net/mptcp/pm.c:mptcp_pm_add_addr_send_ack() {
if (!mptcp_pm_should_add_signal(msk))
return;
mptcp_pm_schedule_work(msk, MPTCP_PM_ADD_ADDR_SEND_ACK);
}
Both ECHO and SIGNAL can be pending at once, for example an ADD_ADDR
retransmit from mptcp_pm_add_addr_timer() plus a received ADD_ADDR. Then
the immediate ACK takes the echo, the single worker ACK takes the SIGNAL,
and nothing is scheduled for the RM_ADDR.
The same applies when a SIGNAL bit was left pending with no worker
scheduled. That happens when the ACK at announce time could not carry it,
e.g. there was no active subflow or tcp_can_send_ack() was false.
On an idle connection, would the RM_ADDR ever go out?
While it stays pending, every later mptcp_pm_remove_addr() call hits the
new mptcp_pm_should_rm_signal() check. Each one counts RMADDRTXDROP and
returns -EINVAL. These callers all ignore that return value:
mptcp_pm_remove_announced()
mptcp_nl_remove_id_zero_address()
mptcp_pm_flush_addrs_and_subflows()
mptcp_userspace_pm_remove_addr_entry()
mptcp_userspace_pm_remove_id_zero_address()
Are those later removals silently lost too?
Can the RM bit also be consumed without being sent? tcp_current_mss()
computes the header length with a NULL skb:
net/ipv4/tcp_output.c:tcp_current_mss() {
...
header_len = tcp_established_options(sk, NULL, &opts, &key) +
sizeof(struct tcphdr);
...
}
mptcp_established_options_add_addr() returns false for a NULL skb, so
mptcp_established_options_rm_addr() runs. That function has no skb check,
and mptcp_pm_rm_addr_signal() clears BIT(MPTCP_RM_ADDR_SIGNAL) and counts
RMADDRTX:
net/mptcp/pm.c:mptcp_pm_rm_addr_signal() {
...
*size = len;
*rm_list = msk->pm.rm_list_tx;
WRITE_ONCE(msk->pm.addr_signal, rm_addr);
ret = true;
...
}
The NULL skb behaviour is older than this patch. Before it, though, the
RM bit was set and sent in the same call. Now the RM_ADDR can stay pending
much longer. Any data push on any subflow before the worker ACK could
clear it without putting it on the wire: tcp_push_pending_frames(),
tcp_send_mss() in mptcp_sendmsg_frag(), or a retransmit.
This also looks like a new ordering problem with the userspace PM.
mptcp_pm_announce_addr() only checks its own bit. Suppose a peer echo is
pending and userspace removes and then re-announces ID X before the
worker runs:
userspace removes ID X
mptcp_userspace_pm_remove_addr_entry()
mptcp_pm_remove_addr() <- ACK carries the echo, RM(X) pending
userspace re-announces ID X
mptcp_pm_nl_announce_doit()
mptcp_pm_announce_addr(..., false)
mptcp_pm_addr_send_ack() <- ACK carries ADD(X), ADD wins
PM worker
mptcp_pm_addr_send_ack() <- ACK carries the stale RM(X)
The peer would then process RM(X) after ADD(X) in
mptcp_pm_rm_addr_or_subflow(). It would drop an address that is still
valid locally and close its subflows with remote_id == X. Before this
patch, RM(X) was dropped and the peer ended up with X valid.
The commit message says the RM_ADDR "goes with the next packet". Would
closing this gap need more than relaxing the check? Two options would be
to schedule a worker ACK whenever the RM_ADDR is deferred, or to stop an
option size computation with a NULL skb from consuming it.
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261113-mptcp-cmason-fixes-v1-0-9205b77e9a2f%40kernel.org
next prev parent reply other threads:[~2026-11-15 10:53 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-13 19:53 [PATCH mptcp-net 00/34] mptcp: misc fixes Matthieu Baerts (NGI0)
2026-11-13 19:53 ` [PATCH mptcp-net 01/34] tcp: drain the queues of a listen() that fails Matthieu Baerts (NGI0)
2026-11-15 10:53 ` netdev-bot+sashiko
2026-11-13 19:53 ` [PATCH mptcp-net 02/34] mptcp: " Matthieu Baerts (NGI0)
2026-11-13 20:13 ` sashiko-bot
2026-11-13 19:53 ` [PATCH mptcp-net 03/34] mptcp: clear inet_opt in the child of an IPv6 listener Matthieu Baerts (NGI0)
2026-11-13 19:53 ` [PATCH mptcp-net 04/34] mptcp: pm: work on a copy of the received RM_ADDR list Matthieu Baerts (NGI0)
2026-11-13 19:53 ` [PATCH mptcp-net 05/34] mptcp: pm: don't drop an RM_ADDR behind a pending one Matthieu Baerts (NGI0)
2026-11-15 10:53 ` netdev-bot+sashiko
2026-11-13 19:53 ` [PATCH mptcp-net 06/34] mptcp: pm: don't drop an RM_ADDR because of an ADD_ADDR Matthieu Baerts (NGI0)
2026-11-15 10:53 ` netdev-bot+sashiko [this message]
2026-11-13 19:53 ` [PATCH mptcp-net 07/34] mptcp: arm the rtx timer if a push leaves data behind Matthieu Baerts (NGI0)
2026-11-15 10:53 ` netdev-bot+sashiko
2026-11-13 19:53 ` [PATCH mptcp-net 08/34] mptcp: force the charge for the first skb of a subflow Matthieu Baerts (NGI0)
2026-11-13 20:09 ` sashiko-bot
2026-11-13 19:53 ` [PATCH mptcp-net 09/34] mptcp: leave an orphan's DATA_FIN to the worker Matthieu Baerts (NGI0)
2026-11-13 19:53 ` [PATCH mptcp-net 10/34] mptcp: don't leak an orphan when the PM closes its last subflow Matthieu Baerts (NGI0)
2026-11-13 21:10 ` sashiko-bot
2026-11-13 19:53 ` [PATCH mptcp-net 11/34] mptcp: do not use a raised snd_wnd for the send window Matthieu Baerts (NGI0)
2026-11-13 19:53 ` [PATCH mptcp-net 12/34] mptcp: drop non-MP_JOIN cookie ACKs on PM listeners Matthieu Baerts (NGI0)
2026-11-13 19:53 ` [PATCH mptcp-net 13/34] net: add __sk_net_refcnt_upgrade() with a GFP mask Matthieu Baerts (NGI0)
2026-11-13 19:53 ` [PATCH mptcp-net 14/34] mptcp: pm: don't let listeners pin their netns Matthieu Baerts (NGI0)
2026-11-13 19:53 ` [PATCH mptcp-net 15/34] mptcp: close a subflow reset for a bad mapping Matthieu Baerts (NGI0)
2026-11-13 21:40 ` sashiko-bot
2026-11-13 19:53 ` [PATCH mptcp-net 16/34] mptcp: initialize drop_req in subflow_init_req() Matthieu Baerts (NGI0)
2026-11-13 19:53 ` [PATCH mptcp-net 17/34] mptcp: pm: kernel: count endpoint listeners as sockets in use Matthieu Baerts (NGI0)
2026-11-13 19:53 ` [PATCH mptcp-net 18/34] mptcp: count a listener once when listen() is called again Matthieu Baerts (NGI0)
2026-11-13 19:53 ` [PATCH mptcp-net 19/34] mptcp: do not fallback while old data is in flight Matthieu Baerts (NGI0)
2026-11-13 22:29 ` sashiko-bot
2026-11-15 10:53 ` netdev-bot+sashiko
2026-11-13 19:53 ` [PATCH mptcp-net 20/34] mptcp: stop resending data to a peer that fell back Matthieu Baerts (NGI0)
2026-11-13 22:53 ` sashiko-bot
2026-11-15 10:53 ` netdev-bot+sashiko
2026-11-13 19:53 ` [PATCH mptcp-net 21/34] mptcp: pm: kernel: don't count signal+subflow ID 0 endp Matthieu Baerts (NGI0)
2026-11-13 19:54 ` [PATCH mptcp-net 22/34] selftests: mptcp: join: check re-adding " Matthieu Baerts (NGI0)
2026-11-15 10:53 ` netdev-bot+sashiko
2026-11-13 19:54 ` [PATCH mptcp-net 23/34] mptcp: use sk instead of casting msk in check_fully_established() Matthieu Baerts (NGI0)
2026-11-13 19:54 ` [PATCH mptcp-net 24/34] mptcp: push queued data on passive TFO subflows becoming established Matthieu Baerts (NGI0)
2026-11-13 19:54 ` [PATCH mptcp-net 25/34] mptcp: push queued data on passive TFO subflows falling back to TCP Matthieu Baerts (NGI0)
2026-11-13 23:54 ` sashiko-bot
2026-11-13 19:54 ` [PATCH mptcp-net 26/34] mptcp: don't send a FIN before the pending data on fallback Matthieu Baerts (NGI0)
2026-11-14 0:27 ` sashiko-bot
2026-11-15 10:53 ` netdev-bot+sashiko
2026-11-13 19:54 ` [PATCH mptcp-net 27/34] tcp: do not pass a BPF reqsk to an MPTCP listener Matthieu Baerts (NGI0)
2026-11-14 0:43 ` sashiko-bot
2026-11-13 19:54 ` [PATCH mptcp-net 28/34] mptcp: reclaim forward memory after coalescing skbs Matthieu Baerts (NGI0)
2026-11-13 19:54 ` [PATCH mptcp-net 29/34] mptcp: don't charge a shared page twice at accept() Matthieu Baerts (NGI0)
2026-11-13 19:54 ` [PATCH mptcp-net 30/34] mptcp: don't charge the backlog " Matthieu Baerts (NGI0)
2026-11-13 19:54 ` [PATCH mptcp-net 31/34] mptcp: don't charge a subflow twice when it joins during accept() Matthieu Baerts (NGI0)
2026-11-15 10:53 ` netdev-bot+sashiko
2026-11-13 19:54 ` [PATCH mptcp-net 32/34] mptcp: fix dummy mapping of overlapping segments Matthieu Baerts (NGI0)
2026-11-16 11:05 ` Geliang Tang
2026-11-16 15:28 ` Matthieu Baerts
2026-11-17 15:25 ` Matthieu Baerts
2026-11-13 19:54 ` [PATCH mptcp-net 33/34] mptcp: continue the last mapping after a fallback Matthieu Baerts (NGI0)
2026-11-15 10:53 ` netdev-bot+sashiko
2026-11-13 19:54 ` [PATCH RFC mptcp-next mptcp-net 34/34] mptcp: reset when the DSS disappears after a DATA_ACK Matthieu Baerts (NGI0)
2026-11-15 10:53 ` netdev-bot+sashiko
2026-11-13 21:58 ` [PATCH mptcp-net 00/34] mptcp: misc fixes MPTCP CI
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=179473998707.488855.15378426192045808798@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=kuba@kernel.org \
--cc=mason@kernel.org \
--cc=matttbe@kernel.org \
--cc=mptcp@lists.linux.dev \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.