]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit - net/mac80211/sta_info.h
mac80211: lock rate control
authorJohannes Berg <johannes.berg@intel.com>
Thu, 5 Mar 2015 15:10:08 +0000 (16:10 +0100)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 20 Apr 2015 11:05:29 +0000 (13:05 +0200)
commit35c347ac53040daba955fa06fcd5f909bee85017
treed41370616c36e6c522bba88a0f254fa4a52454fa
parent48bf6beddf455b0cb605915081f3428960a6224e
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>
net/mac80211/rate.c
net/mac80211/rate.h
net/mac80211/sta_info.c
net/mac80211/sta_info.h