Re: [PATCH net-next v2] mlxsw: spectrum_switchdev: fix wrong list member in flood rollback
From: Petr Machata
Date: Thu Dec 03 2026 - 10:08:33 EST
netdev-bot+sashiko@xxxxxxxxxx writes:
> 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.
> 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.
Thanks for digging up this info, which is henceforth available on the
list! Let's not respin for this though, please.
>> 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?
I don't thik so. This is allocating non-atomic memory, the failure
there, especially in context of a typical deployment of that code, is
not very likely. Register writes don't really fail either, at all. Let's
treat it as a nice cleanup that it is and not stir the pot with the
backports the Fixes tag would inevitably prompt.