linux/drivers/net/wireless
Ali Tariq 9a0f3fa6ec wifi: rtl8xxxu: fix slab-out-of-bounds in rtl8xxxu_sta_add
commit 86c946bcc0 upstream.

The driver does not set hw->sta_data_size, which causes mac80211 to
allocate insufficient space for driver private station data in
__sta_info_alloc(). When rtl8xxxu_sta_add() accesses members of
struct rtl8xxxu_sta_info through sta->drv_priv, this results in a
slab-out-of-bounds write.

KASAN report on RISC-V (VisionFive 2) with RTL8192EU adapter:

  BUG: KASAN: slab-out-of-bounds in rtl8xxxu_sta_add+0x31c/0x346
  Write of size 8 at addr ffffffd6d3e9ae88 by task kworker/u16:0/12

Set hw->sta_data_size to sizeof(struct rtl8xxxu_sta_info) during
probe, similar to how hw->vif_data_size is configured. This ensures
mac80211 allocates sufficient space for the driver's per-station
private data.

Tested on StarFive VisionFive 2 v1.2A board.

Fixes: eef55f1545 ("wifi: rtl8xxxu: support multiple interfaces in {add,remove}_interface()")
Cc: stable@vger.kernel.org
Signed-off-by: Ali Tariq <alitariq45892@gmail.com>
Reviewed-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20251225115430.13011-1-alitariq45892@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2026-02-16 10:13:34 +01:00
..
admtek wifi: cfg80211/mac80211: Add support to get radio index 2025-06-24 15:19:27 +02:00
ath wifi: ath12k: Fix wrong P2P device link id issue 2026-01-13 07:25:02 -08:00
atmel wifi: cfg80211/mac80211: Add support to get radio index 2025-06-24 15:19:27 +02:00
broadcom wifi: brcmfmac: Add DMI nvram filename quirk for Acer A1 840 tablet 2025-11-24 13:07:11 +01:00
intel wifi: iwlwifi: mvm: pause TCM on fast resume 2026-02-03 15:02:05 +02:00
intersil wifi: mac80211: support parsing S1G TIM PVB 2025-09-04 11:19:01 +02:00
marvell wifi: mwifiex: Fix a loop in mwifiex_update_ampdu_rxwinsize() 2026-01-12 19:36:55 +01:00
mediatek wifi: mt76: Remove blank line after mt792x firmware version dmesg 2025-12-31 17:03:35 -08:00
microchip Plenty of things going on, notably: 2025-09-11 17:50:46 -07:00
purelifi wifi: plfxlc: Fix error handling in usb driver probe 2025-07-18 14:23:23 +02:00
quantenna wifi: qtnfmac: add WQ_PERCPU to alloc_workqueue users 2025-11-20 10:25:28 +01:00
ralink wifi: rt2x00: add nvmem eeprom support 2025-10-30 08:39:18 +01:00
realtek wifi: rtl8xxxu: fix slab-out-of-bounds in rtl8xxxu_sta_add 2026-02-16 10:13:34 +01:00
rsi wifi: rsi: Fix memory corruption due to not set vif driver data size 2026-01-12 19:34:56 +01:00
silabs wifi: wfx: add WQ_PERCPU to alloc_workqueue users 2025-11-20 10:25:46 +01:00
st wifi: cw1200: add WQ_PERCPU to alloc_workqueue users 2025-11-20 10:26:09 +01:00
ti wifi: wlcore: ensure skb headroom before skb_push 2025-12-16 10:23:06 +01:00
virtual wifi: mac80211_hwsim: disable BHs for hwsim_radio_lock 2026-01-08 13:33:10 +01:00
zydas wifi: zd1211rw: fix potential memory leak in __zd_usb_enable_rx() 2025-10-30 08:41:10 +01:00
Kconfig wifi: remove orphaned rndis_wlan driver 2023-10-30 19:30:33 +02:00
Makefile wifi: remove orphaned rndis_wlan driver 2023-10-30 19:30:33 +02:00