android_kernel_motorola_sm6375/net/mac80211
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Dmitry Antipov d46afb7c54 wifi: mac80211: fix UBSAN noise in ieee80211_prep_hw_scan()
[ Upstream commit 92ecbb3ac6f3fe8ae9edf3226c76aa17b6800699 ]

When testing the previous patch with CONFIG_UBSAN_BOUNDS, I've
noticed the following:

UBSAN: array-index-out-of-bounds in net/mac80211/scan.c:372:4
index 0 is out of range for type 'struct ieee80211_channel *[]'
CPU: 0 PID: 1435 Comm: wpa_supplicant Not tainted 6.9.0+ #1
Hardware name: LENOVO 20UN005QRT/20UN005QRT <...BIOS details...>
Call Trace:
 <TASK>
 dump_stack_lvl+0x2d/0x90
 __ubsan_handle_out_of_bounds+0xe7/0x140
 ? timerqueue_add+0x98/0xb0
 ieee80211_prep_hw_scan+0x2db/0x480 [mac80211]
 ? __kmalloc+0xe1/0x470
 __ieee80211_start_scan+0x541/0x760 [mac80211]
 rdev_scan+0x1f/0xe0 [cfg80211]
 nl80211_trigger_scan+0x9b6/0xae0 [cfg80211]
 ...<the rest is not too useful...>

Since '__ieee80211_start_scan()' leaves 'hw_scan_req->req.n_channels'
uninitialized, actual boundaries of 'hw_scan_req->req.channels' can't
be checked in 'ieee80211_prep_hw_scan()'. Although an initialization
of 'hw_scan_req->req.n_channels' introduces some confusion around
allocated vs. used VLA members, this shouldn't be a problem since
everything is correctly adjusted soon in 'ieee80211_prep_hw_scan()'.

Cleanup 'kmalloc()' math in '__ieee80211_start_scan()' by using the
convenient 'struct_size()' as well.

Signed-off-by: Dmitry Antipov <[email protected]>
Link: https://msgid.link/[email protected]
[improve (imho) indentation a bit]
Signed-off-by: Johannes Berg <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
2024-07-27 10:38:29 +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
cfg.c wifi: mac80211: check/clear fast rx for non-4addr sta VLAN changes 2024-04-13 12:51:31 +02:00
chan.c wifi: mac80211: fix use-after-free in chanctx code 2022-06-14 18:11:44 +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
driver-ops.h
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-09-15 12:04:53 +02:00
ieee80211_i.h wifi: mac80211: fix ieee80211_bss_*_flags kernel-doc 2024-05-17 11:43:50 +02:00
iface.c
Kconfig
key.c
key.h
led.c
led.h
main.c wifi: mac80211: fix memory free error when registering wiphy fail 2022-12-08 11:22:56 +01:00
Makefile
mesh.c wifi: mac80211: mesh: init nonpeer_pm to active by default in mesh sdata 2024-07-27 10:38:29 +02:00
mesh.h mac80211: mesh: embedd mesh_paths and mpp_paths into ieee80211_if_mesh 2023-02-25 11:53:26 +01:00
mesh_hwmp.c
mesh_pathtbl.c wifi: mac80211: mesh: Fix leak of mesh_preq_queue objects 2024-07-05 09:08:10 +02:00
mesh_plink.c wifi: mac80211: mesh_plink: fix matches_local logic 2024-01-08 11:29:43 +01:00
mesh_ps.c
mesh_sync.c
michael.c
michael.h
mlme.c wifi: mac80211: fix MBSSID parsing use-after-free 2022-10-17 17:24:32 +02:00
ocb.c
offchannel.c
pm.c
rate.c
rate.h
rc80211_minstrel.c
rc80211_minstrel.h
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-05-25 09:14:37 +02:00
scan.c wifi: mac80211: fix UBSAN noise in ieee80211_prep_hw_scan() 2024-07-27 10:38:29 +02:00
spectmgmt.c
sta_info.c wifi: mac80211: Fix deadlock in ieee80211_sta_ps_deliver_wakeup() 2024-07-05 09:08:10 +02:00
sta_info.h
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-03-01 13:13:33 +01:00
util.c wifi: mac80211: fix MBSSID parsing use-after-free 2022-10-17 17:24:32 +02:00
vht.c
wep.c
wep.h
wme.c wifi: mac80211: fix qos on mesh interfaces 2023-04-05 11:16:41 +02:00
wme.h
wpa.c
wpa.h