From: Tristan Madani <tristmd@gmail.com>
To: Jeff Chen <jeff.chen_1@nxp.com>
Cc: Francesco Dolcini <francesco@dolcini.it>,
Johannes Berg <johannes@sipsolutions.net>,
linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
Tristan Madani <tristan@talencesecurity.com>,
stable@vger.kernel.org
Subject: [PATCH wireless 1/3] wifi: nxpwifi: validate HE capability TLV length in firmware response
Date: Mon, 2 Nov 2026 12:48:52 +0000 [thread overview]
Message-ID: <20261102124854.325979-2-tristmd@gmail.com> (raw)
In-Reply-To: <20261102124854.325979-1-tristmd@gmail.com>
From: Tristan Madani <tristan@talencesecurity.com>
nxpwifi_ret_11ax_cfg() parses TLV data from firmware without checking
that each TLV's declared length fits within the remaining buffer. A
firmware response with an oversized TLV length causes reads past the
response buffer.
Add a bounds check that the TLV header plus its declared length does
not exceed the remaining data before processing the TLV contents.
Fixes: 73b01e57ed3e ("wifi: nxp: add nxpwifi driver for IW61x")
Cc: stable@vger.kernel.org
Signed-off-by: Tristan Madani <tristan@talencesecurity.com>
---
drivers/net/wireless/nxp/nxpwifi/11ax.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/wireless/nxp/nxpwifi/11ax.c b/drivers/net/wireless/nxp/nxpwifi/11ax.c
index dc1e747383eca..1006b4a84de73 100644
--- a/drivers/net/wireless/nxp/nxpwifi/11ax.c
+++ b/drivers/net/wireless/nxp/nxpwifi/11ax.c
@@ -215,6 +215,9 @@ int nxpwifi_ret_11ax_cfg(struct nxpwifi_private *priv,
tlv_type = le16_to_cpu(header->type);
tlv_len = le16_to_cpu(header->len);
+ if (sizeof(*header) + tlv_len > left_len)
+ break;
+
if (tlv_type == TLV_TYPE_EXTENSION_ID) {
ext_id = *((u8 *)header + sizeof(*header) + 1);
if (ext_id == WLAN_EID_EXT_HE_CAPABILITY) {
--
2.47.3
next prev parent reply other threads:[~2026-11-02 12:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-02 12:48 [PATCH wireless 0/3] wifi: nxpwifi: validate firmware response sizes Tristan Madani
2026-11-02 12:48 ` Tristan Madani [this message]
2026-11-02 12:48 ` [PATCH wireless 2/3] wifi: nxpwifi: validate ext_scan buf_size against event buffer length Tristan Madani
2026-11-02 12:48 ` [PATCH wireless 3/3] wifi: nxpwifi: validate command response size against " Tristan Madani
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=20261102124854.325979-2-tristmd@gmail.com \
--to=tristmd@gmail.com \
--cc=francesco@dolcini.it \
--cc=jeff.chen_1@nxp.com \
--cc=johannes@sipsolutions.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=tristan@talencesecurity.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®