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>

authored by Eric Dumazet and committed by David S. Miller 3006bc38 28cb6ccd

+2
+2
drivers/net/bonding/bond_main.c
··· 878 rcu_read_lock(); 879 in_dev = __in_dev_get_rcu(dev); 880 if (in_dev) { 881 for (im = in_dev->mc_list; im; im = im->next) 882 ip_mc_rejoin_group(im); 883 } 884 885 rcu_read_unlock();
··· 878 rcu_read_lock(); 879 in_dev = __in_dev_get_rcu(dev); 880 if (in_dev) { 881 + read_lock(&in_dev->mc_list_lock); 882 for (im = in_dev->mc_list; im; im = im->next) 883 ip_mc_rejoin_group(im); 884 + read_unlock(&in_dev->mc_list_lock); 885 } 886 887 rcu_read_unlock();