From: Greg KH <gregkh@linuxfoundation.org>
To: Alexandru Hossu <hossu.alexandru@gmail.com>
Cc: linux-staging@lists.linux.dev, dan.carpenter@linuxfoundation.org
Subject: Re: staging: rtl8723bs: OOB write in HT_caps_handler() via attacker-controlled IE length
Date: Fri, 15 May 2026 12:35:24 +0200 [thread overview]
Message-ID: <2026051510-decode-numerate-6fcb@gregkh> (raw)
In-Reply-To: <6a06f581.0c99f0eb.149f9e.4214@mx.google.com>
On Fri, May 15, 2026 at 03:29:21AM -0700, Alexandru Hossu wrote:
> 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
Great, please send a fix!
thanks,
greg k-h
prev parent reply other threads:[~2026-05-15 10:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-15 10:29 staging: rtl8723bs: OOB write in HT_caps_handler() via attacker-controlled IE length Alexandru Hossu
2026-05-15 10:35 ` Greg KH [this message]
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=2026051510-decode-numerate-6fcb@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=dan.carpenter@linuxfoundation.org \
--cc=hossu.alexandru@gmail.com \
--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