Patch "wifi: mac80211: fix change_address deadlock during unregister" has been added to the 6.1-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    wifi: mac80211: fix change_address deadlock during unregister

to the 6.1-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     wifi-mac80211-fix-change_address-deadlock-during-unr.patch
and it can be found in the queue-6.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 183ed81eba8438e70922971a17a12ea68254a19c
Author: Johannes Berg <johannes.berg@xxxxxxxxx>
Date:   Thu Oct 12 12:34:47 2023 +0200

    wifi: mac80211: fix change_address deadlock during unregister
    
    [ Upstream commit 74a7c93f45abba538914a65dd2ef2ea7cf7150e2 ]
    
    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: syzbot+25b3a0b24216651bc2af@xxxxxxxxxxxxxxxxxxxxxxxxx
    Signed-off-by: Johannes Berg <johannes.berg@xxxxxxxxx>
    Link: https://lore.kernel.org/r/20231012123447.9f9d7fd1f237.Ic3a5ef4391b670941a69cec5592aefc79d9c2890@changeid
    Signed-off-by: Johannes Berg <johannes.berg@xxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index 408ee5afc9ae7..6a9d81e9069c9 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -300,6 +300,14 @@ static int ieee80211_change_mac(struct net_device *dev, void *addr)
 	struct ieee80211_local *local = sdata->local;
 	int ret;
 
+	/*
+	 * This happens during unregistration if there's a bond device
+	 * active (maybe other cases?) and we must get removed from it.
+	 * But we really don't care anymore if it's not registered now.
+	 */
+	if (!dev->ieee80211_ptr->registered)
+		return 0;
+
 	wiphy_lock(local->hw.wiphy);
 	ret = _ieee80211_change_mac(sdata, addr);
 	wiphy_unlock(local->hw.wiphy);




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux