diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2010-03-30 00:33:28 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-04-01 19:02:10 -0400 |
commit | a1c9d89a98cbbc52ead6c44bb0c31eaaa37c5770 (patch) | |
tree | 5980466b4e252d9082adfce04297ab19138fdf43 /net/8021q/vlan_core.c | |
parent | 8c96206544955131f6d7cef09371950f34ebca5a (diff) |
net: Potential null skb->dev dereference
[ Upstream commit 0641e4fbf2f824faee00ea74c459a088d94905fd ]
When doing "ifenslave -d bond0 eth0", there is chance to get NULL
dereference in netif_receive_skb(), because dev->master suddenly becomes
NULL after we tested it.
We should use ACCESS_ONCE() to avoid this (or rcu_dereference())
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'net/8021q/vlan_core.c')
-rw-r--r-- | net/8021q/vlan_core.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/8021q/vlan_core.c b/net/8021q/vlan_core.c index e75a2f3b10af..152760a487e6 100644 --- a/net/8021q/vlan_core.c +++ b/net/8021q/vlan_core.c | |||
@@ -11,7 +11,7 @@ int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp, | |||
11 | if (netpoll_rx(skb)) | 11 | if (netpoll_rx(skb)) |
12 | return NET_RX_DROP; | 12 | return NET_RX_DROP; |
13 | 13 | ||
14 | if (skb_bond_should_drop(skb)) | 14 | if (skb_bond_should_drop(skb, ACCESS_ONCE(skb->dev->master))) |
15 | goto drop; | 15 | goto drop; |
16 | 16 | ||
17 | __vlan_hwaccel_put_tag(skb, vlan_tci); | 17 | __vlan_hwaccel_put_tag(skb, vlan_tci); |
@@ -82,7 +82,7 @@ vlan_gro_common(struct napi_struct *napi, struct vlan_group *grp, | |||
82 | { | 82 | { |
83 | struct sk_buff *p; | 83 | struct sk_buff *p; |
84 | 84 | ||
85 | if (skb_bond_should_drop(skb)) | 85 | if (skb_bond_should_drop(skb, ACCESS_ONCE(skb->dev->master))) |
86 | goto drop; | 86 | goto drop; |
87 | 87 | ||
88 | __vlan_hwaccel_put_tag(skb, vlan_tci); | 88 | __vlan_hwaccel_put_tag(skb, vlan_tci); |