1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/drivers/net/wireless
Wen Gong 06f2ab86a5 wifi: ath12k: Fix buffer overflow when scanning with extraie
If cfg80211 is providing extraie's for a scanning process then ath12k will
copy that over to the firmware. The extraie.len is a 32 bit value in struct
element_info and describes the amount of bytes for the vendor information
elements.

The problem is the allocation of the buffer. It has to align the TLV
sections by 4 bytes. But the code was using an u8 to store the newly
calculated length of this section (with alignment). And the new
calculated length was then used to allocate the skbuff. But the actual
code to copy in the data is using the extraie.len and not the calculated
"aligned" length.

The length of extraie with IEEE80211_HW_SINGLE_SCAN_ON_ALL_BANDS enabled
was 264 bytes during tests with a wifi card. But it only allocated 8
bytes (264 bytes % 256) for it. As consequence, the code to memcpy the
extraie into the skb was then just overwriting data after skb->end. Things
like shinfo were therefore corrupted. This could usually be seen by a crash
in skb_zcopy_clear which tried to call a ubuf_info callback (using a bogus
address).

Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4

Signed-off-by: Wen Gong <quic_wgong@quicinc.com>
Link: https://lore.kernel.org/r/20230809081241.32765-1-quic_wgong@quicinc.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2023-08-09 14:44:14 +02:00
..
admtek wifi: mac80211: add wake_tx_queue callback to drivers 2022-10-10 11:00:03 +02:00
ath wifi: ath12k: Fix buffer overflow when scanning with extraie 2023-08-09 14:44:14 +02:00
atmel wifi: atmel: Fix an error handling path in atmel_probe() 2023-05-25 19:16:15 +03:00
broadcom wifi: brcm80211: handle params_v1 allocation failure 2023-08-08 12:47:37 +02:00
cisco wifi: airo: avoid uninitialized warning in airo_get_rate() 2023-07-11 19:22:54 -07:00
intel wifi: iwlwifi: remove 'use_tfh' config to fix crash 2023-07-11 20:26:06 -07:00
intersil wifi: p54: Add missing MODULE_FIRMWARE macro 2023-06-21 12:53:30 +03:00
legacy wifi: ray_cs: Replace 1-element array with flexible array 2023-08-01 16:40:13 +03:00
marvell Networking changes for 6.5. 2023-06-28 16:43:10 -07:00
mediatek wifi: mt76: mt7615: do not advertise 5 GHz on first phy of MT7615D (DBDC) 2023-07-24 16:32:14 +03:00
microchip wifi: wilc1000: Increase ASSOC response buffer 2023-05-11 15:53:44 +03:00
purelifi wifi: plfxlc: fix potential memory leak in __lf_x_usb_enable_rx() 2022-11-28 15:56:17 +02:00
quantenna wifi: qtnfmac: use struct_size and size_sub for payload length 2023-03-13 15:44:29 +02:00
ralink wifi: rt2x00: fix the typo in comments 2023-06-15 10:46:08 +03:00
realtek wifi: rtw89: fix 8852AE disconnection caused by RX full flags 2023-08-08 12:52:07 +02:00
rsi wifi: rsi: Do not set MMC_PM_KEEP_POWER in shutdown 2023-06-08 19:02:14 +03:00
silabs spi: Updates for v6.4 2023-04-27 11:02:26 -07:00
st net: Replace all spi->chip_select and spi->cs_gpiod references with function call 2023-03-11 12:34:02 +00:00
ti net: Use of_property_read_bool() for boolean properties 2023-03-16 17:41:28 +00:00
virtual wifi: mac80211_hwsim: Don't access vif valid links directly 2023-06-14 12:20:08 +02:00
zydas wifi: zd1211rw: remove redundant decls 2023-02-13 19:25:47 +02:00
Kconfig wifi: move raycs, wl3501 and rndis_wlan to legacy directory 2023-03-13 15:42:14 +02:00
Makefile wifi: move raycs, wl3501 and rndis_wlan to legacy directory 2023-03-13 15:42:14 +02:00