* [PATCH 0/4] wifi: ath11k/ath12k: validate firmware array lengths
@ 2026-10-19 10:00 Jiale Yao
2026-10-19 10:00 ` [PATCH 1/4] wifi: ath11k: validate extended regulatory capability count Jiale Yao
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Jiale Yao @ 2026-10-19 10:00 UTC (permalink / raw)
To: Jeff Johnson, Manikanta Pubbisetty, Sathishkumar Muruganandam,
Anilkumar Kolli, John Crispin, Kalle Valo, P Praneesh,
Balamurugan Selvarajan, Karthikeyan Periyasamy,
Vasanthakumar Thiagarajan, linux-wireless, ath11k, linux-kernel,
ath12k
Cc: Jiale Yao
From: Jiale Yao <jiale.yao@example.com>
ath11k and ath12k consume two firmware-provided arrays without fully
validating their lengths. The service-ready-ext parser accepts fewer
extended regulatory capability entries than the separately reported PHY
count, while the ready-event parser trusts the reported extra MAC address
count without checking the fixed-structure array length.
Malformed firmware data can therefore make both drivers read beyond the
corresponding TLV arrays. Add matching validation to each driver before
the arrays are indexed.
The four patches are independent and each addresses one parsing path in
one driver.
Jiale Yao (4):
wifi: ath11k: validate extended regulatory capability count
wifi: ath12k: validate extended regulatory capability count
wifi: ath11k: validate ready event MAC address array length
wifi: ath12k: validate ready event MAC address array length
drivers/net/wireless/ath/ath11k/wmi.c | 10 ++++++++++
drivers/net/wireless/ath/ath12k/wmi.c | 10 ++++++++++
2 files changed, 20 insertions(+)
--
2.34.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/4] wifi: ath11k: validate extended regulatory capability count
2026-10-19 10:00 [PATCH 0/4] wifi: ath11k/ath12k: validate firmware array lengths Jiale Yao
@ 2026-10-19 10:00 ` Jiale Yao
2026-10-19 10:00 ` [PATCH 2/4] wifi: ath12k: " Jiale Yao
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Jiale Yao @ 2026-10-19 10:00 UTC (permalink / raw)
To: Jeff Johnson, Sathishkumar Muruganandam, Anilkumar Kolli,
kbuild test robot, Karthikeyan Periyasamy,
Venkateswara Naralasetty, linux-wireless, ath11k, linux-kernel
Cc: Jiale Yao
From: Jiale Yao <jiale.yao@example.com>
Firmware reports the number of PHYs separately from the array of
extended regulatory capabilities. The TLV parser rejects excess array
entries, but accepts an array with fewer entries than the reported PHY
count. The subsequent loop uses the reported count and reads beyond the
supplied array.
Reject mismatched counts before indexing the capability array.
Fixes: d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices")
Signed-off-by: Jiale Yao <jiale.yao@example.com>
---
drivers/net/wireless/ath/ath11k/wmi.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/net/wireless/ath/ath11k/wmi.c b/drivers/net/wireless/ath/ath11k/wmi.c
index bbca275a8289..995fee2ffdfa 100644
--- a/drivers/net/wireless/ath/ath11k/wmi.c
+++ b/drivers/net/wireless/ath/ath11k/wmi.c
@@ -4859,6 +4859,13 @@ static int ath11k_wmi_tlv_ext_hal_reg_caps(struct ath11k_base *soc,
return ret;
}
+ if (svc_rdy_ext->n_ext_hal_reg_caps != svc_rdy_ext->param.num_phy) {
+ ath11k_warn(soc, "invalid number of reg caps %u, expected %u\n",
+ svc_rdy_ext->n_ext_hal_reg_caps,
+ svc_rdy_ext->param.num_phy);
+ return -EINVAL;
+ }
+
for (i = 0; i < svc_rdy_ext->param.num_phy; i++) {
ret = ath11k_pull_reg_cap_svc_rdy_ext(wmi_handle,
svc_rdy_ext->soc_hal_reg_caps,
--
2.34.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 2/4] wifi: ath12k: validate extended regulatory capability count
2026-10-19 10:00 [PATCH 0/4] wifi: ath11k/ath12k: validate firmware array lengths Jiale Yao
2026-10-19 10:00 ` [PATCH 1/4] wifi: ath11k: validate extended regulatory capability count Jiale Yao
@ 2026-10-19 10:00 ` Jiale Yao
2026-10-19 10:00 ` [PATCH 3/4] wifi: ath11k: validate ready event MAC address array length Jiale Yao
2026-10-19 10:00 ` [PATCH 4/4] wifi: ath12k: " Jiale Yao
3 siblings, 0 replies; 6+ messages in thread
From: Jiale Yao @ 2026-10-19 10:00 UTC (permalink / raw)
To: Jeff Johnson, Baochen Qiang, Kalle Valo, Bhagavathi Perumal S,
Pradeep Kumar Chitrapu, Carl Huang, linux-wireless, ath12k,
linux-kernel
Cc: Jiale Yao
From: Jiale Yao <jiale.yao@example.com>
Firmware reports the number of PHYs separately from the array of
extended regulatory capabilities. The TLV parser rejects excess array
entries, but accepts an array with fewer entries than the reported PHY
count. The subsequent loop uses the reported count and reads beyond the
supplied array.
Reject mismatched counts before indexing the capability array.
Fixes: d889913205cf ("wifi: ath12k: driver for Qualcomm Wi-Fi 7 devices")
Signed-off-by: Jiale Yao <jiale.yao@example.com>
---
drivers/net/wireless/ath/ath12k/wmi.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/net/wireless/ath/ath12k/wmi.c b/drivers/net/wireless/ath/ath12k/wmi.c
index d5160af60e00..66e39672dcda 100644
--- a/drivers/net/wireless/ath/ath12k/wmi.c
+++ b/drivers/net/wireless/ath/ath12k/wmi.c
@@ -4824,6 +4824,13 @@ static int ath12k_wmi_ext_hal_reg_caps(struct ath12k_base *soc,
return ret;
}
+ if (svc_rdy_ext->n_ext_hal_reg_caps != svc_rdy_ext->arg.num_phy) {
+ ath12k_warn(soc, "invalid number of reg caps %u, expected %u\n",
+ svc_rdy_ext->n_ext_hal_reg_caps,
+ svc_rdy_ext->arg.num_phy);
+ return -EINVAL;
+ }
+
for (i = 0; i < svc_rdy_ext->arg.num_phy; i++) {
ret = ath12k_pull_reg_cap_svc_rdy_ext(wmi_handle,
svc_rdy_ext->soc_hal_reg_caps,
--
2.34.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 3/4] wifi: ath11k: validate ready event MAC address array length
2026-10-19 10:00 [PATCH 0/4] wifi: ath11k/ath12k: validate firmware array lengths Jiale Yao
2026-10-19 10:00 ` [PATCH 1/4] wifi: ath11k: validate extended regulatory capability count Jiale Yao
2026-10-19 10:00 ` [PATCH 2/4] wifi: ath12k: " Jiale Yao
@ 2026-10-19 10:00 ` Jiale Yao
2026-10-19 10:00 ` [PATCH 4/4] wifi: ath12k: " Jiale Yao
3 siblings, 0 replies; 6+ messages in thread
From: Jiale Yao @ 2026-10-19 10:00 UTC (permalink / raw)
To: Jeff Johnson, Maharaja Kennadyrajan, Sriram R, Anilkumar Kolli,
Ganesh Sesetti, Julia Lawall, linux-wireless, ath11k,
linux-kernel
Cc: Jiale Yao
From: Jiale Yao <jiale.yao@example.com>
The ready event reports the number of extra MAC addresses separately
from the fixed-structure address array. ath11k checks the reported
count before assigning addresses to radios, but does not check the
length of the array TLV. A truncated array therefore causes reads past
the supplied event data.
Validate the array capacity before copying any addresses.
Fixes: d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices")
Signed-off-by: Jiale Yao <jiale.yao@example.com>
---
drivers/net/wireless/ath/ath11k/wmi.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/wireless/ath/ath11k/wmi.c b/drivers/net/wireless/ath/ath11k/wmi.c
index 995fee2ffdfa..9a048c7d9858 100644
--- a/drivers/net/wireless/ath/ath11k/wmi.c
+++ b/drivers/net/wireless/ath/ath11k/wmi.c
@@ -7328,6 +7328,9 @@ static int ath11k_wmi_tlv_rdy_parse(struct ath11k_base *ab, u16 tag, u16 len,
if (!(ab->num_radios > 1 && num_mac_addr >= ab->num_radios))
break;
+ if (len / sizeof(*addr_list) < ab->num_radios)
+ return -EINVAL;
+
for (i = 0; i < ab->num_radios; i++) {
pdev = &ab->pdevs[i];
ether_addr_copy(pdev->mac_addr, addr_list[i].addr);
--
2.34.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 4/4] wifi: ath12k: validate ready event MAC address array length
2026-10-19 10:00 [PATCH 0/4] wifi: ath11k/ath12k: validate firmware array lengths Jiale Yao
` (2 preceding siblings ...)
2026-10-19 10:00 ` [PATCH 3/4] wifi: ath11k: validate ready event MAC address array length Jiale Yao
@ 2026-10-19 10:00 ` Jiale Yao
3 siblings, 0 replies; 6+ messages in thread
From: Jiale Yao @ 2026-10-19 10:00 UTC (permalink / raw)
To: Jeff Johnson, Carl Huang, Kalle Valo, Bhagavathi Perumal S,
P Praneesh, Balamurugan Selvarajan, linux-wireless, ath12k,
linux-kernel
Cc: Jiale Yao
From: Jiale Yao <jiale.yao@example.com>
The ready event reports the number of extra MAC addresses separately
from the fixed-structure address array. ath12k checks the reported
count before assigning addresses to radios, but does not check the
length of the array TLV. A truncated array therefore causes reads past
the supplied event data.
Validate the array capacity before copying any addresses.
Fixes: d889913205cf ("wifi: ath12k: driver for Qualcomm Wi-Fi 7 devices")
Signed-off-by: Jiale Yao <jiale.yao@example.com>
---
drivers/net/wireless/ath/ath12k/wmi.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/wireless/ath/ath12k/wmi.c b/drivers/net/wireless/ath/ath12k/wmi.c
index 66e39672dcda..0ae366e8a944 100644
--- a/drivers/net/wireless/ath/ath12k/wmi.c
+++ b/drivers/net/wireless/ath/ath12k/wmi.c
@@ -7082,6 +7082,9 @@ static int ath12k_wmi_rdy_parse(struct ath12k_base *ab, u16 tag, u16 len,
if (!(ab->num_radios > 1 && num_mac_addr >= ab->num_radios))
break;
+ if (len / sizeof(*addr_list) < ab->num_radios)
+ return -EINVAL;
+
for (i = 0; i < ab->num_radios; i++) {
pdev = &ab->pdevs[i];
ether_addr_copy(pdev->mac_addr, addr_list[i].addr);
--
2.34.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/4] wifi: ath11k: validate extended regulatory capability count
2026-10-19 10:05 [PATCH 0/4] wifi: ath11k/ath12k: validate firmware array lengths Jiale Yao
@ 2026-10-19 10:05 ` Jiale Yao
0 siblings, 0 replies; 6+ messages in thread
From: Jiale Yao @ 2026-10-19 10:05 UTC (permalink / raw)
To: Jeff Johnson, Miles Hu, John Crispin, Vasanthakumar Thiagarajan,
Sathishkumar Muruganandam, Venkateswara Naralasetty,
linux-wireless, ath11k, linux-kernel
Cc: Jiale Yao
Firmware reports the number of PHYs separately from the array of
extended regulatory capabilities. The TLV parser rejects excess array
entries, but accepts an array with fewer entries than the reported PHY
count. The subsequent loop uses the reported count and reads beyond the
supplied array.
Reject mismatched counts before indexing the capability array.
Fixes: d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices")
Signed-off-by: Jiale Yao <yaojiale02@163.com>
---
drivers/net/wireless/ath/ath11k/wmi.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/net/wireless/ath/ath11k/wmi.c b/drivers/net/wireless/ath/ath11k/wmi.c
index bbca275a8289..995fee2ffdfa 100644
--- a/drivers/net/wireless/ath/ath11k/wmi.c
+++ b/drivers/net/wireless/ath/ath11k/wmi.c
@@ -4859,6 +4859,13 @@ static int ath11k_wmi_tlv_ext_hal_reg_caps(struct ath11k_base *soc,
return ret;
}
+ if (svc_rdy_ext->n_ext_hal_reg_caps != svc_rdy_ext->param.num_phy) {
+ ath11k_warn(soc, "invalid number of reg caps %u, expected %u\n",
+ svc_rdy_ext->n_ext_hal_reg_caps,
+ svc_rdy_ext->param.num_phy);
+ return -EINVAL;
+ }
+
for (i = 0; i < svc_rdy_ext->param.num_phy; i++) {
ret = ath11k_pull_reg_cap_svc_rdy_ext(wmi_handle,
svc_rdy_ext->soc_hal_reg_caps,
--
2.34.1
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-10-19 10:05 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-19 10:00 [PATCH 0/4] wifi: ath11k/ath12k: validate firmware array lengths Jiale Yao
2026-10-19 10:00 ` [PATCH 1/4] wifi: ath11k: validate extended regulatory capability count Jiale Yao
2026-10-19 10:00 ` [PATCH 2/4] wifi: ath12k: " Jiale Yao
2026-10-19 10:00 ` [PATCH 3/4] wifi: ath11k: validate ready event MAC address array length Jiale Yao
2026-10-19 10:00 ` [PATCH 4/4] wifi: ath12k: " Jiale Yao
2026-10-19 10:05 [PATCH 0/4] wifi: ath11k/ath12k: validate firmware array lengths Jiale Yao
2026-10-19 10:05 ` [PATCH 1/4] wifi: ath11k: validate extended regulatory capability count 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®