summaryrefslogtreecommitdiffstats
path: root/net/mac80211/driver-ops.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2023-08-29 20:16:11 +0200
committerJohannes Berg <johannes.berg@intel.com>2023-09-11 11:27:23 +0200
commit05f136220d17839eb7c155f015ace9152f603225 (patch)
tree821fb907f7b7cd48cab2be90385b05134e183cfc /net/mac80211/driver-ops.c
parentcbaccdc42483c65016f1bae89128c08dc17cfb2a (diff)
downloadlinux-stable-05f136220d17839eb7c155f015ace9152f603225.tar.gz
linux-stable-05f136220d17839eb7c155f015ace9152f603225.tar.bz2
linux-stable-05f136220d17839eb7c155f015ace9152f603225.zip
wifi: mac80211: fix BA session teardown race
As previously reported by Alexander, whose commit 69403bad97aa ("wifi: mac80211: sdata can be NULL during AMPDU start") I'm reverting as part of this commit, there's a race between station destruction and aggregation setup, where the aggregation setup can happen while the station is being removed and queue the work after ieee80211_sta_tear_down_BA_sessions() has already run in __sta_info_destroy_part1(), and thus the worker will run with a now freed station. In his case, this manifested in a NULL sdata pointer, but really there's no guarantee whatsoever. The real issue seems to be that it's possible at all to have a situation where this occurs - we want to stop the BA sessions when doing _part1, but we cannot be sure, and WLAN_STA_BLOCK_BA isn't necessarily effective since we don't know that the setup isn't concurrently running and already got past the check. Simply call ieee80211_sta_tear_down_BA_sessions() again in the second part of station destruction, since at that point really nothing else can hold a reference to the station any more. Also revert the sdata checks since those are just misleading at this point. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/driver-ops.c')
-rw-r--r--net/mac80211/driver-ops.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/net/mac80211/driver-ops.c b/net/mac80211/driver-ops.c
index 919300750527..169dbbca54b6 100644
--- a/net/mac80211/driver-ops.c
+++ b/net/mac80211/driver-ops.c
@@ -409,9 +409,6 @@ int drv_ampdu_action(struct ieee80211_local *local,
might_sleep();
lockdep_assert_wiphy(local->hw.wiphy);
- if (!sdata)
- return -EIO;
-
sdata = get_bss_sdata(sdata);
if (!check_sdata_in_driver(sdata))
return -EIO;