wifi: mac80211: reject VHT opmode for unsupported channel widths
PATCH v2 1/1 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.
---
Changes in v2:
- Dropped NL80211_CHAN_WIDTH_20_NOHT from the accepted channel widths.
- Clarified in the commit message that 320 MHz is not defined for VHT but still allowed to support HE/EHT clients that may send a VHT opmode notification.
net/mac80211/cfg.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
net/mac80211/cfg.c +14 -0
@@ -1981,6 +1981,20 @@ static int sta_link_apply_parameters(struct ieee80211_local *local,ieee80211_sta_init_nss (link_sta);if (params->opmode_notif_used) { +enum nl80211_chan_width width = link->conf->chanreq.oper.width; + +switch (width) { +case NL80211_CHAN_WIDTH_20 : +case NL80211_CHAN_WIDTH_40 : +case NL80211_CHAN_WIDTH_80 : +case NL80211_CHAN_WIDTH_160 : +case NL80211_CHAN_WIDTH_80P80 : +case NL80211_CHAN_WIDTH_320 :/* not VHT, allowed for HE/EHT */ +break ; +default : +return -EINVAL ; + } +/* returned value is only needed for rc update, but the * rc isn't initialized here yet, so ignore it */
Signature · 1 line
2.43.0