Re: [PATCH net] net: dsa: b53: fix error propagation from b53_fdb_dump()

Florian Fainelli <[email protected]>
Newsgroups org.kernel.vger.netdev,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
On 8/12/26 13:11, Vladimir Oltean wrote:
> The blamed commit replaced "return ret" statements in b53_fdb_dump()
> with "break;" which jumps to the mutex_unlock() -> return 0 section.
> 
> This is notably problematic because it swallows errors from the
> b53_fdb_copy() -> cb() path, and this will result in FDB dump truncation
> when the netlink skb overflows - see commit 21b52fed928e ("net: dsa:
> sja1105: fix broken backpressure in .port_fdb_dump").
> 
> Let's go back to "return ret". We don't need to preinitialize "ret" with
> 0, because the "do {} while" block guarantees we cannot reach the end of
> the function without at least once calling b53_arl_search_wait(), which
> will have initialized ret to some valid value.
> 
> Fixes: f7eb4a1c0864 ("net: dsa: b53: serialize access to the ARL table")
> Signed-off-by: Vladimir Oltean <[email protected]>

Reviewed-by: Florian Fainelli <[email protected]>
-- 
Florian
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.