1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/drivers/net/wireless/ath
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
..
ar5523 Merge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git 2022-10-29 08:25:50 +03:00
ath5k wifi: ath5k: fix an off by one check in ath5k_eeprom_read_freq_list() 2023-02-22 11:56:30 +02:00
ath6kl Revert "wifi: ath6k: silence false positive -Wno-dangling-pointer warning on GCC 12" 2023-07-26 10:09:28 +03:00
ath9k wifi: ath9k: convert msecs to jiffies where needed 2023-06-21 21:07:22 +03:00
ath10k Networking changes for 6.5. 2023-06-28 16:43:10 -07:00
ath11k Revert "wifi: ath11k: Enable threaded NAPI" 2023-07-26 09:56:53 +03:00
ath12k wifi: ath12k: Fix buffer overflow when scanning with extraie 2023-08-09 14:44:14 +02:00
carl9170 wifi: carl9170: Replace fake flex-array with flexible-array member 2023-03-24 16:54:01 +02:00
wcn36xx wifi: wcn36xx: add support for pronto-v3 2023-03-15 12:15:50 +02:00
wil6210 wifi: wil6210: wmi: Replace zero-length array with DECLARE_FLEX_ARRAY() helper 2023-05-25 20:03:35 +03:00
ath.h wifi: ath: Silence memcpy run-time false positive warning 2023-02-17 18:24:16 +02:00
debug.c
dfs_pattern_detector.c ath: dfs_pattern_detector: Avoid open coded arithmetic in memory allocation 2022-01-17 14:41:51 +02:00
dfs_pattern_detector.h ath: add support to get the detected radar specifications 2018-05-25 13:15:21 +03:00
dfs_pri_detector.c ath: dfs_pri_detector: Demote zero/half completed kernel-doc headers 2020-11-07 10:06:49 +02:00
dfs_pri_detector.h ath: add support to get the detected radar specifications 2018-05-25 13:15:21 +03:00
hw.c wifi: ath: fix repeated words in comments 2022-07-18 13:04:50 +03:00
Kconfig wifi: ath12k: driver for Qualcomm Wi-Fi 7 devices 2022-11-29 12:49:06 +02:00
key.c wifi: ath: Silence memcpy run-time false positive warning 2023-02-17 18:24:16 +02:00
main.c
Makefile wifi: ath12k: driver for Qualcomm Wi-Fi 7 devices 2022-11-29 12:49:06 +02:00
reg.h
regd.c Revert "ath: add support for special 0x0 regulatory domain" 2022-03-07 19:45:08 +02:00
regd.h ath: regdom: extend South Korea regulatory domain support 2021-12-08 10:37:38 +02:00
regd_common.h ath: regdom: extend South Korea regulatory domain support 2021-12-08 10:37:38 +02:00
spectral_common.h ath: Replace zero-length arrays with flexible-array members 2022-02-21 12:26:28 +02:00
trace.c
trace.h tracing/ath: Use the new __vstring() helper 2022-07-15 17:44:40 -04:00