From: Josef Schlehofer <pepe.schlehofer@gmail.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: linux-wireless@vger.kernel.org,
Dylan Eskew <dylan.eskew@candelatech.com>
Subject: [PATCH iw] iw: util: fix the EHT PHY capabilities buffer size
Date: Tue, 24 Nov 2026 22:14:30 +0100 [thread overview]
Message-ID: <20261124211430.93249-1-pepe.schlehofer@gmail.com> (raw)
print_eht_info() stores the EHT PHY capabilities in an 8-byte
buffer, but the kernel provides 9 bytes. __print_eht_capa()
prints all 9 bytes and accesses two bits of the ninth byte
through phy_cap[2]. Both accesses go past the end of the
buffer, and the ninth byte is lost when copying the attribute.
Increase the buffer size to accommodate all 9 bytes.
Fixes: 4c859917316b ("iw: util: update and clean up eht capa printing")
Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
---
Checked with an AddressSanitizer build that feeds print_eht_info() a 9-byte
EHT PHY attribute. Without the fix it reports a stack-buffer-overflow in
__print_eht_capa(), with it the ninth byte and both of its bits are printed.
util.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/util.c b/util.c
index 1bad4ea..1a35352 100644
--- a/util.c
+++ b/util.c
@@ -1769,7 +1769,7 @@ void print_eht_info(struct nlattr *nl_iftype, int band)
{
struct nlattr *tb[NL80211_BAND_IFTYPE_ATTR_MAX + 1];
__u8 mac_cap[2] = { 0 };
- __u32 phy_cap[2] = { 0 };
+ __u32 phy_cap[3] = { 0 };
__u8 mcs_set[13] = { 0 };
__u8 ppet[31] = { 0 };
__u16 he_phy_cap[6] = { 0 };
--
2.54.0 (Apple Git-157)
reply other threads:[~2026-11-24 21:14 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20261124211430.93249-1-pepe.schlehofer@gmail.com \
--to=pepe.schlehofer@gmail.com \
--cc=dylan.eskew@candelatech.com \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
/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