Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit e58695f

Browse files
jmberg-intelgregkh
authored andcommitted
wifi: mac80211: fix change_address deadlock during unregister
[ Upstream commit 74a7c93 ] When using e.g. bonding, and doing a sequence such as # iw wlan0 set type __ap # ip link add name bond1 type bond # ip link set wlan0 master bond1 # iw wlan0 interface del we deadlock, since the wlan0 interface removal will cause bonding to reset the MAC address of wlan0. The locking would be somewhat difficult to fix, but since this only happens during removal, we can simply ignore the MAC address change at this time. Reported-by: [email protected] Signed-off-by: Johannes Berg <[email protected]> Link: https://lore.kernel.org/r/20231012123447.9f9d7fd1f237.Ic3a5ef4391b670941a69cec5592aefc79d9c2890@changeid Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent be31c9b commit e58695f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

net/mac80211/iface.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,14 @@ static int ieee80211_change_mac(struct net_device *dev, void *addr)
300300
struct ieee80211_local *local = sdata->local;
301301
int ret;
302302

303+
/*
304+
* This happens during unregistration if there's a bond device
305+
* active (maybe other cases?) and we must get removed from it.
306+
* But we really don't care anymore if it's not registered now.
307+
*/
308+
if (!dev->ieee80211_ptr->registered)
309+
return 0;
310+
303311
wiphy_lock(local->hw.wiphy);
304312
ret = _ieee80211_change_mac(sdata, addr);
305313
wiphy_unlock(local->hw.wiphy);

0 commit comments

Comments
 (0)