Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.
Critical: 0 · High: 0 · 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).
- [Medium] This patch defers an RM_ADDR, but no packet is guaranteed to
carry it later.
--
mptcp: pm: don't drop an RM_ADDR because of an ADD_ADDR
This patch changes mptcp_pm_remove_addr() so that it only drops a new
RM_ADDR when another RM_ADDR is already pending. Before, it dropped the
RM_ADDR when any bit of pm.addr_signal was set. A pending ADD_ADDR or echo
no longer stops the RM_ADDR from being queued, and the RM_ADDR is expected
to go out with a later packet.
> diff --git a/net/mptcp/pm.c b/net/mptcp/pm.c
> index dacd3cf358f5a..f12a8bfbb2a9a 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]
The commit message says "the RM_ADDR goes with a later packet". Is a
later packet always scheduled for it?
When an ADD_ADDR or echo is pending, the RM_ADDR is now queued, and
mptcp_pm_remove_addr() sends one pure ACK through
mptcp_pm_addr_send_ack_avoid_list(). In mptcp_established_options(),
RM_ADDR is only tried if ADD_ADDR is not:
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)) {
...
}
That ACK therefore carries the ADD_ADDR or echo, and
MPTCP_RM_ADDR_SIGNAL stays set.
If an MPTCP_PM_ADD_ADDR_SEND_ACK worker run is already queued (the echo
case in the commit message), mptcp_pm_worker()->mptcp_pm_addr_send_ack()
sends the RM_ADDR later.
What happens if the ADD_ADDR is pending and no worker ACK is queued? The
ACK sent at announce time by mptcp_pm_create_subflow_or_signal_addr()
might not have carried it. That can happen if no subflow was active yet.
It can also happen if the pure ACK already carried an MPC ACK, in which
case mptcp_established_options_add_addr() skips the ADD_ADDR.
In that case nothing seems to schedule another ACK for the RM_ADDR. The
only helper that re-arms an ACK checks the ADD_ADDR bit only:
net/mptcp/pm.c:
static void mptcp_pm_add_addr_send_ack(struct mptcp_sock *msk)
{
if (!mptcp_pm_should_add_signal(msk))
return;
mptcp_pm_schedule_work(msk, MPTCP_PM_ADD_ADDR_SEND_ACK);
}
ADD_ADDR retransmissions from mptcp_pm_add_addr_timer() set the ADD_ADDR
bit again and queue one worker ACK. The ADD_ADDR takes that ACK again.
On an idle connection, could the RM_ADDR then stay pending indefinitely?
While it is pending, every later call to mptcp_pm_remove_addr() takes the
new mptcp_pm_should_rm_signal() branch. It counts RmAddrTxDrop and returns
-EINVAL. The callers have already updated their state and ignore the
result: mptcp_pm_remove_announced(), the other mptcp_pm_remove_addr()
callers in pm_kernel.c and the pm_userspace.c paths. So an RM_ADDR could
still be lost indirectly because of an ADD_ADDR.
The later patch "mptcp: pm: keep an RM_ADDR when computing the MSS" only
makes data packets carry a pending RM_ADDR. It does not add an ACK
trigger, so this gap seems to remain at the end of the series.
Would it make sense for mptcp_pm_remove_addr() to schedule
MPTCP_PM_ADD_ADDR_SEND_ACK directly with mptcp_pm_schedule_work()? It
could do so when an ADD_ADDR or echo is pending, or when the RM bit is
still set after the single ACK.
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/2026…%40kernel.org