Re: [PATCH net v2 6/6] net: bcmasp: fix network filter lookup and wake filter pair allocation
From: Justin Chen
Date: Fri Oct 09 2026 - 15:06:00 EST
On 10/8/26 2:06 PM, Florian Fainelli wrote:
In bcmasp_netfilt_get_init(), when looking up an existing filter (!init)
for a specified location, if the filter at loc was not claimed, the
previous loop continued searching higher indices and could return an
arbitrary unrelated filter belonging to the port. This caused flow get or
delete operations on an empty rule location to return or delete an
unintended filter.
Fix this by checking only the requested location on lookup and rejecting
RX_CLS_LOC_ANY when !init. In addition, harden wake filter allocation
and release by ensuring wake filter pair searches stay on even boundaries
where both entries are free, checking that loc + 1 is free for positioned
wake filters, and validating parity and bounds on release.
Fixes: c5d511c49587 ("net: bcmasp: Add support for wake on net filters")
Assisted-by: LLM
Signed-off-by: Florian Fainelli <florian.fainelli@xxxxxxxxxxxx>
Reviewed-by: Justin Chen <justin.chen@xxxxxxxxxxxx>