cfg80211: add missing device list locking
Johannes Berg
maintainerPATCH 1/1 cfg80211: add missing device list locking
When calling into the wext code from the NETDEV_UP notifier, we need to hold the devlist_mtx mutex as the wext code ends up calling into channel checks.
Reported-by Kalle Valo <[email protected]>
Signed-off-by Johannes Berg <[email protected]>
--- net/wireless/core.c | 2 ++ 1 file changed, 2 insertions(+)
net/wireless/core.c +2 -0
@@ -710,6 +710,7 @@ static int cfg80211_netdev_notifier_callcase NETDEV_UP :#ifdef CONFIG_WIRELESS_EXT cfg80211_lock_rdev (rdev); +mutex_lock (&rdev->devlist_mtx);wdev_lock (wdev);switch (wdev->iftype) {case NL80211_IFTYPE_ADHOC :
@@ -722,6 +723,7 @@ static int cfg80211_netdev_notifier_call break; }wdev_unlock (wdev); +mutex_unlock (&rdev->devlist_mtx);cfg80211_unlock_rdev (rdev);#endif break ;
Quoted 6 lines · Johannes Berg
When calling into the wext code from the
NETDEV_UPnotifier, we need to hold thedevlist_mtxmutex as the wext code ends up calling into channel checks.Reported-by Kalle Valo <[email protected]>Signed-off-by Johannes Berg <[email protected]>
Thanks for fixing this. I wasn't able to reproduce the warning after one suspend/resume cycle, but I'll test this patch a bit more before I send my Tested-by tag.
Signature · 1 line
Kalle Valo
Quoted 6 lines · Johannes Berg
When calling into the wext code from the
NETDEV_UPnotifier, we need to hold thedevlist_mtxmutex as the wext code ends up calling into channel checks.Reported-by Kalle Valo <[email protected]>Signed-off-by Johannes Berg <[email protected]>
I have been testing with patch for a day now and no warnings anymore.
Tested-by Kalle Valo <[email protected]>
Signature · 1 line
Kalle Valo