linux/drivers/net/wireless
Marek Vasut 31efbcff90 wifi: rsi: Fix memory corruption due to not set vif driver data size
commit 4f431d88ea upstream.

The struct ieee80211_vif contains trailing space for vif driver data,
when struct ieee80211_vif is allocated, the total memory size that is
allocated is sizeof(struct ieee80211_vif) + size of vif driver data.
The size of vif driver data is set by each WiFi driver as needed.

The RSI911x driver does not set vif driver data size, no trailing space
for vif driver data is therefore allocated past struct ieee80211_vif .
The RSI911x driver does however use the vif driver data to store its
vif driver data structure "struct vif_priv". An access to vif->drv_priv
leads to access out of struct ieee80211_vif bounds and corruption of
some memory.

In case of the failure observed locally, rsi_mac80211_add_interface()
would write struct vif_priv *vif_info = (struct vif_priv *)vif->drv_priv;
vif_info->vap_id = vap_idx. This write corrupts struct fq_tin member
struct list_head new_flows . The flow = list_first_entry(head, struct
fq_flow, flowchain); in fq_tin_reset() then reports non-NULL bogus
address, which when accessed causes a crash.

The trigger is very simple, boot the machine with init=/bin/sh , mount
devtmpfs, sysfs, procfs, and then do "ip link set wlan0 up", "sleep 1",
"ip link set wlan0 down" and the crash occurs.

Fix this by setting the correct size of vif driver data, which is the
size of "struct vif_priv", so that memory is allocated and the driver
can store its driver data in it, instead of corrupting memory around
it.

Cc: stable@vger.kernel.org
Fixes: dad0d04fa7 ("rsi: Add RS9113 wireless driver")
Signed-off-by: Marek Vasut <marex@nabladev.com>
Link: https://patch.msgid.link/20260109235817.150330-1-marex@nabladev.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2026-01-30 10:32:24 +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: Fix firmware version handling 2026-01-08 10:17:12 +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: rtlwifi: 8192cu: fix tid out of range in rtl92cu_tx_fill_desc() 2026-01-08 10:16:42 +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 Networking changes for 6.17. 2025-07-30 08:58:55 -07: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