From: netdev-bot+sashiko@kernel.org
To: matttbe@kernel.org
Cc: martineau@kernel.org, geliang@kernel.org, davem@davemloft.net,
edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com,
willemb@google.com, horms@kernel.org, liyonglong@chinatelecom.cn,
shuah@kernel.org, fw@strlen.de, netdev@vger.kernel.org,
mptcp@lists.linux.dev, linux-kselftest@vger.kernel.org
Subject: Re: [PATCH net-next 02/10] mptcp: pm: don't drop an RM_ADDR behind a pending one
Date: Sat, 05 Dec 2026 22:04:08 +0000 [thread overview]
Message-ID: <179650824815.3148.6653715043111591603@kernel.org> (raw)
In-Reply-To: <20261204-net-next-mptcp-misc-feat-7-5-v1-2-1449de51adae@kernel.org>
Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · Low: 1
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] The fix only works while all pending ids fit in one RM_ADDR-
sized list.
- [Low] mptcp_pm_rm_addr_received() (net/mptcp/pm.c) now skips
mptcp_event_addr_removed() for any id that does not fit in the full…
--
mptcp: pm: don't drop an RM_ADDR behind a pending one
This patch changes mptcp_pm_rm_addr_received() so that an RM_ADDR that
arrives while the PM worker still has a previous one pending is appended
to rm_list_rx instead of being dropped. Ids that do not fit in the
MPTCP_RM_IDS_MAX sized list are still dropped and counted as RmAddrDrop.
MPTCP_EVENT_REMOVED is now only sent for the ids that were stored.
> diff --git a/net/mptcp/pm.c b/net/mptcp/pm.c
> index fd8dc1132ad15..dacd3cf358f5a 100644
> --- a/net/mptcp/pm.c
> +++ b/net/mptcp/pm.c
> @@ -843,17 +843,30 @@ void mptcp_pm_rm_addr_received(struct mptcp_sock *msk,
> const struct mptcp_rm_list *rm_list)
> {
> struct mptcp_pm_data *pm = &msk->pm;
> + bool drop = false;
> u8 i;
>
> pr_debug("msk=%p remote_ids_nr=%d\n", msk, rm_list->nr);
>
> - for (i = 0; i < rm_list->nr; i++)
> - mptcp_event_addr_removed(msk, rm_list->ids[i]);
> -
> spin_lock_bh(&pm->lock);
> if (mptcp_pm_schedule_work(msk, MPTCP_PM_RM_ADDR_RECEIVED))
> - pm->rm_list_rx = *rm_list;
> - else
> + pm->rm_list_rx.nr = 0;
> +
> + /* the worker may not have got to the previous RM_ADDR yet */
> + for (i = 0; i < rm_list->nr; i++) {
> + u8 id = rm_list->ids[i];
> +
> + if (!memchr(pm->rm_list_rx.ids, id, pm->rm_list_rx.nr)) {
> + if (pm->rm_list_rx.nr == MPTCP_RM_IDS_MAX) {
> + drop = true;
> + continue;
> + }
[Severity: Medium]
Can ids still be lost for good here? rm_list_rx is a struct mptcp_rm_list,
which only has room for MPTCP_RM_IDS_MAX (8) ids:
include/net/mptcp.h:
struct mptcp_rm_list {
u8 ids[MPTCP_RM_IDS_MAX];
u8 nr;
};
Remote ids, however, cover the whole u8 range (MPTCP_PM_MAX_ADDR_ID is
U8_MAX).
Suppose a peer sends several RM_ADDR options in separate packets. They
are all handled through mptcp_incoming_options()->
mptcp_pm_rm_addr_received() before mptcp_pm_worker() gets to
mptcp_pm_rm_addr_recv(), and together they carry more than 8 distinct
ids. In that case every id after the 8th takes this continue.
The worker only copies what was stored:
mptcp_pm_rm_addr_recv() {
struct mptcp_rm_list rm_list = msk->pm.rm_list_rx;
...
}
RM_ADDR is not retransmitted, so mptcp_pm_rm_addr_or_subflow() never runs
for the dropped ids. Wouldn't the subflows to those remote addresses stay
open? That is the symptom the commit message describes ("The subflows to
the second address stay").
A Linux peer is unlikely to do this, because mptcp_pm_remove_addr()
refuses a new RM_ADDR while one is still pending. A non-Linux or
misbehaving peer could do it, though.
The commit message says "Only the ids that do not fit in the list of
MPTCP_RM_IDS_MAX ids are dropped", but it does not say the loss is
permanent.
Would a pending bitmap of MPTCP_PM_MAX_ADDR_ID + 1 bits work here, like
the existing id_avail_bitmap in struct mptcp_pm_data? It is 32 bytes and
covers the full id space. It also removes duplicates by design and would
never need to drop an id.
> + pm->rm_list_rx.ids[pm->rm_list_rx.nr++] = id;
> + }
> + /* not for the dropped ids, and before the worker acts */
> + mptcp_event_addr_removed(msk, id);
[Severity: Low]
Because of the continue above, mptcp_event_addr_removed() is now skipped
for ids that the peer did remove but that did not fit into rm_list_rx.
Before this patch, every id of every received RM_ADDR produced
MPTCP_EVENT_REMOVED, even when the list was then dropped.
The uAPI description in include/uapi/linux/mptcp_pm.h does not tie the
event to the kernel acting on the id:
* @MPTCP_EVENT_REMOVED: An address has been lost by the peer. Attributes:
* token, rem_id.
The event is also sent in other cases: when no subflow matches, and when
mptcp_pm_rm_addr_or_subflow() returns early on TCP_LISTEN or an empty
conn_list.
In the overflow case the kernel does not close the subflows, and user
space gets no event. The only trace is the per-netns RmAddrDrop counter,
which names neither the connection nor the id.
A userspace PM (MPTCP_PM_TYPE_USERSPACE) would then have no signal to
update its view of the peer's addresses. It also could not know to issue
MPTCP_PM_CMD_SUBFLOW_DESTROY itself.
The commit message notes "The netlink events are not sent for the dropped
ids". Should the event still be sent for the dropped ids? If not, should
the uAPI documentation describe this new condition?
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261204-net-next-mptcp-misc-feat-7-5-v1-0-1449de51adae%40kernel.org
next prev parent reply other threads:[~2026-12-05 22:04 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 [this message]
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
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=179650824815.3148.6653715043111591603@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=fw@strlen.de \
--cc=geliang@kernel.org \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=liyonglong@chinatelecom.cn \
--cc=martineau@kernel.org \
--cc=matttbe@kernel.org \
--cc=mptcp@lists.linux.dev \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shuah@kernel.org \
--cc=willemb@google.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.