bridge:Fix concurrent access issue in the function brnf_get_logical_dev
Subsystems (4)
PATCH RESEND 1/1 bridge:Fix concurrent access issue in the function brnf_get_logical_dev
This fixes a concurrent access issue in the function brnf_get_logical_dev by properly locking with the function rcu_read_lock before calling the function vlan_find_dev_deep_rcu and unlocking after this function call as all callers of this function are required to do this in order to improve issues with concurrent access by other threads executing on this data structures simultaneously.
Signed-off-by Nicholas Krause <[email protected]>
--- net/bridge/br_netfilter_hooks.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/bridge/br_netfilter_hooks.c +2 -1
@@ -428,9 +428,10 @@ static struct net_device *brnf_get_logical_dev(struct sk_buff *skb, const structif (brnf_pass_vlan_indev ==0 || !skb_vlan_tag_present (skb))return br; +rcu_read_lock (); vlan =__vlan_find_dev_deep_rcu (br, skb->vlan_proto,skb_vlan_tag_get (skb) &VLAN_VID_MASK ); - +rcu_read_unlock ();return vlan ? vlan : br; }
Signature · 1 line
2.1.4