Skip to content

Commit

Permalink
bridge: Fix RCU race in br_multicast_stop
Browse files Browse the repository at this point in the history
Thanks to Paul McKenny for pointing out that it is incorrect to use
synchronize_rcu_bh to ensure that pending callbacks have completed.
Instead we should use rcu_barrier_bh.

Reported-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Herbert Xu authored and David S. Miller committed Mar 7, 2010
1 parent 49f5fcf commit 10cc2b5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/bridge/br_multicast.c
Original file line number Diff line number Diff line change
Expand Up @@ -1135,7 +1135,7 @@ void br_multicast_stop(struct net_bridge *br)

if (mdb->old) {
spin_unlock_bh(&br->multicast_lock);
synchronize_rcu_bh();
rcu_barrier_bh();
spin_lock_bh(&br->multicast_lock);
WARN_ON(mdb->old);
}
Expand Down

0 comments on commit 10cc2b5

Please sign in to comment.