From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Ali Ahmet Memis <ali@iusegentoo.com>
Cc: Hans de Goede <hansg@kernel.org>,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/2] staging: rtl8723bs: validate HT capability IE length before use
Date: Mon, 3 Aug 2026 07:51:04 +0200 [thread overview]
Message-ID: <2026080344-deacon-sequence-cb0a@gregkh> (raw)
In-Reply-To: <20260802153509.44263-2-ali@iusegentoo.com>
On Sun, Aug 02, 2026 at 03:35:08PM +0000, Ali Ahmet Memis wrote:
> Four sites locate the HT capability element with rtw_get_ie() and then
> read through it without checking that the element is long enough:
>
> p = rtw_get_ie(..., WLAN_EID_HT_CAPABILITY, &len, ...);
> if (p && len > 0) {
> pht_cap = (struct ieee80211_ht_cap *)(p + 2);
> ht_cap_info = le16_to_cpu(pht_cap->cap_info);
>
> rtw_get_ie() only bounds the element against the end of the IE buffer, so
> len is whatever the sender put in the length byte. A beacon or probe
> response carrying a one byte HT capability element passes len > 0 and the
> driver then reads two bytes of cap_info, and in rtw_update_ht_cap() the
> ampdu_params_info byte after that, from beyond the element.
>
> An HT capability element is a fixed 26 bytes, so require that much before
> dereferencing it. The frames come from the air, so the length is not
> under local control.
>
> Signed-off-by: Ali Ahmet Memis <ali@iusegentoo.com>
> ---
> drivers/staging/rtl8723bs/core/rtw_ieee80211.c | 2 +-
> drivers/staging/rtl8723bs/core/rtw_mlme.c | 2 +-
> drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 2 +-
> drivers/staging/rtl8723bs/core/rtw_wlan_util.c | 2 +-
> 4 files changed, 4 insertions(+), 4 deletions(-)
What tool did you use to find and fix these and how were they tested?
thanks,
greg k-h
next prev parent reply other threads:[~2026-08-03 5:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-02 15:35 [PATCH v2 0/2] staging: rtl8723bs: bound two IE parses Ali Ahmet Memis
2026-08-02 15:35 ` [PATCH v2 1/2] staging: rtl8723bs: validate HT capability IE length before use Ali Ahmet Memis
2026-08-03 5:51 ` Greg Kroah-Hartman [this message]
2026-08-02 15:35 ` [PATCH v2 2/2] staging: rtl8723bs: bound the SSID element length before copying it Ali Ahmet Memis
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=2026080344-deacon-sequence-cb0a@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=ali@iusegentoo.com \
--cc=hansg@kernel.org \
--cc=linux-kernel@vger.kernel.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