net: bridge: multicast: use rcu to access port list from br_multicast_start_querier
commit c5b493ce192bd7a4e7bd073b5685aad121eeef82 upstream.
br_multicast_start_querier() walks over the port list but it can be
called from a timer with only multicast_lock held which doesn't protect
the port list, so use RCU to walk over it.
Fixes: c83b8fab06
("bridge: Restart queries when last querier expires")
Change-Id: Ic030f401e560c16f919e03cb987201869e3926b7
Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
This commit is contained in:
parent
8cbe65a685
commit
2e6683c33b
|
@ -1772,13 +1772,15 @@ static void br_multicast_start_querier(struct net_bridge *br)
|
|||
|
||||
br_multicast_open(br);
|
||||
|
||||
list_for_each_entry(port, &br->port_list, list) {
|
||||
rcu_read_lock();
|
||||
list_for_each_entry_rcu(port, &br->port_list, list) {
|
||||
if (port->state == BR_STATE_DISABLED ||
|
||||
port->state == BR_STATE_BLOCKING)
|
||||
continue;
|
||||
|
||||
__br_multicast_enable_port(port);
|
||||
}
|
||||
rcu_read_unlock();
|
||||
}
|
||||
|
||||
int br_multicast_toggle(struct net_bridge *br, unsigned long val)
|
||||
|
|
Loading…
Reference in New Issue