Article View: linux.kernel.netdev
Article #26412Re: [PATCH net-next v2] mlxsw: spectrum_switchdev: fix wrong list member in flood rollback
From: netdev-bot+sashiko
Date: Thu, 03 Dec 2026 14:06
Date: Thu, 03 Dec 2026 14:06
112 lines
12007 bytes
12007 bytes
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 v2 changelog says the Fixes: tag was dropped as "non-
regression".
- [Low] The commit message for "mlxsw: spectrum_switchdev: fix wrong list
member in flood rollback" explains the mechanics: rollback now…
--
mlxsw: spectrum_switchdev: fix wrong list member in flood rollback
This patch fixes the err_fid_flood_set rollback loop in
mlxsw_sp_bridge_vlans_flood_set(). The loop now iterates with the
bridge_vlan_node member instead of the list member, so it walks
bridge_vlan->port_vlan_list just like the forward loop.
> Use bridge_vlan_node so rollback computes the proper container address
> and walks the same list as the forward loop.
[Severity: Low]
Could the commit message also say what the old rollback did when
mlxsw_sp_fid_flood_set() failed?
In struct mlxsw_sp_port_vlan, list links the entry into
mlxsw_sp_port->vlans_list. bridge_vlan_node links it into
bridge_vlan->port_vlan_list:
struct mlxsw_sp_port_vlan {
struct list_head list;
struct mlxsw_sp_port *mlxsw_sp_port;
struct mlxsw_sp_fid *fid;
...
struct list_head bridge_vlan_node;
};
So the old loop walked the failing port's vlans_list. It called
mlxsw_sp_fid_flood_set(..., !member) on the FIDs of unrelated VLANs on
that port and rewrote their hardware flood membership.
The check against &bridge_vlan->port_vlan_list could never match, so the
loop never stopped there. When the walk reached &mlxsw_sp_port->vlans_list,
it treated the list head as an entry. Since list is at offset 0, ->fid
pointed at mlxsw_sp_port->qdisc and ->mlxsw_sp_port pointed at
mlxsw_sp_port->default_vlan:
struct mlxsw_sp_port {
...
struct list_head vlans_list;
struct mlxsw_sp_port_vlan *default_vlan;
struct mlxsw_sp_qdisc_state *qdisc;
...
};
mlxsw_sp_fid_flood_set() then follows fid->fid_family and
fid_family->flood_profile through that garbage pointer, which would likely
oops. If it doesn't oops, the walk goes round the circular list forever.
A bridge mcast_snooping toggle can reach this path:
mlxsw_sp_port_attr_set()->mlxsw_sp_port_mc_disabled_set()->
mlxsw_sp_bridge_ports_flood_table_set()->mlxsw_sp_bridge_vlans_flood_set()
It triggers when mlxsw_sp_fid_flood_set() -> mlxsw_sp_pgt_entry_port_add()
fails because an allocation or a register write fails.
Documentation/process/submitting-patches.rst asks for the user-visible
impact even when a problem was found by code review. Could the changelog
mention the possible oops or endless loop? Otherwise the fix may look like
a cosmetic error-path cleanup.
> v1 -> v2:
> - Retarget from net to net-next, drop non-regression Fixes tag, and add
> Petr Machata's Reviewed-by.
[Severity: Medium]
Should this keep a Fixes: tag?
git blame shows that this commit added both
mlxsw_sp_bridge_vlans_flood_set() and the list member in its rollback
loop:
a6f43b1dad800d ("mlxsw: spectrum_switchdev: Simplify mlxsw_sp_port_mc_disabled_set()")
That commit is in v6.0 and later.
Documentation/process/maintainer-netdev.rst says the Fixes: tag is
required for fixes regardless of the tree. That applies whether or not the
bug is a regression.
Without the tag or a Cc: stable, stable kernels from v6.0 on have nothing
telling them they need this one-line fix. They would keep the rollback
path described above.
Something like:
Fixes: a6f43b1dad800d ("mlxsw: spectrum_switchdev: Simplify mlxsw_sp_port_mc_disabled_set()")
I couldn't see the v1 review discussion. If a maintainer asked for the tag
to be dropped there, please disregard this.
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261201140545.1572541-1-zihengw03%40163.com
Technical Details
Message-ID:
<179630676913.3146.11195765689296855371@kernel.org>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu.MISMATCH!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.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-376646-linux-kernel-netdev=dewy.ruReferences:
<20261201140545.1572541-1-zihengw03@163.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu.MISMATCH!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.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-376646-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v2] mlxsw: spectrum_switchdev: fix wrong list member in flood rollback Date: Thu, 03 Dec 2026 14:06:09 +0000 Organization: Usenet Network Message-ID: <179630676913.3146.11195765689296855371@kernel.org> References: <20261201140545.1572541-1-zihengw03@163.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="2509119"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:C2vPxZMz5UZFsoRtSAxaf7lX8tc= sha256:znm3R7DoDbd6yj9IfNsZPX3AMFPCrttFfADy7SwmXdo= sha1:lyapQVW5IqL2MwmNzEpmwHfGq9k= sha256:QvVS6SYVzMvM6dvooXjAbDesc1CAwed8z7IgNxMFSEc= 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 E0323117971; Thu, 3 Dec 2026 17:06:24 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.74 X-Spam-Status: No, score=-3.74 tagged_above=-9999 required=6.31 tests=[DKIMWL_WL_HIGH=-0.24, 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] 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 pLuvqcjdtRxc; Thu, 3 Dec 2026 17:06:21 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-376646-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 tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id 7D972117961; Thu, 3 Dec 2026 17:06:13 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id C67B8242AC; Thu, 3 Dec 2026 14:06:11 +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=1796306771; b=PkSmf7mobRZmLzvY02dC4TNNH/LKAuB0kqWXyHwWX2UktGelAXZCy6Z19mVUswssiqI0 5Ux6AfM0WOC5zonqzFEpKRjBv6hmMa1b8bZS9+PMTICbsruY4RtcfIIJHVKkT/ue23dy6 9S/36roTZSTAA5ZrrMy7Z148pXeAqzyeIVWlm+oCmWpzVA5YksyyDhnXZdLRe21cTM9QD mpmGIIuEdKo+XF9sZh8zgZ1b2kfYzc+HOj5c40zzrbke3T8fagJv0nNHF8H3dqZdm19PU 1TZEVSn6iyX7wZ78EBjyxh/m83tM2cU/R40+tBLsPtI4PzqkqfTQy3fXUuCTtV5WeYg== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796306771; 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=Lp/YVVR2FyseWTpBPbnqK1kgVPP4Gg7GOYiOF/NIkiI=; b=sXXMUL1xR/TRgbB6xcweP2RddOh7tNWat1O3bgQ+nV9MdkgNkHaAZ6j9DwmYmsIkSqMM AkbkTIO/AQAQM/1scf1TtEcBmQUiO/dZf2eapfun37SIf/8gLOULvXVf7bQe0F5xjNvcd QwPvcTKVHj6DzTB7BAGvuY2ZS8A8hGf/1eKt7CcaMtNJk1SATst2tmlZaWZ7XkXJ7Kwoy yjk9SlGh30kmT11QAOLlAJ/Xqz3gZ8dHXaMEQU+47uMaR77e2pAFrtrE7rZKLP/LgGXMu wQvmi0fO/ZUB3O2K5kvlabFOx+TCaTxPRbaVaHUsPt6F9cxPGqoIL8ke2MANZl/aGmw== 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="awS/gmqA"; 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 78514606A336; Thu, 3 Dec 2026 14:06:11 +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=awS/gmqA 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=1796306770; b=eJgHLePBuxPVtmCB6Fc7qyX5DFl+Qg3ejzw0A0C1z0f68ZiYiEGPcK3sJEXZPPatrnUQ AQFWAL5ry5GCgEZdEfToVFzyvIRfdyukqcbO77lSQ/UdmD7oMbqydtLAxPXSzmwmYbwsQ nk34ELLfRQ8/dZc7v0YWQW60TySM0n7Hdao4OHiqQP7+Vf9noEc5B5fii2oQevL5tgsQZ eqb4d6zppgcxggMdvyRbZjE37QB3O48bLO7AoWfj4XS7VdNgslEZ1KJXBsBZipThJtkNg IAgJNcnMiyFA4ACqOrz2Cwk94sMtYYpdb5JuGyhfZzgU3P6DjgegNWu3JuM3I6C3dGg== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796306770; 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=Lp/YVVR2FyseWTpBPbnqK1kgVPP4Gg7GOYiOF/NIkiI=; b=xhcjB7nOMU5EdGwUTdvd9Mq3y1Zv7PSIuZxOKf9AwrGzZrEU7wzZJFKu4CxczUtSloFa dQPmYeIV1p/3/MUiizEWMmzuf9RVDuB3RYYoKyWzyTr/o5xdDTpdxNIkeYL29vwSAg69M HhbsQ+DBE/NiXTJbn0h+1C7cKP8G0vi9+yBfgQKv2uP2EsDncerdB4WFN8WJJObu73WUX POB0/1AYFGC2imivMyp+u2+y24YVJKWw5lqOwpk0NdXeLwpKMMzsGOYra2hQxPPKZ7WN8 4AJUxrfyO1ztgjC6ykmVG0Gxp78p4OCFDPUyqs3grwHImAiC47NXzP1uZ86AG2VVAJA== 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="awS/gmqA"; 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 9729E606A322; Thu, 3 Dec 2026 14:06:10 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 93D121F00893; Thu, 3 Dec 2026 14:06:09 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796306770; bh=Lp/YVVR2FyseWTpBPbnqK1kgVPP4Gg7GOYiOF/NIkiI=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=awS/gmqA67qXxyPAbaGLE+ixMAazOFNepBboAOHU8gYwlir+2ti77DZGTodetHNAo DkkFOZ4Vc9G9iNJkqx7TcTT6B297IHM9P1agWwJIRqTF+ENwmo5P4A3nMzKwNmDy52 7HQqZQ0WnJTnnjiXULEEJkdWK9QrHnYTYRTWMUqx1SN6sj885U3lf96RPyBNiae32e u77UkWQEZYld8DFPc2uijlZ4uOr7vZa1yYgihWrK0E5hNVTdPhWEFNd42kwNjaA6Wb nRP0SUCXTfmS2vAAtlgMTgufQNe1EVuEOyjjKb6MK4UFNB1I+kpxxH6J+l12peVu/4 pAx8t9qPVBQ9w== X-Cc: idosch@nvidia.com, petrm@nvidia.com, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org X-In-Reply-To: <20261201140545.1572541-1-zihengw03@163.com> X-sashiko-severity: Medium 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