diff options
author | Felix Fietkau <nbd@nbd.name> | 2022-05-31 22:08:24 +0300 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2022-06-29 12:43:15 +0300 |
commit | f856373e2f31ffd340e47e2b00027bd4070f74b3 (patch) | |
tree | 4ab015f338e797aad4e81c7796ef20a40736f482 /net/mac80211/util.c | |
parent | a4926abb787e2ef3ee2997e6ca8844d859478647 (diff) | |
download | linux-f856373e2f31ffd340e47e2b00027bd4070f74b3.tar.xz |
wifi: mac80211: do not wake queues on a vif that is being stopped
When a vif is being removed and sdata->bss is cleared, __ieee80211_wake_txqs
can still be called on it, which crashes as soon as sdata->bss is being
dereferenced.
To fix this properly, check for SDATA_STATE_RUNNING before waking queues,
and take the fq lock when setting it (to ensure that __ieee80211_wake_txqs
observes the change when running on a different CPU)
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Acked-by: Toke Høiland-Jørgensen <toke@kernel.org>
Link: https://lore.kernel.org/r/20220531190824.60019-1-nbd@nbd.name
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/util.c')
-rw-r--r-- | net/mac80211/util.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/mac80211/util.c b/net/mac80211/util.c index 1e26b5235add..dad42d42aa84 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c @@ -301,6 +301,9 @@ static void __ieee80211_wake_txqs(struct ieee80211_sub_if_data *sdata, int ac) local_bh_disable(); spin_lock(&fq->lock); + if (!test_bit(SDATA_STATE_RUNNING, &sdata->state)) + goto out; + if (sdata->vif.type == NL80211_IFTYPE_AP) ps = &sdata->bss->ps; |