From: Lachlan Hodges Date: Thu, 12 Mar 2026 04:58:04 +0000 (+1100) Subject: wifi: cfg80211: check non-S1G width with S1G chandef X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7218d8e9d8485b08933d832615ca19760a8999cd;p=thirdparty%2Flinux.git wifi: cfg80211: check non-S1G width with S1G chandef It is not valid to have an S1G chandef with a non-S1G width. Enforce this during chandef validation. Signed-off-by: Lachlan Hodges Link: https://patch.msgid.link/20260312045804.362974-4-lachlan.hodges@morsemicro.com Signed-off-by: Johannes Berg --- diff --git a/net/wireless/chan.c b/net/wireless/chan.c index 3e483fb27c4ed..fa0764ede9c59 100644 --- a/net/wireless/chan.c +++ b/net/wireless/chan.c @@ -405,6 +405,14 @@ bool cfg80211_chandef_valid(const struct cfg80211_chan_def *chandef) control_freq = chandef->chan->center_freq; + if (cfg80211_chandef_is_s1g(chandef) && + chandef->width != NL80211_CHAN_WIDTH_1 && + chandef->width != NL80211_CHAN_WIDTH_2 && + chandef->width != NL80211_CHAN_WIDTH_4 && + chandef->width != NL80211_CHAN_WIDTH_8 && + chandef->width != NL80211_CHAN_WIDTH_16) + return false; + switch (chandef->width) { case NL80211_CHAN_WIDTH_5: case NL80211_CHAN_WIDTH_10: