]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
mac80211: do not start any work during reconfigure flow
authorNaftali Goldstein <naftali.goldstein@intel.com>
Wed, 29 May 2019 12:25:30 +0000 (15:25 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 14 Jul 2019 06:09:42 +0000 (08:09 +0200)
[ Upstream commit f8891461a277ec0afc493fd30cd975a38048a038 ]

It is not a good idea to try to perform any work (e.g. send an auth
frame) during reconfigure flow.

Prevent this from happening, and at the end of the reconfigure flow
requeue all the works.

Signed-off-by: Naftali Goldstein <naftali.goldstein@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/mac80211/ieee80211_i.h
net/mac80211/util.c

index 4118704cb0e71025021a4521c9365e3ecad00958..6708c16402073c492d8ef7a579f772d5d333e53f 100644 (file)
@@ -2034,6 +2034,13 @@ void __ieee80211_flush_queues(struct ieee80211_local *local,
 
 static inline bool ieee80211_can_run_worker(struct ieee80211_local *local)
 {
+       /*
+        * It's unsafe to try to do any work during reconfigure flow.
+        * When the flow ends the work will be requeued.
+        */
+       if (local->in_reconfig)
+               return false;
+
        /*
         * If quiescing is set, we are racing with __ieee80211_suspend.
         * __ieee80211_suspend flushes the workers after setting quiescing,
index 447a55ae9df1750d934a771cea65936721d49127..3400e2da7297a15e5b92adb4ee684a8cdb573b95 100644 (file)
@@ -2442,6 +2442,10 @@ int ieee80211_reconfig(struct ieee80211_local *local)
                mutex_lock(&local->mtx);
                ieee80211_start_next_roc(local);
                mutex_unlock(&local->mtx);
+
+               /* Requeue all works */
+               list_for_each_entry(sdata, &local->interfaces, list)
+                       ieee80211_queue_work(&local->hw, &sdata->work);
        }
 
        ieee80211_wake_queues_by_reason(hw, IEEE80211_MAX_QUEUE_MAP,