linux/drivers/net/wireless/ath
Jiri Slaby (SUSE) d748603f12 wifi: ath5k: do not access array OOB
Vincent reports:
> The ath5k driver seems to do an array-index-out-of-bounds access as
> shown by the UBSAN kernel message:
> UBSAN: array-index-out-of-bounds in drivers/net/wireless/ath/ath5k/base.c:1741:20
> index 4 is out of range for type 'ieee80211_tx_rate [4]'
> ...
> Call Trace:
>  <TASK>
>  dump_stack_lvl+0x5d/0x80
>  ubsan_epilogue+0x5/0x2b
>  __ubsan_handle_out_of_bounds.cold+0x46/0x4b
>  ath5k_tasklet_tx+0x4e0/0x560 [ath5k]
>  tasklet_action_common+0xb5/0x1c0

It is real. 'ts->ts_final_idx' can be 3 on 5212, so:
   info->status.rates[ts->ts_final_idx + 1].idx = -1;
with the array defined as:
   struct ieee80211_tx_rate rates[IEEE80211_TX_MAX_RATES];
while the size is:
   #define IEEE80211_TX_MAX_RATES  4
is indeed bogus.

Set this 'idx = -1' sentinel only if the array index is less than the
array size. As mac80211 will not look at rates beyond the size
(IEEE80211_TX_MAX_RATES).

Note: The effect of the OOB write is negligible. It just overwrites the
next member of info->status, i.e. ack_signal.

Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
Reported-by: Vincent Danjean <vdanjean@debian.org>
Link: https://lore.kernel.org/all/aQYUkIaT87ccDCin@eldamar.lan
Closes: https://bugs.debian.org/1119093
Fixes: 6d7b97b23e ("ath5k: fix tx status reporting issues")
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20251209100459.2253198-1-jirislaby@kernel.org
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
2026-05-04 07:15:20 -07:00
..
ar5523 Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
ath5k wifi: ath5k: do not access array OOB 2026-05-04 07:15:20 -07:00
ath6kl wifi: ath6kl: rename disconnect callback 2026-03-10 08:27:55 -07:00
ath9k A fairly big set of changes all over, notably with: 2026-03-26 18:17:14 -07:00
ath10k wifi: ath10k: snoc: select POWER_SEQUENCING 2026-04-23 10:57:50 -07:00
ath11k wifi: ath11k: Use michael_mic() from cfg80211 2026-04-08 08:55:15 +02:00
ath12k wifi: ath12k: fix peer_id usage in normal RX path 2026-05-04 07:15:20 -07:00
carl9170 Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
wcn36xx Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
wil6210 wifi: cfg80211: support key installation on non-netdev wdevs 2026-03-02 11:28:33 +01:00
ath.h
debug.c
dfs_pattern_detector.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
dfs_pattern_detector.h
dfs_pri_detector.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
dfs_pri_detector.h
hw.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
Kconfig
key.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
main.c wifi: ath: Add missing include of export.h 2025-06-23 07:28:33 -07:00
Makefile
reg.h
regd_common.h
regd.c
regd.h
spectral_common.h
testmode_i.h wifi: ath: create common testmode_i.h file for ath drivers 2025-01-22 10:31:41 -08:00
trace.c
trace.h tracing/treewide: Remove second parameter of __assign_str() 2024-05-22 20:14:47 -04:00