* [PATCH v2 net-next] net: dsa: Never offload FDB entries on standalone ports
@ 2022-03-15 23:30 Tobias Waldekranz
2022-03-16 13:08 ` Vladimir Oltean
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Tobias Waldekranz @ 2022-03-15 23:30 UTC (permalink / raw)
To: davem, kuba
Cc: Andrew Lunn, Vivien Didelot, Florian Fainelli, Vladimir Oltean,
netdev, linux-kernel
If a port joins a bridge that it can't offload, it will fallback to
standalone mode and software bridging. In this case, we never want to
offload any FDB entries to hardware either.
Previously, for host addresses, we would eventually end up in
dsa_port_bridge_host_fdb_add, which would unconditionally dereference
dp->bridge and cause a segfault.
Fixes: c26933639b54 ("net: dsa: request drivers to perform FDB isolation")
Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
---
net/dsa/slave.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index f9cecda791d5..d24b6bf845c1 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -2847,6 +2847,9 @@ static int dsa_slave_fdb_event(struct net_device *dev,
if (ctx && ctx != dp)
return 0;
+ if (!dp->bridge)
+ return 0;
+
if (switchdev_fdb_is_dynamically_learned(fdb_info)) {
if (dsa_port_offloads_bridge_port(dp, orig_dev))
return 0;
--
2.25.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2 net-next] net: dsa: Never offload FDB entries on standalone ports
2022-03-15 23:30 [PATCH v2 net-next] net: dsa: Never offload FDB entries on standalone ports Tobias Waldekranz
@ 2022-03-16 13:08 ` Vladimir Oltean
2022-03-16 23:24 ` Florian Fainelli
2022-03-17 2:40 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Vladimir Oltean @ 2022-03-16 13:08 UTC (permalink / raw)
To: Tobias Waldekranz
Cc: davem, kuba, Andrew Lunn, Vivien Didelot, Florian Fainelli,
netdev, linux-kernel
On Wed, Mar 16, 2022 at 12:30:33AM +0100, Tobias Waldekranz wrote:
> If a port joins a bridge that it can't offload, it will fallback to
> standalone mode and software bridging. In this case, we never want to
> offload any FDB entries to hardware either.
>
> Previously, for host addresses, we would eventually end up in
> dsa_port_bridge_host_fdb_add, which would unconditionally dereference
> dp->bridge and cause a segfault.
>
> Fixes: c26933639b54 ("net: dsa: request drivers to perform FDB isolation")
> Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
> ---
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
> net/dsa/slave.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/net/dsa/slave.c b/net/dsa/slave.c
> index f9cecda791d5..d24b6bf845c1 100644
> --- a/net/dsa/slave.c
> +++ b/net/dsa/slave.c
> @@ -2847,6 +2847,9 @@ static int dsa_slave_fdb_event(struct net_device *dev,
> if (ctx && ctx != dp)
> return 0;
>
> + if (!dp->bridge)
> + return 0;
> +
> if (switchdev_fdb_is_dynamically_learned(fdb_info)) {
> if (dsa_port_offloads_bridge_port(dp, orig_dev))
> return 0;
> --
> 2.25.1
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2 net-next] net: dsa: Never offload FDB entries on standalone ports
2022-03-15 23:30 [PATCH v2 net-next] net: dsa: Never offload FDB entries on standalone ports Tobias Waldekranz
2022-03-16 13:08 ` Vladimir Oltean
@ 2022-03-16 23:24 ` Florian Fainelli
2022-03-17 2:40 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Florian Fainelli @ 2022-03-16 23:24 UTC (permalink / raw)
To: Tobias Waldekranz, davem, kuba
Cc: Andrew Lunn, Vivien Didelot, Vladimir Oltean, netdev,
linux-kernel
On 3/15/22 4:30 PM, Tobias Waldekranz wrote:
> If a port joins a bridge that it can't offload, it will fallback to
> standalone mode and software bridging. In this case, we never want to
> offload any FDB entries to hardware either.
>
> Previously, for host addresses, we would eventually end up in
> dsa_port_bridge_host_fdb_add, which would unconditionally dereference
> dp->bridge and cause a segfault.
>
> Fixes: c26933639b54 ("net: dsa: request drivers to perform FDB isolation")
> Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
--
Florian
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2 net-next] net: dsa: Never offload FDB entries on standalone ports
2022-03-15 23:30 [PATCH v2 net-next] net: dsa: Never offload FDB entries on standalone ports Tobias Waldekranz
2022-03-16 13:08 ` Vladimir Oltean
2022-03-16 23:24 ` Florian Fainelli
@ 2022-03-17 2:40 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-03-17 2:40 UTC (permalink / raw)
To: Tobias Waldekranz
Cc: davem, kuba, andrew, vivien.didelot, f.fainelli, olteanv, netdev,
linux-kernel
Hello:
This patch was applied to netdev/net-next.git (master)
by Jakub Kicinski <kuba@kernel.org>:
On Wed, 16 Mar 2022 00:30:33 +0100 you wrote:
> If a port joins a bridge that it can't offload, it will fallback to
> standalone mode and software bridging. In this case, we never want to
> offload any FDB entries to hardware either.
>
> Previously, for host addresses, we would eventually end up in
> dsa_port_bridge_host_fdb_add, which would unconditionally dereference
> dp->bridge and cause a segfault.
>
> [...]
Here is the summary with links:
- [v2,net-next] net: dsa: Never offload FDB entries on standalone ports
https://git.kernel.org/netdev/net-next/c/a860352e9dd0
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] 4+ messages in thread
end of thread, other threads:[~2022-03-17 2:40 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-15 23:30 [PATCH v2 net-next] net: dsa: Never offload FDB entries on standalone ports Tobias Waldekranz
2022-03-16 13:08 ` Vladimir Oltean
2022-03-16 23:24 ` Florian Fainelli
2022-03-17 2: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).