This is a note to let you know that I've just added the patch titled mac80211: move interface shutdown out of wiphy lock to the 5.12-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: mac80211-move-interface-shutdown-out-of-wiphy-lock.patch and it can be found in the queue-5.12 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From f5baf287f5da5641099ad5c809b3b4ebfc08506d Mon Sep 17 00:00:00 2001 From: Johannes Berg <johannes.berg@xxxxxxxxx> Date: Tue, 8 Jun 2021 11:32:30 +0200 Subject: mac80211: move interface shutdown out of wiphy lock From: Johannes Berg <johannes.berg@xxxxxxxxx> commit f5baf287f5da5641099ad5c809b3b4ebfc08506d upstream. When reconfiguration fails, we shut down everything, but we cannot call cfg80211_shutdown_all_interfaces() with the wiphy mutex held. Since cfg80211 now calls it on resume errors, we only need to do likewise for where we call reconfig (whether directly or indirectly), but not under the wiphy lock. Cc: stable@xxxxxxxxxxxxxxx Fixes: 2fe8ef106238 ("cfg80211: change netdev registration/unregistration semantics") Link: https://lore.kernel.org/r/20210608113226.78233c80f548.Iecc104aceb89f0568f50e9670a9cb191a1c8887b@changeid Signed-off-by: Johannes Berg <johannes.berg@xxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- net/mac80211/debugfs.c | 7 ++++++- net/mac80211/main.c | 7 ++++++- net/mac80211/util.c | 2 -- 3 files changed, 12 insertions(+), 4 deletions(-) --- a/net/mac80211/debugfs.c +++ b/net/mac80211/debugfs.c @@ -387,12 +387,17 @@ static ssize_t reset_write(struct file * size_t count, loff_t *ppos) { struct ieee80211_local *local = file->private_data; + int ret; rtnl_lock(); wiphy_lock(local->hw.wiphy); __ieee80211_suspend(&local->hw, NULL); - __ieee80211_resume(&local->hw); + ret = __ieee80211_resume(&local->hw); wiphy_unlock(local->hw.wiphy); + + if (ret) + cfg80211_shutdown_all_interfaces(local->hw.wiphy); + rtnl_unlock(); return count; --- a/net/mac80211/main.c +++ b/net/mac80211/main.c @@ -252,6 +252,7 @@ static void ieee80211_restart_work(struc struct ieee80211_local *local = container_of(work, struct ieee80211_local, restart_work); struct ieee80211_sub_if_data *sdata; + int ret; /* wait for scan work complete */ flush_workqueue(local->workqueue); @@ -294,8 +295,12 @@ static void ieee80211_restart_work(struc /* wait for all packet processing to be done */ synchronize_net(); - ieee80211_reconfig(local); + ret = ieee80211_reconfig(local); wiphy_unlock(local->hw.wiphy); + + if (ret) + cfg80211_shutdown_all_interfaces(local->hw.wiphy); + rtnl_unlock(); } --- a/net/mac80211/util.c +++ b/net/mac80211/util.c @@ -2186,8 +2186,6 @@ static void ieee80211_handle_reconfig_fa list_for_each_entry(ctx, &local->chanctx_list, list) ctx->driver_present = false; mutex_unlock(&local->chanctx_mtx); - - cfg80211_shutdown_all_interfaces(local->hw.wiphy); } static void ieee80211_assign_chanctx(struct ieee80211_local *local, Patches currently in stable-queue which might be from johannes.berg@xxxxxxxxx are queue-5.12/mac80211-fix-null-ptr-deref-for-injected-rate-info.patch queue-5.12/cfg80211-avoid-double-free-of-pmsr-request.patch queue-5.12/cfg80211-shut-down-interfaces-on-failed-resume.patch queue-5.12/cfg80211-fix-phy80211-symlink-creation.patch queue-5.12/mac80211-minstrel_ht-fix-sample-time-check.patch queue-5.12/mac80211-fix-deadlock-in-ap-vlan-handling.patch queue-5.12/cfg80211-make-certificate-generation-more-robust.patch queue-5.12/staging-rtl8723bs-fix-monitor-netdev-register-unregi.patch queue-5.12/mac80211-move-interface-shutdown-out-of-wiphy-lock.patch queue-5.12/mac80211-fix-reset-debugfs-locking.patch queue-5.12/mac80211-fix-skb-length-check-in-ieee80211_scan_rx.patch