Skip to content

Commit 7e2f321

Browse files
donnaskiezjmberg-intel
authored andcommitted
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. Signed-off-by: Lachlan Hodges <lachlan.hodges@morsemicro.com> Link: https://patch.msgid.link/20250826085437.3493-1-lachlan.hodges@morsemicro.com Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent a33b375 commit 7e2f321

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

net/mac80211/main.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1111,7 +1111,7 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
11111111
int result, i;
11121112
enum nl80211_band band;
11131113
int channels, max_bitrates;
1114-
bool supp_ht, supp_vht, supp_he, supp_eht;
1114+
bool supp_ht, supp_vht, supp_he, supp_eht, supp_s1g;
11151115
struct cfg80211_chan_def dflt_chandef = {};
11161116

11171117
if (ieee80211_hw_check(hw, QUEUE_CONTROL) &&
@@ -1227,6 +1227,7 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
12271227
supp_vht = false;
12281228
supp_he = false;
12291229
supp_eht = false;
1230+
supp_s1g = false;
12301231
for (band = 0; band < NUM_NL80211_BANDS; band++) {
12311232
const struct ieee80211_sband_iftype_data *iftd;
12321233
struct ieee80211_supported_band *sband;
@@ -1274,6 +1275,7 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
12741275
max_bitrates = sband->n_bitrates;
12751276
supp_ht = supp_ht || sband->ht_cap.ht_supported;
12761277
supp_vht = supp_vht || sband->vht_cap.vht_supported;
1278+
supp_s1g = supp_s1g || sband->s1g_cap.s1g;
12771279

12781280
for_each_sband_iftype_data(sband, i, iftd) {
12791281
u8 he_40_mhz_cap;
@@ -1406,6 +1408,9 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
14061408
local->scan_ies_len +=
14071409
2 + sizeof(struct ieee80211_vht_cap);
14081410

1411+
if (supp_s1g)
1412+
local->scan_ies_len += 2 + sizeof(struct ieee80211_s1g_cap);
1413+
14091414
/*
14101415
* HE cap element is variable in size - set len to allow max size */
14111416
if (supp_he) {

0 commit comments

Comments
 (0)