Ubuntu-focal-kernel/net/mac80211
Kenton Groombridge 534cbfbeba wifi: mac80211: Avoid address calculations via out of bounds array indexing
req->n_channels must be set before req->channels[] can be used.

This patch fixes one of the issues encountered in [1].

[   83.964255] UBSAN: array-index-out-of-bounds in net/mac80211/scan.c:364:4
[   83.964258] index 0 is out of range for type 'struct ieee80211_channel *[]'
[...]
[   83.964264] Call Trace:
[   83.964267]  <TASK>
[   83.964269]  dump_stack_lvl+0x3f/0xc0
[   83.964274]  __ubsan_handle_out_of_bounds+0xec/0x110
[   83.964278]  ieee80211_prep_hw_scan+0x2db/0x4b0
[   83.964281]  __ieee80211_start_scan+0x601/0x990
[   83.964291]  nl80211_trigger_scan+0x874/0x980
[   83.964295]  genl_family_rcv_msg_doit+0xe8/0x160
[   83.964298]  genl_rcv_msg+0x240/0x270
[...]

[1] https://bugzilla.kernel.org/show_bug.cgi?id=218810

Co-authored-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Kees Cook <kees@kernel.org>
Signed-off-by: Kenton Groombridge <concord@gentoo.org>
Link: https://msgid.link/20240605152218.236061-1-concord@gentoo.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

CVE-2024-41071
(backported from commit 2663d0462eb32ae7c9b035300ab6b1523886c718)
[koichiroden: Adjusted context due to missing commit
 5add321c329b ("wifi: cfg80211: remove scan_width support")]
Signed-off-by: Koichiro Den <koichiro.den@canonical.com>
Acked-by: Thibault Ferrante <thibault.ferrante@canonical.com>
Acked-by: Mehmet Basaran <mehmet.basaran@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
2024-09-27 10:50:29 +02:00
..
Kconfig
Makefile
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 mac80211: fix lookup when adding AddBA extension element 2022-03-07 16:34:07 +01:00
agg-tx.c mac80211: refuse aggregations sessions before authorized 2022-05-20 15:17:54 +02:00
cfg.c wifi: mac80211: check/clear fast rx for non-4addr sta VLAN changes 2024-06-07 15:01:37 +02:00
chan.c wifi: mac80211: fix use-after-free in chanctx code 2022-08-26 11:08:21 +02:00
debug.h
debugfs.c
debugfs.h
debugfs_key.c
debugfs_key.h
debugfs_netdev.c
debugfs_netdev.h
debugfs_sta.c
debugfs_sta.h
driver-ops.c mac80211: fix station rate table updates on assoc 2021-03-24 11:11:41 +01:00
driver-ops.h mac80211: mark TX-during-stop for TX in in_reconfig 2022-03-07 16:33:58 +01:00
ethtool.c
fils_aead.c
fils_aead.h
he.c
ht.c
ibss.c wifi: mac80211: Don't finalize CSA in IBSS mode if state is disconnected 2022-11-24 10:28:00 +01:00
ieee80211_i.h wifi: mac80211: fix ieee80211_bss_*_flags kernel-doc 2024-07-05 10:51:52 +02:00
iface.c mac80211: Fix monitor MTU limit so that A-MSDUs get through 2021-10-12 16:31:34 -06:00
key.c wifi: mac80211: fix potential key use-after-free 2024-04-26 10:54:12 +02:00
key.h mac80211: prevent mixed key and fragment cache attacks 2021-05-27 15:23:03 +02:00
led.c
led.h
main.c wifi: mac80211: fix memory free error when registering wiphy fail 2023-02-01 15:21:19 +01:00
mesh.c wifi: mac80211: mesh: init nonpeer_pm to active by default in mesh sdata 2024-09-27 10:50:08 +02:00
mesh.h mac80211: mesh: embedd mesh_paths and mpp_paths into ieee80211_if_mesh 2023-04-18 17:21:05 +02:00
mesh_hwmp.c mac80211: fix potential overflow when multiplying to u32 integers 2021-04-14 18:31:23 +02:00
mesh_pathtbl.c wifi: mac80211: mesh: Fix leak of mesh_preq_queue objects 2024-08-02 16:16:08 +02:00
mesh_plink.c wifi: mac80211: mesh_plink: fix matches_local logic 2024-02-12 09:10:24 +01:00
mesh_ps.c mac80211: mesh: fix potentially unaligned access 2021-11-05 09:12:48 +01:00
mesh_sync.c
michael.c
michael.h
mlme.c wifi: mac80211: fix MBSSID parsing use-after-free 2022-10-17 16:53:06 +02:00
ocb.c
offchannel.c
pm.c
rate.c mac80211: fix station rate table updates on assoc 2021-03-24 11:11:41 +01:00
rate.h
rc80211_minstrel.c mac80211: minstrel: fix tx status processing corner case 2021-01-20 14:24:29 +01:00
rc80211_minstrel.h mac80211: minstrel: remove deferred sampling code 2021-01-20 14:24:29 +01:00
rc80211_minstrel_debugfs.c
rc80211_minstrel_ht.c
rc80211_minstrel_ht.h
rc80211_minstrel_ht_debugfs.c
rx.c mac80211: fix rx reordering with non explicit / psmp ack policy 2022-08-26 11:06:49 +02:00
scan.c wifi: mac80211: Avoid address calculations via out of bounds array indexing 2024-09-27 10:50:29 +02:00
spectmgmt.c mac80211: 160MHz with extended NSS BW in CSA 2021-03-24 11:11:48 +01:00
sta_info.c wifi: mac80211: Fix deadlock in ieee80211_sta_ps_deliver_wakeup() 2024-08-02 16:16:08 +02:00
sta_info.h mac80211: fix regression in SSN handling of addba tx 2022-03-07 16:34:18 +01:00
status.c
tdls.c
tkip.c
tkip.h
trace.c
trace.h
trace_msg.h
tx.c wifi: mac80211: fix race condition on enabling fast-xmit 2024-04-26 10:54:05 +02:00
util.c wifi: mac80211: fix MBSSID parsing use-after-free 2022-10-17 16:53:06 +02:00
vht.c mac80211: don't set set TDLS STA bandwidth wider than possible 2021-01-20 14:26:06 +01:00
wep.c
wep.h
wme.c wifi: mac80211: fix qos on mesh interfaces 2023-07-10 17:22:04 +02:00
wme.h
wpa.c mac80211: fix use-after-free in CCMP/GCMP RX 2021-11-05 09:12:47 +01:00
wpa.h