1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/drivers/net/wireless/ath/ath12k
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
..
ce.c wifi: ath12k: Fix spelling mistakes in warning messages and comments 2023-02-17 18:04:29 +02:00
ce.h
core.c wifi: ath12k: delete the timer rx_replenish_retry during rmmod 2023-06-09 16:33:05 +03:00
core.h wifi: ath12k: add wait operation for tx management packets for flush from mac80211 2023-05-05 15:56:02 +03:00
dbring.c wifi: ath12k: Fix uninitilized variable clang warnings 2023-01-18 08:37:55 +02:00
dbring.h
debug.c
debug.h
dp.c wifi: ath12k: remove memset with byte count of 278528 2023-02-24 12:23:16 +02:00
dp.h wifi: ath12k: Fix spelling mistakes in warning messages and comments 2023-02-17 18:04:29 +02:00
dp_mon.c wifi: ath12k: dp_mon: clean up some inconsistent indentings 2023-02-17 18:21:00 +02:00
dp_mon.h
dp_rx.c wifi: ath12k: Use msdu_end to check MCBC 2023-06-09 16:32:45 +03:00
dp_rx.h
dp_tx.c wifi: ath12k: fix packets are sent in native wifi mode while we set raw mode 2023-03-24 16:48:34 +02:00
dp_tx.h
hal.c wifi: ath12k: Use msdu_end to check MCBC 2023-06-09 16:32:45 +03:00
hal.h wifi: ath12k: Use msdu_end to check MCBC 2023-06-09 16:32:45 +03:00
hal_desc.h wifi: ath12k: Fix spelling mistakes in warning messages and comments 2023-02-17 18:04:29 +02:00
hal_rx.c wifi: ath12k: hal_rx: Use memset_startat() for clearing queue descriptors 2023-01-18 08:37:56 +02:00
hal_rx.h
hal_tx.c
hal_tx.h
hif.h
htc.c
htc.h
hw.c wifi: ath12k: set PERST pin no pull request for WCN7850 2023-04-26 17:30:07 +03:00
hw.h wifi: ath12k: add qmi_cnss_feature_bitmap field to hardware parameters 2023-04-26 17:30:07 +03:00
Kconfig
mac.c wifi: ath12k: fix conf_mutex in ath12k_mac_op_unassign_vif_chanctx() 2023-06-15 14:35:40 +03:00
mac.h
Makefile
mhi.c
mhi.h
pci.c wifi: ath12k: check hardware major version for WCN7850 2023-06-09 16:32:23 +03:00
pci.h wifi: ath12k: PCI ops for wakeup/release MHI 2023-02-22 11:50:29 +02:00
peer.c
peer.h
qmi.c Networking changes for 6.5. 2023-06-28 16:43:10 -07:00
qmi.h wifi: ath12k: set PERST pin no pull request for WCN7850 2023-04-26 17:30:07 +03:00
reg.c
reg.h
rx_desc.h wifi: ath12k: Fix spelling mistakes in warning messages and comments 2023-02-17 18:04:29 +02:00
trace.c
trace.h
wmi.c wifi: ath12k: Fix buffer overflow when scanning with extraie 2023-08-09 14:44:14 +02:00
wmi.h wifi: ath12k: Add support to parse new WMI event for 6 GHz regulatory 2023-05-26 12:38:51 +03:00