]>
Commit | Line | Data |
---|---|---|
35e5a9d9 GKH |
1 | From 496fcc294daab18799e190c0264863d653588d1f Mon Sep 17 00:00:00 2001 |
2 | From: Johannes Berg <johannes.berg@intel.com> | |
3 | Date: Thu, 12 Mar 2015 08:53:27 +0200 | |
4 | Subject: nl80211: ignore HT/VHT capabilities without QoS/WMM | |
5 | ||
6 | From: Johannes Berg <johannes.berg@intel.com> | |
7 | ||
8 | commit 496fcc294daab18799e190c0264863d653588d1f upstream. | |
9 | ||
10 | As HT/VHT depend heavily on QoS/WMM, it's not a good idea to | |
11 | let userspace add clients that have HT/VHT but not QoS/WMM. | |
12 | Since it does so in certain cases we've observed (client is | |
13 | using HT IEs but not QoS/WMM) just ignore the HT/VHT info at | |
14 | this point and don't pass it down to the drivers which might | |
15 | unconditionally use it. | |
16 | ||
17 | Signed-off-by: Johannes Berg <johannes.berg@intel.com> | |
18 | Signed-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, ¶ms)) | |
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 |