wifi: mac80211: increase scan_ies_len for S1G
PATCH v3 1/1 wifi: mac80211: increase scan_ies_len for S1G
Currently the S1G capability element is not taken into account for the scan_ies_len, which leads to a buffer length validation failure in ieee80211_prep_hw_scan() and subsequent WARN in __ieee80211_start_scan(). This prevents hw scanning from functioning. To fix ensure we accommodate for the S1G capability length.
---
v2 -> v3: don't include kernel test robot for a new patch...
Again, targetted wireless.. but not really sure if this qualifies as a "bug"... I gave my reasoning in the reply to the first patch:
--- net/mac80211/main.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
net/mac80211/main.c +6 -1
@@ -1111,7 +1111,7 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)int result, i;enum nl80211_band band;int channels, max_bitrates; -bool supp_ht, supp_vht, supp_he, supp_eht; +bool supp_ht, supp_vht, supp_he, supp_eht, supp_s1g;struct cfg80211_chan_def dflt_chandef = {}; if (ieee80211_hw_check(hw, QUEUE_CONTROL) &&
@@ -1227,6 +1227,7 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) supp_vht = false; supp_he = false; supp_eht = false; + supp_s1g = false;for (band =0 ; band <NUM_NL80211_BANDS ; band++) {const struct ieee80211_sband_iftype_data *iftd;struct ieee80211_supported_band *sband;
@@ -1274,6 +1275,7 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) max_bitrates = sband->n_bitrates; supp_ht = supp_ht || sband->ht_cap.ht_supported; supp_vht = supp_vht || sband->vht_cap.vht_supported; + supp_s1g = supp_s1g || sband->s1g_cap.s1g;for_each_sband_iftype_data (sband, i, iftd) {u8 he_40_mhz_cap;
@@ -1406,6 +1408,9 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) local->scan_ies_len +=2 +sizeof (struct ieee80211_vht_cap ); +if (supp_s1g) + local->scan_ies_len +=2 +sizeof (struct ieee80211_s1g_cap ); +/* * HE cap element is variable in size - set len to allow max size */ if (supp_he) {
Signature · 1 line
2.43.0
Johannes Berg
maintainerQuoted 6 lines · Lachlan Hodges
Currently the S1G capability element is not taken into account for the
scan_ies_len, which leads to a buffer length validation failure inieee80211_prep_hw_scan()and subsequent WARN in__ieee80211_start_scan(). This prevents hw scanning from functioning. To fix ensure we accommodate for the S1G capability length.
Quoted 8 lines
Signed-off-by Lachlan Hodges <[email protected]>---
v2 -> v3: don't include kernel test robot for a new patch...Again, targetted wireless.. but not really sure if this qualifies as a "bug"... I gave my reasoning in the reply to the first patch:
I'm happy with it to go to wireless, and will just do that at this stage, but I'm also curious how it would matter at all there?
The only driver with S1G right now is hwsim, I believe, which always has also other bands and HT/VHT/etc., so wouldn't it allocate more than enough space anyway?
Feels like you should only be able to run into this with a driver that only has S1G, and no such driver exists upstream? Or am I confused?
johannes
Quoted 19 lines · Johannes Berg
Quoted 6 lines · Lachlan Hodges
Currently the S1G capability element is not taken into account for the
scan_ies_len, which leads to a buffer length validation failure inieee80211_prep_hw_scan()and subsequent WARN in__ieee80211_start_scan(). This prevents hw scanning from functioning. To fix ensure we accommodate for the S1G capability length.Quoted 8 lines
Signed-off-by Lachlan Hodges <[email protected]>---
v2 -> v3: don't include kernel test robot for a new patch...Again, targetted wireless.. but not really sure if this qualifies as a "bug"... I gave my reasoning in the reply to the first patch:
I'm happy with it to go to wireless, and will just do that at this stage, but I'm also curious how it would matter at all there?
Quoted 6 lines
The only driver with S1G right now is hwsim, I believe, which always has also other bands and HT/VHT/etc., so wouldn't it allocate more than enough space anyway?
Feels like you should only be able to run into this with a driver that only has S1G, and no such driver exists upstream? Or am I confused?
Thanks Johannes, and no you are not confused. In retrospect I should've just targeted wireless-next since the "bug" didn't affect anything upstream anyway (since hwsim used the other lengths as mentioned).
lachlan