netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] net: dsa: b53: skip multicast entries for fdb_dump()
@ 2025-12-17 20:57 Jonas Gorski
  2025-12-17 21:55 ` Florian Fainelli
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Jonas Gorski @ 2025-12-17 20:57 UTC (permalink / raw)
  To: Florian Fainelli, Andrew Lunn, Vladimir Oltean, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni
  Cc: Florian Fainelli, netdev, linux-kernel

port_fdb_dump() is supposed to only add fdb entries, but we iterate over
the full ARL table, which also inludes multicast entries.

So check if the entry is a multicast entry before passing it on to the
callback().

Additionally, the port of those entries is a bitmask, not a port number,
so any included entries would have even be for the wrong port.

Fixes: 1da6df85c6fb ("net: dsa: b53: Implement ARL add/del/dump operations")
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
---
 drivers/net/dsa/b53/b53_common.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c
index a1a177713d99..2c4131ed7e30 100644
--- a/drivers/net/dsa/b53/b53_common.c
+++ b/drivers/net/dsa/b53/b53_common.c
@@ -2169,6 +2169,9 @@ static int b53_fdb_copy(int port, const struct b53_arl_entry *ent,
 	if (!ent->is_valid)
 		return 0;
 
+	if (is_multicast_ether_addr(ent->mac))
+		return 0;
+
 	if (port != ent->port)
 		return 0;
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH net] net: dsa: b53: skip multicast entries for fdb_dump()
  2025-12-17 20:57 [PATCH net] net: dsa: b53: skip multicast entries for fdb_dump() Jonas Gorski
@ 2025-12-17 21:55 ` Florian Fainelli
  2025-12-17 22:00 ` Andrew Lunn
  2025-12-27 16:40 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 6+ messages in thread
From: Florian Fainelli @ 2025-12-17 21:55 UTC (permalink / raw)
  To: Jonas Gorski, Florian Fainelli, Andrew Lunn, Vladimir Oltean,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
  Cc: netdev, linux-kernel

On 12/17/25 12:57, Jonas Gorski wrote:
> port_fdb_dump() is supposed to only add fdb entries, but we iterate over
> the full ARL table, which also inludes multicast entries.
> 
> So check if the entry is a multicast entry before passing it on to the
> callback().
> 
> Additionally, the port of those entries is a bitmask, not a port number,
> so any included entries would have even be for the wrong port.
> 
> Fixes: 1da6df85c6fb ("net: dsa: b53: Implement ARL add/del/dump operations")
> Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>

Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
-- 
Florian


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net] net: dsa: b53: skip multicast entries for fdb_dump()
  2025-12-17 20:57 [PATCH net] net: dsa: b53: skip multicast entries for fdb_dump() Jonas Gorski
  2025-12-17 21:55 ` Florian Fainelli
@ 2025-12-17 22:00 ` Andrew Lunn
  2025-12-27 16:17   ` Paolo Abeni
  2025-12-27 16:40 ` patchwork-bot+netdevbpf
  2 siblings, 1 reply; 6+ messages in thread
From: Andrew Lunn @ 2025-12-17 22:00 UTC (permalink / raw)
  To: Jonas Gorski
  Cc: Florian Fainelli, Vladimir Oltean, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Florian Fainelli, netdev,
	linux-kernel

On Wed, Dec 17, 2025 at 09:57:56PM +0100, Jonas Gorski wrote:
> port_fdb_dump() is supposed to only add fdb entries, but we iterate over
> the full ARL table, which also inludes multicast entries.

includes.

	Andrew

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net] net: dsa: b53: skip multicast entries for fdb_dump()
  2025-12-17 22:00 ` Andrew Lunn
@ 2025-12-27 16:17   ` Paolo Abeni
  2025-12-29  8:26     ` Jonas Gorski
  0 siblings, 1 reply; 6+ messages in thread
From: Paolo Abeni @ 2025-12-27 16:17 UTC (permalink / raw)
  To: Andrew Lunn, Jonas Gorski
  Cc: Florian Fainelli, Vladimir Oltean, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Florian Fainelli, netdev, linux-kernel

On 12/17/25 11:00 PM, Andrew Lunn wrote:
> On Wed, Dec 17, 2025 at 09:57:56PM +0100, Jonas Gorski wrote:
>> port_fdb_dump() is supposed to only add fdb entries, but we iterate over
>> the full ARL table, which also inludes multicast entries.
> 
> includes.

Please do not resend just for the above. I'll (exceptionally) fix it
while applying the patch.

Cheers,

Paolo


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net] net: dsa: b53: skip multicast entries for fdb_dump()
  2025-12-17 20:57 [PATCH net] net: dsa: b53: skip multicast entries for fdb_dump() Jonas Gorski
  2025-12-17 21:55 ` Florian Fainelli
  2025-12-17 22:00 ` Andrew Lunn
@ 2025-12-27 16:40 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 6+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-12-27 16:40 UTC (permalink / raw)
  To: Jonas Gorski
  Cc: florian.fainelli, andrew, olteanv, davem, edumazet, kuba, pabeni,
	f.fainelli, netdev, linux-kernel

Hello:

This patch was applied to netdev/net.git (main)
by Paolo Abeni <pabeni@redhat.com>:

On Wed, 17 Dec 2025 21:57:56 +0100 you wrote:
> port_fdb_dump() is supposed to only add fdb entries, but we iterate over
> the full ARL table, which also inludes multicast entries.
> 
> So check if the entry is a multicast entry before passing it on to the
> callback().
> 
> Additionally, the port of those entries is a bitmask, not a port number,
> so any included entries would have even be for the wrong port.
> 
> [...]

Here is the summary with links:
  - [net] net: dsa: b53: skip multicast entries for fdb_dump()
    https://git.kernel.org/netdev/net/c/d42bce414d1c

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] 6+ messages in thread

* Re: [PATCH net] net: dsa: b53: skip multicast entries for fdb_dump()
  2025-12-27 16:17   ` Paolo Abeni
@ 2025-12-29  8:26     ` Jonas Gorski
  0 siblings, 0 replies; 6+ messages in thread
From: Jonas Gorski @ 2025-12-29  8:26 UTC (permalink / raw)
  To: Paolo Abeni
  Cc: Andrew Lunn, Florian Fainelli, Vladimir Oltean, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Florian Fainelli, netdev,
	linux-kernel

On Sat, Dec 27, 2025 at 5:17 PM Paolo Abeni <pabeni@redhat.com> wrote:
>
> On 12/17/25 11:00 PM, Andrew Lunn wrote:
> > On Wed, Dec 17, 2025 at 09:57:56PM +0100, Jonas Gorski wrote:
> >> port_fdb_dump() is supposed to only add fdb entries, but we iterate over
> >> the full ARL table, which also inludes multicast entries.
> >
> > includes.
>
> Please do not resend just for the above. I'll (exceptionally) fix it
> while applying the patch.

Thank you, I completely forgot about this over the holidays (and getting sick).

Though I also wasn't sure if a typo in the commit message warrants a
new patch version; I sort of assumed this was more a "if a new version
is needed, then fix this as well".

Best regards,
Jonas

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-12-29  8:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-17 20:57 [PATCH net] net: dsa: b53: skip multicast entries for fdb_dump() Jonas Gorski
2025-12-17 21:55 ` Florian Fainelli
2025-12-17 22:00 ` Andrew Lunn
2025-12-27 16:17   ` Paolo Abeni
2025-12-29  8:26     ` Jonas Gorski
2025-12-27 16:40 ` 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;
as well as URLs for NNTP newsgroup(s).