All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] net: dsa: properly check for the bridge_leave methods in dsa_switch_bridge_leave()
@ 2021-07-13  9:40 Vladimir Oltean
  2021-07-13 22:00 ` patchwork-bot+netdevbpf
  2021-07-13 22:02 ` Florian Fainelli
  0 siblings, 2 replies; 3+ messages in thread
From: Vladimir Oltean @ 2021-07-13  9:40 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski, netdev
  Cc: Andrew Lunn, Florian Fainelli, Vivien Didelot

This was not caught because there is no switch driver which implements
the .port_bridge_join but not .port_bridge_leave method, but it should
nonetheless be fixed, as in certain conditions (driver development) it
might lead to NULL pointer dereference.

Fixes: f66a6a69f97a ("net: dsa: permit cross-chip bridging between all trees in the system")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
 net/dsa/switch.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/dsa/switch.c b/net/dsa/switch.c
index 248455145982..5ece05dfd8f2 100644
--- a/net/dsa/switch.c
+++ b/net/dsa/switch.c
@@ -113,11 +113,11 @@ static int dsa_switch_bridge_leave(struct dsa_switch *ds,
 	int err, port;
 
 	if (dst->index == info->tree_index && ds->index == info->sw_index &&
-	    ds->ops->port_bridge_join)
+	    ds->ops->port_bridge_leave)
 		ds->ops->port_bridge_leave(ds, info->port, info->br);
 
 	if ((dst->index != info->tree_index || ds->index != info->sw_index) &&
-	    ds->ops->crosschip_bridge_join)
+	    ds->ops->crosschip_bridge_leave)
 		ds->ops->crosschip_bridge_leave(ds, info->tree_index,
 						info->sw_index, info->port,
 						info->br);
-- 
2.25.1


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

* Re: [PATCH net] net: dsa: properly check for the bridge_leave methods in dsa_switch_bridge_leave()
  2021-07-13  9:40 [PATCH net] net: dsa: properly check for the bridge_leave methods in dsa_switch_bridge_leave() Vladimir Oltean
@ 2021-07-13 22:00 ` patchwork-bot+netdevbpf
  2021-07-13 22:02 ` Florian Fainelli
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-07-13 22:00 UTC (permalink / raw)
  To: Vladimir Oltean; +Cc: davem, kuba, netdev, andrew, f.fainelli, vivien.didelot

Hello:

This patch was applied to netdev/net.git (refs/heads/master):

On Tue, 13 Jul 2021 12:40:21 +0300 you wrote:
> This was not caught because there is no switch driver which implements
> the .port_bridge_join but not .port_bridge_leave method, but it should
> nonetheless be fixed, as in certain conditions (driver development) it
> might lead to NULL pointer dereference.
> 
> Fixes: f66a6a69f97a ("net: dsa: permit cross-chip bridging between all trees in the system")
> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
> 
> [...]

Here is the summary with links:
  - [net] net: dsa: properly check for the bridge_leave methods in dsa_switch_bridge_leave()
    https://git.kernel.org/netdev/net/c/bcb9928a1554

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

* Re: [PATCH net] net: dsa: properly check for the bridge_leave methods in dsa_switch_bridge_leave()
  2021-07-13  9:40 [PATCH net] net: dsa: properly check for the bridge_leave methods in dsa_switch_bridge_leave() Vladimir Oltean
  2021-07-13 22:00 ` patchwork-bot+netdevbpf
@ 2021-07-13 22:02 ` Florian Fainelli
  1 sibling, 0 replies; 3+ messages in thread
From: Florian Fainelli @ 2021-07-13 22:02 UTC (permalink / raw)
  To: Vladimir Oltean, David S. Miller, Jakub Kicinski, netdev
  Cc: Andrew Lunn, Vivien Didelot

On 7/13/21 2:40 AM, Vladimir Oltean wrote:
> This was not caught because there is no switch driver which implements
> the .port_bridge_join but not .port_bridge_leave method, but it should
> nonetheless be fixed, as in certain conditions (driver development) it
> might lead to NULL pointer dereference.
> 
> Fixes: f66a6a69f97a ("net: dsa: permit cross-chip bridging between all trees in the system")
> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>

Too late but yes:

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

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

end of thread, other threads:[~2021-07-13 22:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-13  9:40 [PATCH net] net: dsa: properly check for the bridge_leave methods in dsa_switch_bridge_leave() Vladimir Oltean
2021-07-13 22:00 ` patchwork-bot+netdevbpf
2021-07-13 22:02 ` Florian Fainelli

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.