]> exis.tech > repos - linux.git/commit
wifi: mac80211_hwsim: avoid treating MCS as legacy rate index
authorYousef Alhouseen <alhouseenyousef@gmail.com>
Sun, 28 Jun 2026 00:25:37 +0000 (02:25 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 6 Jul 2026 12:11:07 +0000 (14:11 +0200)
commit23b493d9dc5f00bba59347bd8ec7b044e26392a0
treee9ea58622d441f2deb3e39e43810c83ff2a16c31
parent63c2391deefb31e1b801b7f32bd502ca4808639b
wifi: mac80211_hwsim: avoid treating MCS as legacy rate index

Injected HT and VHT rates store an MCS value in rates[0].idx rather
than an index into the legacy bitrate table. hwsim nevertheless passes
these rates to ieee80211_get_tx_rate() while generating monitor frames
and timestamps.

A crafted injected frame can therefore read beyond the bitrate table.
If the resulting bitrate is zero, mac80211_hwsim_write_tsf() also
divides by zero, as observed by syzbot.

Use ieee80211_get_tx_rate() only for legacy rates. The existing fallback
continues to supply a conservative bitrate where hwsim does not yet
calculate MCS rates.

Reported-by: syzbot+21629c14aa749636db9d@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=21629c14aa749636db9d
Signed-off-by: Yousef Alhouseen <alhouseenyousef@gmail.com>
Link: https://patch.msgid.link/20260628002537.23550-1-alhouseenyousef@gmail.com
[drop wrong Fixes tag]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/virtual/mac80211_hwsim_main.c