* [PATCH 0/5] wifi: ath11k/ath12k: validate capability TLV lengths
@ 2026-10-28 5:12 Jiale Yao
2026-10-28 5:12 ` [PATCH 1/5] wifi: ath11k: validate DMA buffer release " Jiale Yao
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Jiale Yao @ 2026-10-28 5:12 UTC (permalink / raw)
To: Jeff Johnson, Kalle Valo, Karthikeyan Periyasamy,
Maharaja Kennadyrajan, Miles Hu, Sathishkumar Muruganandam,
Carl Huang, Balamurugan Selvarajan, Pradeep Kumar Chitrapu,
Ramya Gnanasekar, Bhagavathi Perumal S, Wen Gong, Aloka Dixit,
linux-wireless, ath11k, linux-kernel, ath12k
Several ath11k and ath12k WMI parsers count firmware TLVs and later
consume them as arrays of complete capability structures. The generic
iterator validates that a TLV fits in its enclosing message, but these
tags have no minimum-length policies, so a short element can still cause
an out-of-bounds structure read.
Add policies for the DMA buffer release, hardware mode, DMA ring, and
extended MAC/PHY capability TLVs used by these paths.
Jiale Yao (5):
wifi: ath11k: validate DMA buffer release TLV lengths
wifi: ath11k: validate hardware mode capability TLVs
wifi: ath11k: validate DMA ring capability TLVs
wifi: ath12k: validate DMA buffer release fixed TLV length
wifi: ath12k: validate service-ready capability TLV lengths
drivers/net/wireless/ath/ath11k/wmi.c | 8 ++++++++
drivers/net/wireless/ath/ath12k/wmi.c | 8 ++++++++
2 files changed, 16 insertions(+)
--
2.34.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/5] wifi: ath11k: validate DMA buffer release TLV lengths
2026-10-28 5:12 [PATCH 0/5] wifi: ath11k/ath12k: validate capability TLV lengths Jiale Yao
@ 2026-10-28 5:12 ` Jiale Yao
2026-10-28 5:12 ` [PATCH 2/5] wifi: ath11k: validate hardware mode capability TLVs Jiale Yao
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Jiale Yao @ 2026-10-28 5:12 UTC (permalink / raw)
To: Jeff Johnson, Kalle Valo, Karthikeyan Periyasamy, linux-wireless,
ath11k, linux-kernel
Cc: stable
The DMA buffer release parser counts nested entry and metadata TLVs, but
does not ensure their payloads cover the structures later indexed by
the direct buffer ring handler. Short firmware TLVs can therefore lead
to out-of-bounds reads when the arrays are consumed.
Add minimum-length policies for both nested TLV types.
Fixes: 9d11b7bff950 ("ath11k: add support for spectral scan")
Cc: stable@vger.kernel.org
Signed-off-by: Jiale Yao <yaojiale02@163.com>
---
drivers/net/wireless/ath/ath11k/wmi.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/wireless/ath/ath11k/wmi.c b/drivers/net/wireless/ath/ath11k/wmi.c
index 08fd6795ed9e..0d4481a09501 100644
--- a/drivers/net/wireless/ath/ath11k/wmi.c
+++ b/drivers/net/wireless/ath/ath11k/wmi.c
@@ -161,6 +161,10 @@ static const struct wmi_tlv_policy wmi_tlv_policies[] = {
.min_len = sizeof(struct wmi_p2p_noa_event) },
[WMI_TAG_PDEV_CSA_SWITCH_COUNT_STATUS_EVENT] = {
.min_len = sizeof(struct wmi_pdev_csa_switch_ev) },
+ [WMI_TAG_DMA_BUF_RELEASE_ENTRY] = {
+ .min_len = sizeof(struct wmi_dma_buf_release_entry) - TLV_HDR_SIZE },
+ [WMI_TAG_DMA_BUF_RELEASE_SPECTRAL_META_DATA] = {
+ .min_len = sizeof(struct wmi_dma_buf_release_meta_data) - TLV_HDR_SIZE },
};
#define PRIMAP(_hw_mode_) \
--
2.34.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 2/5] wifi: ath11k: validate hardware mode capability TLVs
2026-10-28 5:12 [PATCH 0/5] wifi: ath11k/ath12k: validate capability TLV lengths Jiale Yao
2026-10-28 5:12 ` [PATCH 1/5] wifi: ath11k: validate DMA buffer release " Jiale Yao
@ 2026-10-28 5:12 ` Jiale Yao
2026-10-28 5:12 ` [PATCH 3/5] wifi: ath11k: validate DMA ring " Jiale Yao
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Jiale Yao @ 2026-10-28 5:12 UTC (permalink / raw)
To: Jeff Johnson, Govindaraj Saminathan, Maharaja Kennadyrajan,
Rajkumar Manoharan, Sven Eckelmann, Sriram R, linux-wireless,
ath11k, linux-kernel
Cc: stable
The service-ready parser indexes hardware mode capability TLVs using the
full structure stride and reads their PHY maps without validating the
firmware-declared payload length. A short TLV can therefore cause an
out-of-bounds read.
Add a minimum-length policy for hardware mode capability TLVs.
Fixes: d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices")
Cc: stable@vger.kernel.org
Signed-off-by: Jiale Yao <yaojiale02@163.com>
---
drivers/net/wireless/ath/ath11k/wmi.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/wireless/ath/ath11k/wmi.c b/drivers/net/wireless/ath/ath11k/wmi.c
index 0d4481a09501..8a73318704f3 100644
--- a/drivers/net/wireless/ath/ath11k/wmi.c
+++ b/drivers/net/wireless/ath/ath11k/wmi.c
@@ -165,6 +165,8 @@ static const struct wmi_tlv_policy wmi_tlv_policies[] = {
.min_len = sizeof(struct wmi_dma_buf_release_entry) - TLV_HDR_SIZE },
[WMI_TAG_DMA_BUF_RELEASE_SPECTRAL_META_DATA] = {
.min_len = sizeof(struct wmi_dma_buf_release_meta_data) - TLV_HDR_SIZE },
+ [WMI_TAG_HW_MODE_CAPABILITIES] = {
+ .min_len = sizeof(struct wmi_hw_mode_capabilities) - TLV_HDR_SIZE },
};
#define PRIMAP(_hw_mode_) \
--
2.34.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 3/5] wifi: ath11k: validate DMA ring capability TLVs
2026-10-28 5:12 [PATCH 0/5] wifi: ath11k/ath12k: validate capability TLV lengths Jiale Yao
2026-10-28 5:12 ` [PATCH 1/5] wifi: ath11k: validate DMA buffer release " Jiale Yao
2026-10-28 5:12 ` [PATCH 2/5] wifi: ath11k: validate hardware mode capability TLVs Jiale Yao
@ 2026-10-28 5:12 ` Jiale Yao
2026-10-28 5:12 ` [PATCH 4/5] wifi: ath12k: validate DMA buffer release fixed TLV length Jiale Yao
2026-10-28 5:12 ` [PATCH 5/5] wifi: ath12k: validate service-ready capability TLV lengths Jiale Yao
4 siblings, 0 replies; 6+ messages in thread
From: Jiale Yao @ 2026-10-28 5:12 UTC (permalink / raw)
To: Jeff Johnson, Karthikeyan Periyasamy, Kalle Valo, linux-wireless,
ath11k, linux-kernel
Cc: stable
The service-ready parser counts DMA ring capability TLVs and later
indexes the firmware array using the full structure stride. It does not
validate that each TLV payload covers that structure, so a short element
can cause out-of-bounds reads.
Add a minimum-length policy for DMA ring capability TLVs.
Fixes: bd6478559e27 ("ath11k: Add direct buffer ring support")
Cc: stable@vger.kernel.org
Signed-off-by: Jiale Yao <yaojiale02@163.com>
---
drivers/net/wireless/ath/ath11k/wmi.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/wireless/ath/ath11k/wmi.c b/drivers/net/wireless/ath/ath11k/wmi.c
index 8a73318704f3..c5c667828530 100644
--- a/drivers/net/wireless/ath/ath11k/wmi.c
+++ b/drivers/net/wireless/ath/ath11k/wmi.c
@@ -167,6 +167,8 @@ static const struct wmi_tlv_policy wmi_tlv_policies[] = {
.min_len = sizeof(struct wmi_dma_buf_release_meta_data) - TLV_HDR_SIZE },
[WMI_TAG_HW_MODE_CAPABILITIES] = {
.min_len = sizeof(struct wmi_hw_mode_capabilities) - TLV_HDR_SIZE },
+ [WMI_TAG_DMA_RING_CAPABILITIES] = {
+ .min_len = sizeof(struct wmi_dma_ring_capabilities) - TLV_HDR_SIZE },
};
#define PRIMAP(_hw_mode_) \
--
2.34.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 4/5] wifi: ath12k: validate DMA buffer release fixed TLV length
2026-10-28 5:12 [PATCH 0/5] wifi: ath11k/ath12k: validate capability TLV lengths Jiale Yao
` (2 preceding siblings ...)
2026-10-28 5:12 ` [PATCH 3/5] wifi: ath11k: validate DMA ring " Jiale Yao
@ 2026-10-28 5:12 ` Jiale Yao
2026-10-28 5:12 ` [PATCH 5/5] wifi: ath12k: validate service-ready capability TLV lengths Jiale Yao
4 siblings, 0 replies; 6+ messages in thread
From: Jiale Yao @ 2026-10-28 5:12 UTC (permalink / raw)
To: Jeff Johnson, Karthikeyan Periyasamy, Balamurugan Selvarajan,
Carl Huang, Kalle Valo, Pradeep Kumar Chitrapu, linux-wireless,
ath12k, linux-kernel
Cc: stable
The DMA buffer release parser copies the fixed parameters from a
firmware TLV without checking that its payload contains the complete
structure. A short TLV can therefore make the structure copy read past
the declared payload.
Add a minimum-length policy for the fixed DMA buffer release TLV.
Fixes: d889913205cf ("wifi: ath12k: driver for Qualcomm Wi-Fi 7 devices")
Cc: stable@vger.kernel.org
Signed-off-by: Jiale Yao <yaojiale02@163.com>
---
drivers/net/wireless/ath/ath12k/wmi.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/wireless/ath/ath12k/wmi.c b/drivers/net/wireless/ath/ath12k/wmi.c
index 75b259990c79..ea7771a2eea9 100644
--- a/drivers/net/wireless/ath/ath12k/wmi.c
+++ b/drivers/net/wireless/ath/ath12k/wmi.c
@@ -209,6 +209,8 @@ static const struct ath12k_wmi_tlv_policy ath12k_wmi_tlv_policies[] = {
.min_len = sizeof(struct wmi_obss_color_collision_event) },
[WMI_TAG_PDEV_CSA_SWITCH_COUNT_STATUS_EVENT] = {
.min_len = sizeof(struct ath12k_wmi_pdev_csa_event) },
+ [WMI_TAG_DMA_BUF_RELEASE] = {
+ .min_len = sizeof(struct ath12k_wmi_dma_buf_release_fixed_params) },
};
__le32 ath12k_wmi_tlv_hdr(u32 cmd, u32 len)
--
2.34.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 5/5] wifi: ath12k: validate service-ready capability TLV lengths
2026-10-28 5:12 [PATCH 0/5] wifi: ath11k/ath12k: validate capability TLV lengths Jiale Yao
` (3 preceding siblings ...)
2026-10-28 5:12 ` [PATCH 4/5] wifi: ath12k: validate DMA buffer release fixed TLV length Jiale Yao
@ 2026-10-28 5:12 ` Jiale Yao
4 siblings, 0 replies; 6+ messages in thread
From: Jiale Yao @ 2026-10-28 5:12 UTC (permalink / raw)
To: Jeff Johnson, Wen Gong, Pradeep Kumar Chitrapu, Sriram R,
Vasanthakumar Thiagarajan, Kalle Valo, Aloka Dixit,
linux-wireless, ath12k, linux-kernel
Cc: stable
The service-ready parsers consume hardware mode, DMA ring, and extended
MAC/PHY capability TLVs as complete structures without validating their
firmware-declared payload lengths. Short TLVs can therefore cause
out-of-bounds reads while the capability arrays are parsed.
Add minimum-length policies for all three capability TLV types.
Fixes: d889913205cf ("wifi: ath12k: driver for Qualcomm Wi-Fi 7 devices")
Fixes: 1476014fadb6 ("wifi: ath12k: WMI support to process EHT capabilities")
Cc: stable@vger.kernel.org
Signed-off-by: Jiale Yao <yaojiale02@163.com>
---
drivers/net/wireless/ath/ath12k/wmi.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/net/wireless/ath/ath12k/wmi.c b/drivers/net/wireless/ath/ath12k/wmi.c
index ea7771a2eea9..730dde686626 100644
--- a/drivers/net/wireless/ath/ath12k/wmi.c
+++ b/drivers/net/wireless/ath/ath12k/wmi.c
@@ -211,6 +211,12 @@ static const struct ath12k_wmi_tlv_policy ath12k_wmi_tlv_policies[] = {
.min_len = sizeof(struct ath12k_wmi_pdev_csa_event) },
[WMI_TAG_DMA_BUF_RELEASE] = {
.min_len = sizeof(struct ath12k_wmi_dma_buf_release_fixed_params) },
+ [WMI_TAG_HW_MODE_CAPABILITIES] = {
+ .min_len = sizeof(struct ath12k_wmi_hw_mode_cap_params) - TLV_HDR_SIZE },
+ [WMI_TAG_DMA_RING_CAPABILITIES] = {
+ .min_len = sizeof(struct ath12k_wmi_dma_ring_caps_params) - TLV_HDR_SIZE },
+ [WMI_TAG_MAC_PHY_CAPABILITIES_EXT] = {
+ .min_len = sizeof(struct ath12k_wmi_caps_ext_params) },
};
__le32 ath12k_wmi_tlv_hdr(u32 cmd, u32 len)
--
2.34.1
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-10-28 5:13 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-28 5:12 [PATCH 0/5] wifi: ath11k/ath12k: validate capability TLV lengths Jiale Yao
2026-10-28 5:12 ` [PATCH 1/5] wifi: ath11k: validate DMA buffer release " Jiale Yao
2026-10-28 5:12 ` [PATCH 2/5] wifi: ath11k: validate hardware mode capability TLVs Jiale Yao
2026-10-28 5:12 ` [PATCH 3/5] wifi: ath11k: validate DMA ring " Jiale Yao
2026-10-28 5:12 ` [PATCH 4/5] wifi: ath12k: validate DMA buffer release fixed TLV length Jiale Yao
2026-10-28 5:12 ` [PATCH 5/5] wifi: ath12k: validate service-ready capability TLV lengths Jiale Yao
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®