linux/drivers/net/wireless/rsi
Tianchu Chen e6c5ed7a98 wifi: rsi: fix heap OOB write on key removal
When a key is removed (data == NULL), rsi_hal_load_key() runs:

	memset(&set_key[FRAME_DESC_SZ], 0, frame_len - FRAME_DESC_SZ);

set_key is a struct rsi_set_key *, so the subscript is scaled by
sizeof(struct rsi_set_key) (160 bytes): &set_key[FRAME_DESC_SZ] is
skb->data + 2560, and the memset writes 144 zero bytes starting
2.4KB past the end of the 160-byte skb data buffer, corrupting
unrelated heap objects. The intended byte offset would have been
(u8 *)set_key + FRAME_DESC_SZ.

The write fires on every DISABLE_KEY callback, so plain disconnects,
roams and interface teardowns trigger it on real networks.

The memset is redundant: the whole buffer is zeroed right after
allocation, so the frame sent to the device is byte-identical
without it. Drop the else branch; normal operation is unaffected.

Discovered by Atuin - Automated Vulnerability Discovery Engine.

Fixes: dad0d04fa7 ("rsi: Add RS9113 wireless driver")
Cc: stable@vger.kernel.org
Assisted-by: LLM
Signed-off-by: Tianchu Chen <flynnnchen@tencent.com>
Link: https://patch.msgid.link/90bb2b07007942064c04aa3729cedd9eb1e930b1@linux.dev
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2026-09-09 14:51:30 +02:00
..
Kconfig
Makefile
rsi_91x_coex.c wifi: rsi: Fix types to appease CFI 2026-08-06 14:03:47 +02:00
rsi_91x_core.c wifi: rsi: Fix handling of 802.3 EAPOL frames sent via control port 2022-11-08 09:41:02 +02:00
rsi_91x_debugfs.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
rsi_91x_hal.c wifi: rsi: validate beacon length before fixed buffer copy 2026-07-06 14:11:09 +02:00
rsi_91x_mac80211.c wifi: rsi_91x_usb: do not pause rfkill polling when stopping mac80211 2026-03-19 09:07:16 +01:00
rsi_91x_main.c wifi: rsi: Fix types to appease CFI 2026-08-06 14:03:47 +02:00
rsi_91x_mgmt.c wifi: rsi: fix heap OOB write on key removal 2026-09-09 14:51:30 +02:00
rsi_91x_ps.c rsi: remove unused including <linux/version.h> 2021-04-13 14:51:41 -07:00
rsi_91x_sdio_ops.c wifi: rsi: Fix types to appease CFI 2026-08-06 14:03:47 +02:00
rsi_91x_sdio.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
rsi_91x_usb_ops.c wifi: rsi: Fix types to appease CFI 2026-08-06 14:03:47 +02:00
rsi_91x_usb.c wifi: rsi_91x_usb: do not pause rfkill polling when stopping mac80211 2026-03-19 09:07:16 +01:00
rsi_boot_params.h rsi: fix comment syntax in file headers 2021-04-18 09:27:35 +03:00
rsi_coex.h rsi: fix comment syntax in file headers 2021-04-18 09:27:35 +03:00
rsi_common.h wifi: rsi: Fix types to appease CFI 2026-08-06 14:03:47 +02:00
rsi_debugfs.h wifi: rsi: Remove an unused field in struct rsi_debugfs 2024-09-09 15:30:49 +03:00
rsi_hal.h wifi: rsi: Avoid defines prefixed with CONFIG 2023-02-13 19:24:10 +02:00
rsi_main.h rsi: fix rate mask set leading to P2P failure 2021-09-21 08:42:37 +03:00
rsi_mgmt.h rsi: fix comment syntax in file headers 2021-04-18 09:27:35 +03:00
rsi_ps.h rsi: fix comment syntax in file headers 2021-04-18 09:27:35 +03:00
rsi_sdio.h wifi: rsi: Fix types to appease CFI 2026-08-06 14:03:47 +02:00
rsi_usb.h wifi: rsi: Fix types to appease CFI 2026-08-06 14:03:47 +02:00