aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNaftali Goldstein <naftali.goldstein@intel.com>2019-05-29 15:25:30 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-07-14 08:11:11 +0200
commitba0afe520ee9c41670c30f9f4ea7669561dff1bb (patch)
tree9f3b5438e7025b25327f470b18e9b0069a8b029d
parentde8cf2c0bc6414af3e27a2f33d27e1671cd2e5af (diff)
downloadlinux-stable-ba0afe520ee9c41670c30f9f4ea7669561dff1bb.tar.gz
mac80211: do not start any work during reconfigure flow
[ 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>
-rw-r--r--net/mac80211/ieee80211_i.h7
-rw-r--r--net/mac80211/util.c4
2 files changed, 11 insertions, 0 deletions
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 24f5ced630f5e4..cfd30671ccdf9e 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -1999,6 +1999,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,
* and we check quiescing / suspended before enqueing new workers.
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index 2558a34c9df16f..c59638574cf8b3 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -2224,6 +2224,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,