Commit aff5a41f authored by Nikolay Aleksandrov's avatar Nikolay Aleksandrov Committed by Stefan Bader

net: bridge: multicast: use rcu to access port list from br_multicast_start_querier

BugLink: https://bugs.launchpad.net/bugs/1828420

[ Upstream commit c5b493ce ]

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: c83b8fab ("bridge: Restart queries when last querier expires")
Signed-off-by: default avatarNikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: default avatarStefan Bader <stefan.bader@canonical.com>
parent e0a97d6f
......@@ -1894,7 +1894,8 @@ static void br_multicast_start_querier(struct net_bridge *br,
__br_multicast_open(br, query);
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;
......@@ -1906,6 +1907,7 @@ static void br_multicast_start_querier(struct net_bridge *br,
br_multicast_enable(&port->ip6_own_query);
#endif
}
rcu_read_unlock();
}
int br_multicast_toggle(struct net_bridge *br, unsigned long val)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment