aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2010-03-30 00:33:28 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-04-01 19:02:10 -0400
commita1c9d89a98cbbc52ead6c44bb0c31eaaa37c5770 (patch)
tree5980466b4e252d9082adfce04297ab19138fdf43 /include
parent8c96206544955131f6d7cef09371950f34ebca5a (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 'include')
-rw-r--r--include/linux/netdevice.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 99914e6fa3fd..03e8d81a8391 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -2023,12 +2023,12 @@ static inline void skb_bond_set_mac_by_master(struct sk_buff *skb,
2023 * duplicates except for 802.3ad ETH_P_SLOW, alb non-mcast/bcast, and 2023 * duplicates except for 802.3ad ETH_P_SLOW, alb non-mcast/bcast, and
2024 * ARP on active-backup slaves with arp_validate enabled. 2024 * ARP on active-backup slaves with arp_validate enabled.
2025 */ 2025 */
2026static inline int skb_bond_should_drop(struct sk_buff *skb) 2026static inline int skb_bond_should_drop(struct sk_buff *skb,
2027 struct net_device *master)
2027{ 2028{
2028 struct net_device *dev = skb->dev;
2029 struct net_device *master = dev->master;
2030
2031 if (master) { 2029 if (master) {
2030 struct net_device *dev = skb->dev;
2031
2032 if (master->priv_flags & IFF_MASTER_ARPMON) 2032 if (master->priv_flags & IFF_MASTER_ARPMON)
2033 dev->last_rx = jiffies; 2033 dev->last_rx = jiffies;
2034 2034