Skip to content

Commit 58fcb1b

Browse files
moonheeleejmberg-intel
authored andcommitted
wifi: mac80211: reject VHT opmode for unsupported channel widths
VHT operating mode notifications are not defined for channel widths below 20 MHz. In particular, 5 MHz and 10 MHz are not valid under the VHT specification and must be rejected. Without this check, malformed notifications using these widths may reach ieee80211_chan_width_to_rx_bw(), leading to a WARN_ON due to invalid input. This issue was reported by syzbot. Reject these unsupported widths early in sta_link_apply_parameters() when opmode_notif is used. The accepted set includes 20, 40, 80, 160, and 80+80 MHz, which are valid for VHT. While 320 MHz is not defined for VHT, it is allowed to avoid rejecting HE or EHT clients that may still send a VHT opmode notification. Reported-by: [email protected] Closes: https://syzkaller.appspot.com/bug?extid=ededba317ddeca8b3f08 Fixes: 751e748 ("wifi: mac80211: expose ieee80211_chan_width_to_rx_bw() to drivers") Tested-by: [email protected] Signed-off-by: Moon Hee Lee <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Johannes Berg <[email protected]>
1 parent 3b602dd commit 58fcb1b

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

net/mac80211/cfg.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1959,6 +1959,20 @@ static int sta_link_apply_parameters(struct ieee80211_local *local,
19591959
ieee80211_sta_init_nss(link_sta);
19601960

19611961
if (params->opmode_notif_used) {
1962+
enum nl80211_chan_width width = link->conf->chanreq.oper.width;
1963+
1964+
switch (width) {
1965+
case NL80211_CHAN_WIDTH_20:
1966+
case NL80211_CHAN_WIDTH_40:
1967+
case NL80211_CHAN_WIDTH_80:
1968+
case NL80211_CHAN_WIDTH_160:
1969+
case NL80211_CHAN_WIDTH_80P80:
1970+
case NL80211_CHAN_WIDTH_320: /* not VHT, allowed for HE/EHT */
1971+
break;
1972+
default:
1973+
return -EINVAL;
1974+
}
1975+
19621976
/* returned value is only needed for rc update, but the
19631977
* rc isn't initialized here yet, so ignore it
19641978
*/

0 commit comments

Comments
 (0)