aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/net/mac80211/sta_info.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2015-03-05 16:10:08 +0100
committerJohannes Berg <johannes.berg@intel.com>2015-04-20 13:05:29 +0200
commit35c347ac53040daba955fa06fcd5f909bee85017 (patch)
treed41370616c36e6c522bba88a0f254fa4a52454fa /net/mac80211/sta_info.c
parentmac80211: introduce plink lock for plink fields (diff)
downloadwireguard-linux-35c347ac53040daba955fa06fcd5f909bee85017.tar.xz
wireguard-linux-35c347ac53040daba955fa06fcd5f909bee85017.zip
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.c')
-rw-r--r--net/mac80211/sta_info.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index 53ab4bd1a44c..0800e02cce05 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -269,7 +269,7 @@ static int sta_prepare_rate_control(struct ieee80211_local *local,
sta->rate_ctrl = local->rate_ctrl;
sta->rate_ctrl_priv = rate_control_alloc_sta(sta->rate_ctrl,
- &sta->sta, gfp);
+ sta, gfp);
if (!sta->rate_ctrl_priv)
return -ENOMEM;