Article View: linux.kernel.netdev
Article #27259Re: [PATCH net] mptcp: pm: preserve the port when removing ID 0
From: netdev-bot+sashiko
Date: Sat, 05 Dec 2026 05:48
Date: Sat, 05 Dec 2026 05:48
108 lines
12299 bytes
12299 bytes
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.
Critical: 0 ยท High: 1 ยท Medium: 0 ยท 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).
- [High] The patch does not reliably fix the stale ID 0 ADD_ADDR entry
and its WARN, and it breaks a removal form that used to work.
--
mptcp: pm: preserve the port when removing ID 0
This patch changes mptcp_nl_remove_id_zero_address() so the pending
ADD_ADDR lookup key uses the port from the removal request. Before, the
port was always forced to zero. The goal is to find and drop ID 0
announcements that were made with a port, which avoids a WARN in
mptcp_pm_announced_alloc() when the address is announced again.
> diff --git a/net/mptcp/pm_kernel.c b/net/mptcp/pm_kernel.c
> index f7396628490e3..99bc851408a45 100644
> --- a/net/mptcp/pm_kernel.c
> +++ b/net/mptcp/pm_kernel.c
> @@ -1151,7 +1151,7 @@ static int mptcp_nl_remove_id_zero_address(struct net *net,
> lock_sock(sk);
> /* Drop a possibly pending ADD_ADDR for this address. */
> anno_addr = msk_local;
> - anno_addr.port = 0;
> + anno_addr.port = addr->port;
> announced = mptcp_pm_announced_remove(msk, &anno_addr);
[Severity: High]
Doesn't this key still depend on how the removal request is written,
rather than on how the ID 0 entry was stored?
The ID 0 anno_list entry takes its port from the pernet endpoint behind
msk->mpc_endpoint_id. select_signal_address() copies entry->addr. Then
mptcp_pm_create_subflow_or_signal_addr() only rewrites the id to 0
before it calls mptcp_pm_announced_alloc().
mptcp_pm_announced_lookup() always compares ports:
if (mptcp_addresses_equal(&entry->addr, addr, true))
return entry;
The msk filter earlier in this function ignores the port when the
request has none:
if (!mptcp_addresses_equal(&msk_local, addr, addr->port))
goto next;
So the lookup only finds the entry if userspace repeats the endpoint's
exact port in the delete request.
Case 1: the ID 0 endpoint is "A port P signal". P has to equal
msk_local.port, as mptcp_nl_add_subflow_or_signal_addr() requires.
A portless "del id 0 A" passes the filter, builds the key {A, 0}, and
misses the {A, P} entry. The function still goes on to run:
mptcp_pm_remove_addr(msk, &list);
mptcp_pm_rm_subflow(msk, &list);
__mark_subflow_endp_available(msk, 0);
The entry stays on anno_list and add_addr_signaled is not decremented.
When the next signal endpoint is added, select_signal_address() can pick
A:P again, and mptcp_pm_announced_alloc() hits:
if (WARN_ON_ONCE(mptcp_pm_is_kernel(msk)))
return false;
Isn't that the same splat quoted in the commit message? The commit
message says "Portless removals continue to use zero", but that looks
like the case that still fails.
Case 2: the ID 0 endpoint is a portless "A signal". It is matched to
the msk's local address A:Q by address only. After it is announced
again, the entry is stored as {A, 0}.
A "del id 0 A port Q" request passes the filter, because Q equals
msk_local.port. It now builds the key {A, Q}, which misses {A, 0}.
Before this patch the port was forced to 0 and the entry was found.
Commit 2ac7d6e62076 relied on that behaviour. Is this a regression for
that form of the request? The commit message doesn't mention the change.
There may also be a side effect when a separate, non-ID 0 endpoint A:Q
and a portless ID 0 endpoint A exist on the same msk. Could the
port-qualified request remove the anno entry of endpoint A:Q instead?
That would decrement add_addr_signaled without a matching RM_ADDR for
that id. It isn't clear whether this state can be reached.
The non-zero ID path, mptcp_nl_remove_subflow_and_signal_addr(), uses
the stored endpoint's address and port for its lookup. Would it be more
robust to do the same here? Some options:
- match the anno_list entry on entry->addr.id == 0
- use the port of the pernet endpoint for msk->mpc_endpoint_id
- match on the address only, with use_port=false
--
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/179633974213.577499.3953204420789445318%40skku.edu
Technical Details
Message-ID:
<179644971271.3146.14330962742578426620@kernel.org>Path:
mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-mo.newsdeef.eu!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377846-linux-kernel-netdev=dewy.ruReferences:
<179633974213.577499.3953204420789445318@skku.edu>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-mo.newsdeef.eu!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377846-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net] mptcp: pm: preserve the port when removing ID 0 Date: Sat, 05 Dec 2026 05:48:32 +0000 Organization: Usenet Network Message-ID: <179644971271.3146.14330962742578426620@kernel.org> References: <179633974213.577499.3953204420789445318@skku.edu> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="2963441"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:QRyAEWsaXWx6zmKLeILG54Q1mzw= sha256:lHn9e/7FE8KUKWydf+PyMUs9z9Xk1WSu3qO/PRQcjFs= sha1:OybphChP00fMNCV8+zFuXHPYCSM= sha256:W0+pqGTXbS7FaDxvlt4MfnWIAUlSctguVxD+kuwnP30= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id F164E117D7C; Sat, 5 Dec 2026 08:48:48 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.541 X-Spam-Status: No, score=-3.541 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.142, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id aVf1j-c7v7Bk; Sat, 5 Dec 2026 08:48:45 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-377846-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 2C224117D63; Sat, 5 Dec 2026 08:48:36 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 273AC34F0E; Sat, 5 Dec 2026 05:48:35 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796449715; b=TzNjNwUiZwmuACzQ6dnYw/yQaWjEltwbRc45gnncm61A8jmu5RulJz4SWWDmqmo35aPy 1DWRvc7yBz/zUybgZT3eKiJjkEJPOSsNV8aiyjH9NimzO2cZfKNOsCgo4Zan5MEpn36Ow AUCBji4yfJjQrQDr04GJwheaO3FzA8T4ZUSywAYQDtt6KvCmzlcndfCsCgu7Wi4pepdUQ DZ/9Gyg3atEb5d0I3vJZUcd3fkVSz+2GxpX8XpAro9EvmlMVXUd8l7qbf9LwxmRkrVcov NfShPcBJqxr1q2yh8UCJcz/EP9mkcFc5gdr80XjPKBWsoRK7BYb4swJUYBDtqZT40Kw== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796449715; h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc: Date:Message-ID:In-Reply-To:References:X-sashiko-severity: Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version; bh=0j8Lx6K9D8qA9GVFuXipadoQBVf6u9fHy/jLjFG53Tw=; b=cg1UOubc1ltQQsRsu9+qClKGXdj1ewh4zeWmeMr3pTHuLAdwHd3W0IKw/Gq3V8UbqaXw GwYzTtaDQAhLjKC6x5ElScafdHssrhEjzX2yVFNyqoIvK6OsBYhZUZmqb3dI+f8QgkDGa DRI6l2RyjTS2/nU6YQJYakeDjZmiiCoQUyEn2kAZZYItGZ0e1Lt4ECBSw8BiwFGVG9t3F 0mh34K6iIV5amMrn6NdCWzBgjngAPvIyv+xvmQWh0wGwcYNiJUVvi6Y5Dj5u8XH6bUw/A tp+4/yG2mijlDSPSraJBr8ZYyeFGY7siApvqC4OfkNZe+f8DtqjdqNIM6wGds2B7QbA== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=SbqBZY2A; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F2F8D606A337; Sat, 5 Dec 2026 05:48:34 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=SbqBZY2A X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796449714; b=oaV3Sa7IM0PlyB/0h6HbbyS/zAWPzHzZ2ncmuzN3wxmU5mZ0lu32Gh6hGTaGo7dFqgps 7pYcDmmxJuuOA9vI+LMcu9V1wpi2DUY4av3H0Z4vaw8jQ6V5TWLVLe9SeX94a+eFYBPNf DEiUiIXOsgiWyJ1TPMeDcYxuzSi121GyL5STsDc0wi3JpfcZfjS1vBwZl9jkmh+fn3NOQ 64Dq5m/FZrsAru3Lkm0hvFG8+nwMN6auXq2pxzrTBvgm7BWiPwiwi7DSYwPEn54ch75X1 jczbOJAJ+mxzAikIgbRMlVNQS3/6NoRYPThVLuEke51M9DOq+QqzwvBx3F7PGSXRmXA== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796449714; 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=0j8Lx6K9D8qA9GVFuXipadoQBVf6u9fHy/jLjFG53Tw=; b=Bdj9E0zfTf+x404N6hmsGG6qDdDpnai0iTA+qZN2wjfnYUM1zT1FCxIZ9dGuXSB7XRAD iRGuVDxqh39Fb/NJ58vnV54JwNtOBKEq0zcyqOVp0zxi0rqg/JEOahCON+zRcmSzlZdD7 dWVPVo8MR5T+/ahJMZ24WGGZUKdnleIgA45G5e3fQxOGw9Du2BtfwLhQfHymWT3utXXnj ywVo6VNHA/4DXJrhESrdMJKgYp27nyIO6LEaW22zntfKGDtjGSqjNeShWn0UaLCPwRgbH SWmWyFIC3FOwOCCACck7Klyu8ydHeHjvm/JnocvuMLtkacECae3611SKzrB3drgx2Ow== X-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=SbqBZY2A; arc=none smtp.remote-ip=100.103.45.18 X-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 2081A606A32D; Sat, 5 Dec 2026 05:48:33 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 20F4B1F0092B; Sat, 5 Dec 2026 05:48:33 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796449713; bh=0j8Lx6K9D8qA9GVFuXipadoQBVf6u9fHy/jLjFG53Tw=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=SbqBZY2AxDXJaOLOE22duDHHWM41SYX9bybegj7urjHD5qtR0yXh546abPJRDaO7x uy9+xcn6eyvjkwAJAdB9zNqjBqNBJlNdw+oKBDWK3XevCDF6lPziiOcgz+bcLS5hlG Q926RGQlzVnWtqZcetq78sMPPcTEEsc3m68XJ91hNIpIoTlfnI+0mSfCUJW+94oeee FuEIF9kSsM0pPVXusSP/NawurDJ6D5rIaH1jl5hwvYyAVTgbtf1wYPvPpKXesgoT1u yHb41QaSiOFsxqwLoVz1EsGBxP/HVN3aK6BmhXvokvy0iuGUjivkfYDcdYPjFTYVNP MRmPJbUmCla8A== X-Cc: matttbe@kernel.org, martineau@kernel.org, geliang@kernel.org, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, willemb@google.com, horms@kernel.org, kalpan.jani@mpiricsoftware.com, netdev@vger.kernel.org, mptcp@lists.linux.dev X-In-Reply-To: <179633974213.577499.3953204420789445318@skku.edu> X-sashiko-severity: High X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list