linux/drivers/net/wireless
Ali Tariq 116f7bd816 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:19:46 +01:00
..
admtek wifi: cfg80211/mac80211: Add support to get radio index 2025-06-24 15:19:27 +02:00
ath wifi: ath12k: fix dma_free_coherent() pointer 2026-01-30 10:32:24 +01: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 2026-01-02 12:56:41 +01:00
intel wifi: iwlwifi: mvm: pause TCM on fast resume 2026-02-11 13:41:58 +01: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-30 10:32:24 +01:00
mediatek wifi: mt76: Fix DTS power-limits on little endian systems 2026-01-02 12:57:08 +01: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: cfg80211/mac80211: Add support to get radio index 2025-06-24 15:19:27 +02:00
ralink Plenty of things going on, notably: 2025-09-11 17:50:46 -07:00
realtek wifi: rtl8xxxu: fix slab-out-of-bounds in rtl8xxxu_sta_add 2026-02-16 10:19:46 +01:00
rsi wifi: rsi: Fix memory corruption due to not set vif driver data size 2026-01-30 10:32:24 +01:00
silabs wifi: cfg80211/mac80211: Add support to get radio index 2025-06-24 15:19:27 +02:00
st wifi: cw1200: Fix potential memory leak in cw1200_bh_rx_helper() 2025-12-18 14:02:55 +01:00
ti wifi: wlcore: ensure skb headroom before skb_push 2026-02-11 13:41:46 +01:00
virtual wifi: mac80211_hwsim: fix typo in frequency notification 2026-01-17 16:35:29 +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