From: Matthieu Baerts <matttbe@kernel.org>
To: Mat Martineau <martineau@kernel.org>,
Geliang Tang <geliang@kernel.org>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>
Cc: netdev@vger.kernel.org, mptcp@lists.linux.dev,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next 3/8] mptcp: pm: kernel: allow flushing more than 8 endpoints
Date: Mon, 11 May 2026 13:25:25 +0200 [thread overview]
Message-ID: <549e318b-5f37-4b8b-b76a-563831525042@kernel.org> (raw)
In-Reply-To: <20260508-net-next-mptcp-pm-inc-limits-v1-3-c84e3fdf9b6a@kernel.org>
Hello,
On 08/05/2026 17:40, Matthieu Baerts (NGI0) wrote:
> The mptcp_rm_list structure contains an array of IDs of 8 entries: to be
> able to send a RM_ADDR with 8 IDs. This limitation was OK so far because
> there could maximum 8 endpoints.
>
> But this is going to change in the next commit. To cope with that, if
> one of the arrays is full, the iteration stops, the lists are processed,
> then the iteration continues where it previously stopped.
>
> Note that if there are many endpoints to remove, and multiple RM_ADDR to
> send, it might be more likely that some of these RM_ADDRs are dropped or
> lost. This is a known limitation: RM_ADDR are not retransmitted in
> MPTCPv1.
(...)
> diff --git a/net/mptcp/pm_kernel.c b/net/mptcp/pm_kernel.c
> index aabd73d15c15..ea3a7ea82013 100644
> --- a/net/mptcp/pm_kernel.c
> +++ b/net/mptcp/pm_kernel.c
> @@ -1223,19 +1223,30 @@ int mptcp_pm_nl_del_addr_doit(struct sk_buff *skb, struct genl_info *info)
> }
>
> static void mptcp_pm_flush_addrs_and_subflows(struct mptcp_sock *msk,
> - struct list_head *rm_list)
> + struct list_head *rm_list,
> + struct mptcp_pm_addr_entry *entry)
> {
> - struct mptcp_rm_list alist = { .nr = 0 }, slist = { .nr = 0 };
> - struct mptcp_pm_addr_entry *entry;
> + struct mptcp_rm_list alist, slist;
> + bool more;
>
> - list_for_each_entry(entry, rm_list, list) {
> - if (slist.nr < MPTCP_RM_IDS_MAX &&
> - mptcp_lookup_subflow_by_saddr(&msk->conn_list, &entry->addr))
> +again:
> + alist.nr = 0;
> + slist.nr = 0;
FYI, Sashiko Gemini is saying:
> Are the ids arrays in alist and slist left uninitialized on the stack here?
> Later, in mptcp_pm_remove_addr(), a full struct assignment
> (msk->pm.rm_list_tx = *rm_list) copies the structure. Could this copy
> uninitialized stack memory into the persistent socket structure and
> trigger KMSAN use-of-uninitialized-value warnings?
It is not an issue, because if 'nr' are 0, nothing else is read from the
structures. AFAICS KMSAN will then not complain if the uninitialized
values are not used.
> + more = false;
Sashiko Gemini is saying:
> If "more" is true and the function loops back to process another batch,
> mptcp_pm_remove_addr() will have already set the MPTCP_RM_ADDR_SIGNAL bit in
> msk->pm.addr_signal during the first iteration.
> Since mptcp_pm_flush_addrs_and_subflows() is called with lock_sock(sk) held,
> the MPTCP TX path cannot run to transmit the RM_ADDR and clear the signal bit
> between iterations.
> When the loop processes the second batch and calls mptcp_pm_remove_addr()
> again, msk->pm.addr_signal is still set.
> Will this cause mptcp_pm_remove_addr() to return -EINVAL and silently drop all
> batches after the first locally?
That's fine: RM_ADDR are notifications that can be lost anyway. What is
important is to remove the different addresses internally.
Cheers,
Matt
--
Sponsored by the NGI0 Core fund.
next prev parent reply other threads:[~2026-05-11 11:25 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-08 15:40 [PATCH net-next 0/8] mptcp: pm: in-kernel: increase limits Matthieu Baerts (NGI0)
2026-05-08 15:40 ` [PATCH net-next 1/8] mptcp: pm: in-kernel: explicitly limit batches to array size Matthieu Baerts (NGI0)
2026-05-08 15:40 ` [PATCH net-next 2/8] mptcp: pm: in-kernel: increase all limits to 64 Matthieu Baerts (NGI0)
2026-05-08 15:40 ` [PATCH net-next 3/8] mptcp: pm: kernel: allow flushing more than 8 endpoints Matthieu Baerts (NGI0)
2026-05-11 11:25 ` Matthieu Baerts [this message]
2026-05-08 15:40 ` [PATCH net-next 4/8] mptcp: pm: in-kernel: increase endpoints limit Matthieu Baerts (NGI0)
2026-05-08 15:40 ` [PATCH net-next 5/8] selftests: mptcp: join: allow changing ifaces nr per test Matthieu Baerts (NGI0)
2026-05-08 15:40 ` [PATCH net-next 6/8] selftests: mptcp: join: validate 8x8 subflows Matthieu Baerts (NGI0)
2026-05-08 15:40 ` [PATCH net-next 7/8] selftests: mptcp: pm: validate new limits Matthieu Baerts (NGI0)
2026-05-08 15:40 ` [PATCH net-next 8/8] selftests: mptcp: pm: use simpler send/recv forms Matthieu Baerts (NGI0)
2026-05-12 1:19 ` [PATCH net-next 0/8] mptcp: pm: in-kernel: increase limits patchwork-bot+netdevbpf
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=549e318b-5f37-4b8b-b76a-563831525042@kernel.org \
--to=matttbe@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=geliang@kernel.org \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=martineau@kernel.org \
--cc=mptcp@lists.linux.dev \
--cc=netdev@vger.kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox