linux-stable/net/mac80211
Mikhail Lobanov 3bcb702977 wifi: mac80211: check basic rates validity in sta_link_apply_parameters
commit 16ee3ea8fa upstream.

When userspace sets supported rates for a new station via
NL80211_CMD_NEW_STATION, it might send a list that's empty
or contains only invalid values. Currently, we process these
values in sta_link_apply_parameters() without checking the result of
ieee80211_parse_bitrates(), which can lead to an empty rates bitmap.

A similar issue was addressed for NL80211_CMD_SET_BSS in commit
ce04abc3fc ("wifi: mac80211: check basic rates validity").
This patch applies the same approach in sta_link_apply_parameters()
for NL80211_CMD_NEW_STATION, ensuring there is at least one valid
rate by inspecting the result of ieee80211_parse_bitrates().

Found by Linux Verification Center (linuxtesting.org) with Syzkaller.

Fixes: b95eb7f0ee ("wifi: cfg80211/mac80211: separate link params from station params")
Signed-off-by: Mikhail Lobanov <m.lobanov@rosa.ru>
Link: https://patch.msgid.link/20250317103139.17625-1-m.lobanov@rosa.ru
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
[ Summary of conflict resolutions:
  - The function ieee80211_parse_bitrates() takes channel width as
    its first parameter, and the chandef struct has been refactored
    in kernel version 6.9, in commit
    6092077ad0 so that the width is
    contained in chanreq.oper.width. In kernel version 6.1 the
    width parameter is defined directly in the chandef struct. ]
Signed-off-by: Hanne-Lotta Mäenpää <hannelotta@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-08-28 16:26:16 +02:00
..
aead_api.c
aead_api.h
aes_ccm.h
aes_cmac.c
aes_cmac.h
aes_gcm.h
aes_gmac.c
aes_gmac.h
agg-rx.c
agg-tx.c wifi: mac80211: fix NULL dereference at band check in starting tx ba session 2024-11-08 16:26:48 +01:00
airtime.c
cfg.c wifi: mac80211: check basic rates validity in sta_link_apply_parameters 2025-08-28 16:26:16 +02:00
chan.c wifi: mac80211: update radar_required in channel context after channel switch 2025-08-28 16:25:57 +02:00
debug.h
debugfs_key.c
debugfs_key.h
debugfs_netdev.c wifi: mac80211: prohibit deactivating all links 2025-02-21 13:49:03 +01:00
debugfs_netdev.h
debugfs_sta.c
debugfs_sta.h
debugfs.c
debugfs.h
driver-ops.c wifi: mac80211: fix BA session teardown race 2024-08-29 17:30:28 +02:00
driver-ops.h
eht.c
ethtool.c
fils_aead.c
fils_aead.h
he.c
ht.c
ibss.c
ieee80211_i.h wifi: mac80211: export ieee80211_purge_tx_queue() for drivers 2025-05-02 07:46:55 +02:00
iface.c wifi: mac80211: Purge vif txq in ieee80211_do_stop() 2025-04-25 10:43:47 +02:00
Kconfig mac80211: MAC80211_MESSAGE_TRACING should depend on TRACING 2024-11-08 16:26:40 +01:00
key.c wifi: mac80211: skip non-uploaded keys in ieee80211_iter_keys 2024-11-08 16:26:40 +01:00
key.h
led.c
led.h
link.c
main.c mac80211: fix user-power when emulating chanctx 2024-12-14 19:53:08 +01:00
Makefile
mesh_hwmp.c wifi: mac80211: do not offer a mesh path if forwarding is disabled 2025-06-27 11:07:34 +01:00
mesh_pathtbl.c
mesh_plink.c
mesh_ps.c
mesh_sync.c
mesh.c
mesh.h
michael.c
michael.h
mlme.c wifi: mac80211: don't complete management TX on SAE commit 2025-08-28 16:25:56 +02:00
ocb.c
offchannel.c wifi: mac80211: don't use rate mask for offchannel TX either 2024-10-17 15:20:38 +02:00
pm.c
rate.c wifi: mac80211: don't use rate mask for offchannel TX either 2024-10-17 15:20:38 +02:00
rate.h
rc80211_minstrel_ht_debugfs.c
rc80211_minstrel_ht.c
rc80211_minstrel_ht.h
rx.c wifi: mac80211: drop invalid source address OCB frames 2025-07-10 15:59:50 +02:00
s1g.c
scan.c Revert "wifi: mac80211: fix RCU list iterations" 2024-11-14 13:15:17 +01:00
spectmgmt.c
sta_info.c wifi: mac80211: avoid lockdep checking when removing deflink 2025-08-28 16:26:16 +02:00
sta_info.h wifi: mac80211: add documentation for amsdu_mesh_control 2024-08-29 17:30:54 +02:00
status.c wifi: mac80211: export ieee80211_purge_tx_queue() for drivers 2025-05-02 07:46:55 +02:00
tdls.c wifi: mac80211: reject TDLS operations when station is not associated 2025-08-15 12:04:58 +02:00
tkip.c
tkip.h
trace_msg.h
trace.c
trace.h
tx.c Reapply "wifi: mac80211: Update skb's control block key in ieee80211_tx_dequeue()" 2025-08-15 12:04:59 +02:00
util.c wifi: mac80211: fix beacon interval calculation overflow 2025-07-06 10:58:00 +02:00
vht.c
wep.c
wep.h
wme.c
wme.h
wpa.c
wpa.h