]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/3.19.4/nl80211-ignore-ht-vht-capabilities-without-qos-wmm.patch
5.1-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.19.4 / nl80211-ignore-ht-vht-capabilities-without-qos-wmm.patch
CommitLineData
35e5a9d9
GKH
1From 496fcc294daab18799e190c0264863d653588d1f Mon Sep 17 00:00:00 2001
2From: Johannes Berg <johannes.berg@intel.com>
3Date: Thu, 12 Mar 2015 08:53:27 +0200
4Subject: nl80211: ignore HT/VHT capabilities without QoS/WMM
5
6From: Johannes Berg <johannes.berg@intel.com>
7
8commit 496fcc294daab18799e190c0264863d653588d1f upstream.
9
10As HT/VHT depend heavily on QoS/WMM, it's not a good idea to
11let userspace add clients that have HT/VHT but not QoS/WMM.
12Since it does so in certain cases we've observed (client is
13using HT IEs but not QoS/WMM) just ignore the HT/VHT info at
14this point and don't pass it down to the drivers which might
15unconditionally use it.
16
17Signed-off-by: Johannes Berg <johannes.berg@intel.com>
18Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
19
20---
21 net/wireless/nl80211.c | 10 ++++++++++
22 1 file changed, 10 insertions(+)
23
24--- a/net/wireless/nl80211.c
25+++ b/net/wireless/nl80211.c
26@@ -4360,6 +4360,16 @@ static int nl80211_new_station(struct sk
27 if (parse_station_flags(info, dev->ieee80211_ptr->iftype, &params))
28 return -EINVAL;
29
30+ /* HT/VHT requires QoS, but if we don't have that just ignore HT/VHT
31+ * as userspace might just pass through the capabilities from the IEs
32+ * directly, rather than enforcing this restriction and returning an
33+ * error in this case.
34+ */
35+ if (!(params.sta_flags_set & BIT(NL80211_STA_FLAG_WME))) {
36+ params.ht_capa = NULL;
37+ params.vht_capa = NULL;
38+ }
39+
40 /* When you run into this, adjust the code below for the new flag */
41 BUILD_BUG_ON(NL80211_STA_FLAG_MAX != 7);
42