wifi: cfg80211: lock wiphy mutex for rfkill poll
authorJohannes Berg <johannes.berg@intel.com>
Wed, 8 Nov 2023 12:41:25 +0000 (13:41 +0100)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 24 Nov 2023 17:30:09 +0000 (18:30 +0100)
We want to guarantee the mutex is held for pretty much
all operations, so ensure that here as well.

Reported-by: syzbot+7e59a5bfc7a897247e18@syzkaller.appspotmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/wireless/core.c

index 758c9a2a12c0d3ce5f1baefdcc3a9dd7076b7eb1..3f756ce46602e903619eb82db30c169cf41ccdea 100644 (file)
@@ -221,7 +221,9 @@ static void cfg80211_rfkill_poll(struct rfkill *rfkill, void *data)
 {
        struct cfg80211_registered_device *rdev = data;
 
+       wiphy_lock(&rdev->wiphy);
        rdev_rfkill_poll(rdev);
+       wiphy_unlock(&rdev->wiphy);
 }
 
 void cfg80211_stop_p2p_device(struct cfg80211_registered_device *rdev,