diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2010-11-18 12:30:42 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-11-18 12:30:42 -0500 |
commit | 3006bc38895895f1a0352c2e17e1a503f35f7e2f (patch) | |
tree | 24a3a9ecbee9215898b4c6b30357740eeeb632bb /drivers/net/bonding/bond_main.c | |
parent | 28cb6ccd2c7e86b3a4db94c7062cd27937bed424 (diff) |
bonding: fix a race in IGMP handling
RCU conversion in IGMP code done in net-next-2.6 raised a race in
__bond_resend_igmp_join_requests().
It iterates in_dev->mc_list without appropriate protection (RTNL, or
read_lock on in_dev->mc_list_lock).
Another cpu might delete an entry while we use it and trigger a fault.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding/bond_main.c')
-rw-r--r-- | drivers/net/bonding/bond_main.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index bdb68a600382..71a169740d05 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -878,8 +878,10 @@ static void __bond_resend_igmp_join_requests(struct net_device *dev) | |||
878 | rcu_read_lock(); | 878 | rcu_read_lock(); |
879 | in_dev = __in_dev_get_rcu(dev); | 879 | in_dev = __in_dev_get_rcu(dev); |
880 | if (in_dev) { | 880 | if (in_dev) { |
881 | read_lock(&in_dev->mc_list_lock); | ||
881 | for (im = in_dev->mc_list; im; im = im->next) | 882 | for (im = in_dev->mc_list; im; im = im->next) |
882 | ip_mc_rejoin_group(im); | 883 | ip_mc_rejoin_group(im); |
884 | read_unlock(&in_dev->mc_list_lock); | ||
883 | } | 885 | } |
884 | 886 | ||
885 | rcu_read_unlock(); | 887 | rcu_read_unlock(); |