summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorBrian Norris2019-07-27 00:47:58 +0200
committerGreg Kroah-Hartman2019-08-16 10:12:52 +0200
commita566750c3a78b0dc78c328a88ded49db4f7876ea (patch)
treef87e1318d04d8a0e24acbedb126616e2bf9ce482 /net
parentALSA: hda - Workaround for crackled sound on AMD controller (1022:1457) (diff)
downloadkernel-qcow2-linux-a566750c3a78b0dc78c328a88ded49db4f7876ea.tar.gz
kernel-qcow2-linux-a566750c3a78b0dc78c328a88ded49db4f7876ea.tar.xz
kernel-qcow2-linux-a566750c3a78b0dc78c328a88ded49db4f7876ea.zip
mac80211: don't WARN on short WMM parameters from AP
commit 05aaa5c97dce4c10a9e7eae2f1569a684e0c5ced upstream. In a very similar spirit to commit c470bdc1aaf3 ("mac80211: don't WARN on bad WMM parameters from buggy APs"), an AP may not transmit a fully-formed WMM IE. For example, it may miss or repeat an Access Category. The above loop won't catch that and will instead leave one of the four ACs zeroed out. This triggers the following warning in drv_conf_tx() wlan0: invalid CW_min/CW_max: 0/0 and it may leave one of the hardware queues unconfigured. If we detect such a case, let's just print a warning and fall back to the defaults. Tested with a hacked version of hostapd, intentionally corrupting the IEs in hostapd_eid_wmm(). Cc: stable@vger.kernel.org Signed-off-by: Brian Norris <briannorris@chromium.org> Link: https://lore.kernel.org/r/20190726224758.210953-1-briannorris@chromium.org Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net')
-rw-r--r--net/mac80211/mlme.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 1aaa73fa308e..b5c06242a92e 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -1967,6 +1967,16 @@ ieee80211_sta_wmm_params(struct ieee80211_local *local,
ieee80211_regulatory_limit_wmm_params(sdata, &params[ac], ac);
}
+ /* WMM specification requires all 4 ACIs. */
+ for (ac = 0; ac < IEEE80211_NUM_ACS; ac++) {
+ if (params[ac].cw_min == 0) {
+ sdata_info(sdata,
+ "AP has invalid WMM params (missing AC %d), using defaults\n",
+ ac);
+ return false;
+ }
+ }
+
for (ac = 0; ac < IEEE80211_NUM_ACS; ac++) {
mlme_dbg(sdata,
"WMM AC=%d acm=%d aifs=%d cWmin=%d cWmax=%d txop=%d uapsd=%d, downgraded=%d\n",