mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
net: Potential null skb->dev dereference
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
54d259d474
commit
0641e4fbf2
3 changed files with 11 additions and 9 deletions
|
|
@ -11,7 +11,7 @@ int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp,
|
|||
if (netpoll_rx(skb))
|
||||
return NET_RX_DROP;
|
||||
|
||||
if (skb_bond_should_drop(skb))
|
||||
if (skb_bond_should_drop(skb, ACCESS_ONCE(skb->dev->master)))
|
||||
goto drop;
|
||||
|
||||
skb->skb_iif = skb->dev->ifindex;
|
||||
|
|
@ -83,7 +83,7 @@ vlan_gro_common(struct napi_struct *napi, struct vlan_group *grp,
|
|||
{
|
||||
struct sk_buff *p;
|
||||
|
||||
if (skb_bond_should_drop(skb))
|
||||
if (skb_bond_should_drop(skb, ACCESS_ONCE(skb->dev->master)))
|
||||
goto drop;
|
||||
|
||||
skb->skb_iif = skb->dev->ifindex;
|
||||
|
|
|
|||
Loading…
Reference in a new issue