public inbox for linux-kernel-mentees@lists.linux-foundation.org
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Moonhee Lee <moonhee.lee.ca@gmail.com>
Cc: Nicolas Escande <nico.escande@gmail.com>,
	linux-wireless@vger.kernel.org, 	linux-kernel@vger.kernel.org,
	linux-kernel-mentees@lists.linux.dev,
	 syzbot+ededba317ddeca8b3f08@syzkaller.appspotmail.com
Subject: Re: [PATCH wireless-next] wifi: mac80211: reject VHT opmode for unsupported channel widths
Date: Thu, 03 Jul 2025 18:54:09 +0200	[thread overview]
Message-ID: <5fda29626ca04e7c2ad46ca4a3d0eb1d992789d9.camel@sipsolutions.net> (raw)
In-Reply-To: <CAF3JpA7ZeG5uxLJr1NQBBzF=UZRi4sj4TSfBw=Pvx7xb1NCqTw@mail.gmail.com> (sfid-20250703_183535_569381_928B48E3)

On Thu, 2025-07-03 at 09:35 -0700, Moonhee Lee wrote:
> 
> To address this, I plan to reject the set of channel widths that are not valid
> with VHT opmode. This includes all channel widths below 20 MHz, as well as
> 20 MHz without HT (20_NOHT), which is also incompatible.
> 
> Would the following logic for v2 be acceptable?
> 
>     /* reject channel widths not valid with VHT opmode */
>     switch (width) {
>     case NL80211_CHAN_WIDTH_5:
>     case NL80211_CHAN_WIDTH_10:
>     case NL80211_CHAN_WIDTH_1:
>     case NL80211_CHAN_WIDTH_2:
>     case NL80211_CHAN_WIDTH_4:
>     case NL80211_CHAN_WIDTH_8:
>     case NL80211_CHAN_WIDTH_16:
>     case NL80211_CHAN_WIDTH_20_NOHT:
>         return -EINVAL;
>     default:
>         break;
>     }
> 
> This allows valid HT/VHT channel widths, including 20, 40, 80, 80+80, 160, and
> 320, to pass through while filtering out values that would otherwise trigger a
> WARN_ON.

I think it'd make more sense to go the other way around and list the
bandwidths that are _valid_ here, even if I don't see it getting
extended any time soon (anyone working on TVHT? ;-) )

But in some way I also have a feeling we _should_ be able to reject this
in cfg80211 already - although it seems that right now we cannot. Hmm. I
guess better to have this validation here now than fail/WARN, but then
I'd like a positive list of allowed values, rather than forbidden ones.

johannes

  reply	other threads:[~2025-07-03 16:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-02  6:59 [PATCH wireless-next] wifi: mac80211: reject VHT opmode for unsupported channel widths Moon Hee Lee
2025-07-03  8:12 ` Nicolas Escande
2025-07-03  9:02   ` Moonhee Lee
2025-07-03 15:09     ` Johannes Berg
2025-07-03 15:11       ` Johannes Berg
2025-07-03 16:35         ` Moonhee Lee
2025-07-03 16:54           ` Johannes Berg [this message]
2025-07-03 18:45             ` Moonhee Lee

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=5fda29626ca04e7c2ad46ca4a3d0eb1d992789d9.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=linux-kernel-mentees@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=moonhee.lee.ca@gmail.com \
    --cc=nico.escande@gmail.com \
    --cc=syzbot+ededba317ddeca8b3f08@syzkaller.appspotmail.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