* [PATCH net] net: dsa: b53: fix error propagation from b53_fdb_dump()
@ 2026-08-12 20:11 Vladimir Oltean
2026-08-12 20:24 ` Florian Fainelli
2026-08-17 21:00 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Vladimir Oltean @ 2026-08-12 20:11 UTC (permalink / raw)
To: netdev
Cc: Florian Fainelli, Jonas Gorski, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, linux-kernel
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 <vladimir.oltean@nxp.com>
---
Compile-tested only. Noticed while reviewing other things.
drivers/net/dsa/b53/b53_common.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c
index ba1266cd70c3..c4c8513ae486 100644
--- a/drivers/net/dsa/b53/b53_common.c
+++ b/drivers/net/dsa/b53/b53_common.c
@@ -2274,7 +2274,7 @@ int b53_fdb_dump(struct dsa_switch *ds, int port,
mutex_unlock(&priv->arl_mutex);
- return 0;
+ return ret;
}
EXPORT_SYMBOL(b53_fdb_dump);
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net] net: dsa: b53: fix error propagation from b53_fdb_dump()
2026-08-12 20:11 [PATCH net] net: dsa: b53: fix error propagation from b53_fdb_dump() Vladimir Oltean
@ 2026-08-12 20:24 ` Florian Fainelli
2026-08-17 21:00 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Florian Fainelli @ 2026-08-12 20:24 UTC (permalink / raw)
To: Vladimir Oltean, netdev
Cc: Florian Fainelli, Jonas Gorski, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, linux-kernel
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 <vladimir.oltean@nxp.com>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
--
Florian
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net] net: dsa: b53: fix error propagation from b53_fdb_dump()
2026-08-12 20:11 [PATCH net] net: dsa: b53: fix error propagation from b53_fdb_dump() Vladimir Oltean
2026-08-12 20:24 ` Florian Fainelli
@ 2026-08-17 21:00 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-08-17 21:00 UTC (permalink / raw)
To: Vladimir Oltean
Cc: netdev, florian.fainelli, jonas.gorski, andrew, davem, edumazet,
kuba, pabeni, linux-kernel
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Wed, 12 Aug 2026 23:11:21 +0300 you 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").
>
> [...]
Here is the summary with links:
- [net] net: dsa: b53: fix error propagation from b53_fdb_dump()
https://git.kernel.org/netdev/net/c/4f1d06cf8aaa
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-08-17 21:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-12 20:11 [PATCH net] net: dsa: b53: fix error propagation from b53_fdb_dump() Vladimir Oltean
2026-08-12 20:24 ` Florian Fainelli
2026-08-17 21:00 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox