From: Alexandru Hossu <hossu.alexandru@gmail.com>
To: linux-staging@lists.linux.dev
Cc: gregkh@linuxfoundation.org, dan.carpenter@linuxfoundation.org
Subject: staging: rtl8723bs: OOB write in HT_caps_handler() via attacker-controlled IE length
Date: Fri, 15 May 2026 03:29:21 -0700 (PDT) [thread overview]
Message-ID: <6a06f581.0c99f0eb.149f9e.4214@mx.google.com> (raw)
Hi,
I found an out-of-bounds write in HT_caps_handler() in
drivers/staging/rtl8723bs/core/rtw_wlan_util.c.
At line 938-942:
for (i = 0; i < (pIE->length); i++) {
if (i != 2) {
pmlmeinfo->HT_caps.u.HT_cap[i] &= (pIE->data[i]);
HT_cap[] is 26 bytes (wifi.h:349). pIE->length comes from the
WLAN_EID_HT_CAPABILITY IE in an association response and can be up to 255.
The loop writes up to 229 bytes past the end of the array.
A rogue access point triggers this by sending an HT Capability IE with
length > 26 in the association response. No authentication is needed.
The write is AND-only so it can only clear bits in adjacent struct fields
(HT_info, wlan_bssid_ex). This causes state corruption and can crash the
driver. The RTL8723BS chip is in a large number of cheap laptops and IoT
devices.
Suggested fix:
u8 ht_cap_len = min_t(u8, pIE->length,
sizeof(pmlmeinfo->HT_caps.u.HT_cap));
for (i = 0; i < ht_cap_len; i++) {
Tested on linux-next commit e98d21c170b0 (2026-05-08).
Alexandru
next reply other threads:[~2026-05-15 10:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-15 10:29 Alexandru Hossu [this message]
2026-05-15 10:35 ` staging: rtl8723bs: OOB write in HT_caps_handler() via attacker-controlled IE length Greg KH
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=6a06f581.0c99f0eb.149f9e.4214@mx.google.com \
--to=hossu.alexandru@gmail.com \
--cc=dan.carpenter@linuxfoundation.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-staging@lists.linux.dev \
/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