linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Moon Hee Lee <moonhee.lee.ca@gmail.com>
To: syzbot+ededba317ddeca8b3f08@syzkaller.appspotmail.com,
	syzkaller-bugs@googlegroups.com, linux-kernel@vger.kernel.org
Cc: moonhee.lee.ca@gmail.com
Subject: [PATCH] wifi: mac80211: reject opmode notification for unsupported channel widths
Date: Tue,  1 Jul 2025 14:11:06 -0700	[thread overview]
Message-ID: <20250701211105.280128-2-moonhee.lee.ca@gmail.com> (raw)

#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless.git main

---
 net/mac80211/cfg.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index d9d88f2f2831..f2e96eb07e8f 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1959,6 +1959,21 @@ 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_NOHT:
+		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:
+			break;
+		default:
+			return -EINVAL;
+		}
+
 		/* returned value is only needed for rc update, but the
 		 * rc isn't initialized here yet, so ignore it
 		 */
-- 
2.43.0


             reply	other threads:[~2025-07-01 21:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-01 21:11 Moon Hee Lee [this message]
2025-07-01 21:43 ` [syzbot] [wireless?] WARNING in _ieee80211_sta_cur_vht_bw syzbot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250701211105.280128-2-moonhee.lee.ca@gmail.com \
    --to=moonhee.lee.ca@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syzbot+ededba317ddeca8b3f08@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).