From: Jiale Yao <yaojiale02@163.com>
To: Jeff Johnson <jjohnson@kernel.org>,
Sathishkumar Muruganandam <quic_murugana@quicinc.com>,
Anilkumar Kolli <quic_akolli@quicinc.com>,
kbuild test robot <lkp@intel.com>,
Karthikeyan Periyasamy <quic_periyasa@quicinc.com>,
Venkateswara Naralasetty <quic_vnaralas@quicinc.com>,
linux-wireless@vger.kernel.org, ath11k@lists.infradead.org,
linux-kernel@vger.kernel.org
Cc: Jiale Yao <jiale.yao@example.com>
Subject: [PATCH 1/4] wifi: ath11k: validate extended regulatory capability count
Date: Mon, 19 Oct 2026 18:00:26 +0800 [thread overview]
Message-ID: <20261019100029.1908660-2-yaojiale02@163.com> (raw)
In-Reply-To: <20261019100029.1908660-1-yaojiale02@163.com>
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
next prev parent reply other threads:[~2026-10-19 10:01 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-19 10:00 [PATCH 0/4] wifi: ath11k/ath12k: validate firmware array lengths Jiale Yao
2026-10-19 10:00 ` Jiale Yao [this message]
2026-10-19 10:00 ` [PATCH 2/4] wifi: ath12k: validate extended regulatory capability count 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261019100029.1908660-2-yaojiale02@163.com \
--to=yaojiale02@163.com \
--cc=ath11k@lists.infradead.org \
--cc=jiale.yao@example.com \
--cc=jjohnson@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=lkp@intel.com \
--cc=quic_akolli@quicinc.com \
--cc=quic_murugana@quicinc.com \
--cc=quic_periyasa@quicinc.com \
--cc=quic_vnaralas@quicinc.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®