All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Matthieu Baerts (NGI0)" <matttbe@kernel.org>
Cc: mptcp@lists.linux.dev
Subject: Re: [PATCH net-next 03/10] mptcp: pm: don't drop an RM_ADDR because of an ADD_ADDR
Date: Sat, 05 Dec 2026 21:45:40 +0000	[thread overview]
Message-ID: <sashiko-outbox-251921@kernel.org> (raw)
In-Reply-To: <20261204-net-next-mptcp-misc-feat-7-5-v1-3-1449de51adae@kernel.org>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] mptcp: pm: mptcp_pm_remove_addr() leaves RM_ADDR unsent
  behind ADD_ADDR
--

commit ae45d6f32d8cb1d980533b6114831ae762e410fd
Author: Josef Bacik <josef@toxicpanda.com>

mptcp: pm: don't drop an RM_ADDR because of an ADD_ADDR

This commit changes mptcp_pm_remove_addr() to check only
MPTCP_RM_ADDR_SIGNAL via mptcp_pm_should_rm_signal() instead of any bit
in msk->pm.addr_signal, so that an RM_ADDR is not dropped when an
ADD_ADDR or echo is pending.

> 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]
Does returning from mptcp_pm_remove_addr() with MPTCP_RM_ADDR_SIGNAL
still pending defeat subflow avoidance and drop or strand RM_ADDR
notifications?

mptcp_pm_remove_addr() calls mptcp_pm_addr_send_ack_avoid_list() once,
but mptcp_established_options() evaluates ADD_ADDR/echo ahead of
else if (mptcp_established_options_rm_addr()).  That single pure ACK
consumes the ADD_ADDR or echo and leaves MPTCP_RM_ADDR_SIGNAL set.

In mptcp_nl_remove_subflow_and_signal_addr(), the caller still holds
lock_sock(sk) and immediately calls mptcp_pm_rm_subflow().  Its
mptcp_subflow_shutdown() -> tcp_send_ack() then sends the leftover
RM_ADDR over the removed subflow instead of a healthy one.

This defeats commit fb8d0bccb221 ("mptcp: pm: avoid sending RM_ADDR
over same subflow") and loses the RM_ADDR when the removed interface
is already down.

In mptcp_pm_flush_addrs_and_subflows(), flushing more than
MPTCP_RM_IDS_MAX announced-only endpoints loops immediately under the
same lock_sock(sk), sees MPTCP_RM_ADDR_SIGNAL still set, and drops the
next batch with MPTCP_MIB_RMADDRTXDROP.

On an idle connection with no subflow shutdown (for example, removing
a signal-only endpoint while both ADD_ADDR and echo are pending),
MPTCP_RM_ADDR_SIGNAL can stay stranded until unrelated traffic occurs.

Calling mptcp_pm_addr_send_ack_avoid_list() in a bounded loop while
mptcp_pm_should_rm_signal(msk) stays set and msk->pm.addr_signal
clears a bit would flush the pending signals over the healthy subflow
before returning.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261204-net-next-mptcp-misc-feat-7-5-v1-0-1449de51adae@kernel.org?part=3

  reply	other threads:[~2026-12-05 21:45 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-04 21:44 [PATCH net-next 00/10] mptcp: misc improvements for v7.5 Matthieu Baerts (NGI0)
2026-12-04 21:44 ` [PATCH net-next 01/10] mptcp: pm: work on a copy of the received RM_ADDR list Matthieu Baerts (NGI0)
2026-12-04 21:44 ` [PATCH net-next 02/10] mptcp: pm: don't drop an RM_ADDR behind a pending one Matthieu Baerts (NGI0)
2026-12-05 22:04   ` netdev-bot+sashiko
2026-12-04 21:44 ` [PATCH net-next 03/10] mptcp: pm: don't drop an RM_ADDR because of an ADD_ADDR Matthieu Baerts (NGI0)
2026-12-05 21:45   ` sashiko-bot [this message]
2026-12-05 22:04   ` netdev-bot+sashiko
2026-12-04 21:44 ` [PATCH net-next 04/10] mptcp: pm: keep an RM_ADDR when computing the MSS Matthieu Baerts (NGI0)
2026-12-04 21:44 ` [PATCH net-next 05/10] mptcp: annotate lockless access to msk->scaling_ratio Matthieu Baerts (NGI0)
2026-12-05 22:04   ` netdev-bot+sashiko
2026-12-04 21:44 ` [PATCH net-next 06/10] selftests: mptcp: join: dump stats with right title Matthieu Baerts (NGI0)
2026-12-04 21:44 ` [PATCH net-next 07/10] selftests: mptcp: sockopt: pass total bytes to do_getsockopts Matthieu Baerts (NGI0)
2026-12-05 22:04   ` netdev-bot+sashiko
2026-12-04 21:44 ` [PATCH net-next 08/10] selftests: mptcp: sockopt: drop unreachable FIN accounting Matthieu Baerts (NGI0)
2026-12-05 22:04   ` netdev-bot+sashiko
2026-12-04 21:44 ` [PATCH net-next 09/10] mptcp: add msk_is_mptcp() helper Matthieu Baerts (NGI0)
2026-12-04 21:44 ` [PATCH net-next 10/10] selftests: mptcp: print stats before socket closure Matthieu Baerts (NGI0)

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=sashiko-outbox-251921@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=matttbe@kernel.org \
    --cc=mptcp@lists.linux.dev \
    --cc=sashiko-reviews@lists.linux.dev \
    /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.