Commit ddd0d529 authored by Nikolay Aleksandrov's avatar Nikolay Aleksandrov Committed by David S. Miller

net: bridge: mcast: fix vlan port router deadlock

Before vlan/port mcast router support was added
br_multicast_set_port_router was used only with bh already disabled due
to the bridge port lock, but that is no longer the case and when it is
called to configure a vlan/port mcast router we can deadlock with the
timer, so always disable bh to make sure it can be called from contexts
with both enabled and disabled bh.

Fixes: 2796d846 ("net: bridge: vlan: convert mcast router global option to per-vlan entry")
Signed-off-by: default avatarNikolay Aleksandrov <nikolay@nvidia.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f1181e39
...@@ -4255,7 +4255,7 @@ int br_multicast_set_port_router(struct net_bridge_mcast_port *pmctx, ...@@ -4255,7 +4255,7 @@ int br_multicast_set_port_router(struct net_bridge_mcast_port *pmctx,
bool del = false; bool del = false;
brmctx = br_multicast_port_ctx_get_global(pmctx); brmctx = br_multicast_port_ctx_get_global(pmctx);
spin_lock(&brmctx->br->multicast_lock); spin_lock_bh(&brmctx->br->multicast_lock);
if (pmctx->multicast_router == val) { if (pmctx->multicast_router == val) {
/* Refresh the temp router port timer */ /* Refresh the temp router port timer */
if (pmctx->multicast_router == MDB_RTR_TYPE_TEMP) { if (pmctx->multicast_router == MDB_RTR_TYPE_TEMP) {
...@@ -4305,7 +4305,7 @@ int br_multicast_set_port_router(struct net_bridge_mcast_port *pmctx, ...@@ -4305,7 +4305,7 @@ int br_multicast_set_port_router(struct net_bridge_mcast_port *pmctx,
} }
err = 0; err = 0;
unlock: unlock:
spin_unlock(&brmctx->br->multicast_lock); spin_unlock_bh(&brmctx->br->multicast_lock);
return err; return err;
} }
......
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