diff options
author | Ido Schimmel <idosch@mellanox.com> | 2016-06-20 10:53:20 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-06-22 22:31:03 +0200 |
commit | 942f64c4c2be19a1b4a0c4295182b42d153899bf (patch) | |
tree | 368b4821032c4965e23338627a0257b37a398f9d /drivers | |
parent | Merge tag 'linux-can-fixes-for-4.7-20160620' of git://git.kernel.org/pub/scm/... (diff) | |
download | linux-942f64c4c2be19a1b4a0c4295182b42d153899bf.tar.xz linux-942f64c4c2be19a1b4a0c4295182b42d153899bf.zip |
team: Fix possible deadlock during team enslave
Both dev_uc_sync_multiple() and dev_mc_sync_multiple() require the
source device to be locked by netif_addr_lock_bh(), but this is missing
in team's enslave function, so add it.
This fixes the following lockdep warning:
Possible interrupt unsafe locking scenario:
CPU0 CPU1
---- ----
lock(_xmit_ETHER/1);
local_irq_disable();
lock(&(&mc->mca_lock)->rlock);
lock(&team_netdev_addr_lock_key);
<Interrupt>
lock(&(&mc->mca_lock)->rlock);
*** DEADLOCK ***
Fixes: cb41c997d444 ("team: team should sync the port's uc/mc addrs when add a port")
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/team/team.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c index 2ace126533cd..fdee77207323 100644 --- a/drivers/net/team/team.c +++ b/drivers/net/team/team.c @@ -1203,8 +1203,10 @@ static int team_port_add(struct team *team, struct net_device *port_dev) goto err_dev_open; } + netif_addr_lock_bh(dev); dev_uc_sync_multiple(port_dev, dev); dev_mc_sync_multiple(port_dev, dev); + netif_addr_unlock_bh(dev); err = vlan_vids_add_by_dev(port_dev, dev); if (err) { |