Skip to content

Commit 99067b5

Browse files
committed
wifi: mac80211: don't WARN for connections on invalid channels
It's not clear (to me) how exactly syzbot managed to hit this, but it seems conceivable that e.g. regulatory changed and has disabled a channel between scanning (channel is checked to be usable by cfg80211_get_ies_channel_number) and connecting on the channel later. With one scenario that isn't covered elsewhere described above, the warning isn't good, replace it with a (more informative) error message. Reported-by: syzbot+639af5aa411f2581ad38@syzkaller.appspotmail.com Link: https://patch.msgid.link/20251202102511.5a8fb5184fa3.I961ee41b8f10538a54b8565dbf03ec1696e80e03@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent e75665d commit 99067b5

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

net/mac80211/mlme.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1126,7 +1126,10 @@ ieee80211_determine_chan_mode(struct ieee80211_sub_if_data *sdata,
11261126

11271127
while (!ieee80211_chandef_usable(sdata, &chanreq->oper,
11281128
IEEE80211_CHAN_DISABLED)) {
1129-
if (WARN_ON(chanreq->oper.width == NL80211_CHAN_WIDTH_20_NOHT)) {
1129+
if (chanreq->oper.width == NL80211_CHAN_WIDTH_20_NOHT) {
1130+
link_id_info(sdata, link_id,
1131+
"unusable channel (%d MHz) for connection\n",
1132+
chanreq->oper.chan->center_freq);
11301133
ret = -EINVAL;
11311134
goto free;
11321135
}

0 commit comments

Comments
 (0)