diff mbox

[net-next] bridge: vlan: Use rcu_dereference instead of rtnl_dereference

Message ID 1446395505-24841-1-git-send-email-idosch@mellanox.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Ido Schimmel Nov. 1, 2015, 4:31 p.m. UTC
br_should_learn() is protected by RCU and not by RTNL, so use correct
flavor of nbp_vlan_group().

Fixes: 907b1e6e83ed ("bridge: vlan: use proper rcu for the vlgrp
member")
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Acked-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
---
 net/bridge/br_vlan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jiri Pirko Nov. 2, 2015, 8:40 a.m. UTC | #1
Sun, Nov 01, 2015 at 05:31:45PM CET, idosch@mellanox.com wrote:
>br_should_learn() is protected by RCU and not by RTNL, so use correct
>flavor of nbp_vlan_group().
>
>Fixes: 907b1e6e83ed ("bridge: vlan: use proper rcu for the vlgrp
>member")
>Signed-off-by: Ido Schimmel <idosch@mellanox.com>
>Acked-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>

Acked-by: Jiri Pirko <jiri@mellanox.com>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller Nov. 2, 2015, 9:28 p.m. UTC | #2
From: Ido Schimmel <idosch@mellanox.com>
Date: Sun, 1 Nov 2015 18:31:45 +0200

> br_should_learn() is protected by RCU and not by RTNL, so use correct
> flavor of nbp_vlan_group().
> 
> Fixes: 907b1e6e83ed ("bridge: vlan: use proper rcu for the vlgrp
> member")
> Signed-off-by: Ido Schimmel <idosch@mellanox.com>
> Acked-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>

Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/bridge/br_vlan.c b/net/bridge/br_vlan.c
index 5f0d0cc..99a083e 100644
--- a/net/bridge/br_vlan.c
+++ b/net/bridge/br_vlan.c
@@ -482,7 +482,7 @@  bool br_should_learn(struct net_bridge_port *p, struct sk_buff *skb, u16 *vid)
 	if (!br->vlan_enabled)
 		return true;
 
-	vg = nbp_vlan_group(p);
+	vg = nbp_vlan_group_rcu(p);
 	if (!vg || !vg->num_vlans)
 		return false;