]> git.baikalelectronics.ru Git - kernel.git/commit
mac80211: set bss_info data before configuring the channel
authorJohannes Berg <johannes.berg@intel.com>
Sat, 10 Jun 2017 10:52:43 +0000 (13:52 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 13 Jun 2017 08:24:33 +0000 (10:24 +0200)
commitdc40b7e814b7affa1429489b93daad662d7e2188
tree1b3c0ab10eeae62cc057c93b3f6189a90555eeb3
parent0d0ae2078becc7b96dc3c9d678c9def816f957c7
mac80211: set bss_info data before configuring the channel

When mac80211 changes the channel, it also calls into the driver's
bss_info_changed() callback, e.g. with BSS_CHANGED_IDLE. The driver
may, like iwlwifi does, access more data from bss_info in that case
and iwlwifi accesses the basic_rates bitmap, but if changing from a
band with more (basic) rates to one with fewer, an out-of-bounds
access of the rate array may result.

While we can't avoid having invalid data at some point in time, we
can avoid having it while we call the driver - so set up all the
data before configuring the channel, and then apply it afterwards.

This fixes https://bugzilla.kernel.org/show_bug.cgi?id=195677

Reported-by: Johannes Hirte <johannes.hirte@datenkhaos.de>
Tested-by: Johannes Hirte <johannes.hirte@datenkhaos.de>
Debugged-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/mlme.c