summaryrefslogtreecommitdiff
path: root/net/mac80211/sta_info.h
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2015-03-05 18:10:08 +0300
committerJohannes Berg <johannes.berg@intel.com>2015-04-20 14:05:29 +0300
commit35c347ac53040daba955fa06fcd5f909bee85017 (patch)
treed41370616c36e6c522bba88a0f254fa4a52454fa /net/mac80211/sta_info.h
parent48bf6beddf455b0cb605915081f3428960a6224e (diff)
downloadlinux-35c347ac53040daba955fa06fcd5f909bee85017.tar.xz
mac80211: lock rate control
Both minstrel (reported by Sven Eckelmann) and the iwlwifi rate control aren't properly taking concurrency into account. It's likely that the same is true for other rate control algorithms. In the case of minstrel this manifests itself in crashes when an update and other data access are run concurrently, for example when the stations change bandwidth or similar. In iwlwifi, this can cause firmware crashes. Since fixing all rate control algorithms will be very difficult, just provide locking for invocations. This protects the internal data structures the algorithms maintain. I've manipulated hostapd to test this, by having it change its advertised bandwidth roughly ever 150ms. At the same time, I'm running a flood ping between the client and the AP, which causes this race of update vs. get_rate/status to easily happen on the client. With this change, the system survives this test. Reported-by: Sven Eckelmann <sven@open-mesh.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/sta_info.h')
-rw-r--r--net/mac80211/sta_info.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/mac80211/sta_info.h b/net/mac80211/sta_info.h
index 40ad52e447ec..e4c4f871ffee 100644
--- a/net/mac80211/sta_info.h
+++ b/net/mac80211/sta_info.h
@@ -353,6 +353,7 @@ struct sta_info {
u8 ptk_idx;
struct rate_control_ref *rate_ctrl;
void *rate_ctrl_priv;
+ spinlock_t rate_ctrl_lock;
spinlock_t lock;
struct work_struct drv_deliver_wk;