From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796508249; b=XiWi0RjCEfHi6QiHPpd0NcQF2k7bqzzscrMMnvBwlIe1ccU/E5e79ePIWDVcGRq9oAqY ZsTZ/uxxy15a2vvUtzB0PuA/NYm5iM0JacbEZCARX951pbg0VmuwNpkvDihPC2n/fKUBQ PVctZjtbifkK9C6ftPpEHYIfARgUWu41J+quDAZNhSJgMon0TeATpasG954eoNSREphd1 V3GZCrIHLczONZEknH8wjM8Fv412+yPEsgEiiUAj7xcq/dlwtGCq/K5Pvro4e8RvxnKvM AE2e7BcRKEWSIwqR2PGrpEBbWnmb9qElvD72f1VIb6TyU31f14Ub7K+r6bU+5aQmuoA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796508249; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=OFmzy64/jRh59Or4mJ7+Ihx8Tzyt34SEFDjEiaW8l/Y=; b=RYxlrEhxF+4fZlDEzKViOO6zGSjDmmCsBd7agRMac9XAa4Q/J60E1+vTpSIpIn07i7Yq K5zSJeFlNB3QaaxoHlXI3YS3HipPXQL00osn/T6DMh8EMghf981iIGBZXF/af9k9QmWPt 8Eb5rzw5bIf6eKvMiJ/FlYg8zJVfkgQBJc4YrVimw3My9Qw8B+bCMNRJ/AEqfJ5HojKHP HdmJQWFLzy8NXcPD8RBvhexHxxdkawQ6E5ySr3TubY2T8kZ5jsYir9oS/boO6j8zdHVas LAeO7GItEE1jkUcSNLICzyEn9/rAkyojg5ej5/qSHI5CCCUtyojl9xydDcn5wi3jQUw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Aivg1cyY; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D13CE606A31F; Sat, 5 Dec 2026 22:04:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Aivg1cyY Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9D8A51F00936; Sat, 5 Dec 2026 22:04:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796508249; bh=OFmzy64/jRh59Or4mJ7+Ihx8Tzyt34SEFDjEiaW8l/Y=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=Aivg1cyYOm2mghr8ZMMBehkcvPCgiLOp8Ll+vjaTWDwQzE4e2iVBw74gd5TmPe5g+ vB3BAeWk8XNHshtsWsZ7+kWK8IfA3+NZGWoIXCqc/Q+eHhICFovBP9FzfyFRFIvc0/ zzSnt5qsg6F/2nM/ynfOdrv07i+FB0zPtNu7FxEirRT0iOyOTz9dJ9+Ld+Cz0K96nQ YkrxsVTteVhcL07PBqHYvOY0Lg4DeVFsoBfDPLv5Peb2yF4T+mfXNaIPYzWV3Jtk6P RZGv+Xx88EvEaULk5R/aybdw+SvpFK++oY96ATYgaOyl/9m2lOL7beXiAjLg2D/CBx S+tX799OdCDZg== Subject: Re: [PATCH net-next 02/10] mptcp: pm: don't drop an RM_ADDR behind a pending one 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 Date: Sat, 05 Dec 2026 22:04:08 +0000 Message-ID: <179650824815.3148.6653715043111591603@kernel.org> In-Reply-To: <20261204-net-next-mptcp-misc-feat-7-5-v1-2-1449de51adae@kernel.org> References: <20261204-net-next-mptcp-misc-feat-7-5-v1-2-1449de51adae@kernel.org> X-sashiko-severity: Medium Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 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