From: Ali Ahmet Memis <ali@iusegentoo.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Hans de Goede <hansg@kernel.org>,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: rtl8723bs: validate HT capability IE length before use
Date: Sun, 2 Aug 2026 15:19:16 +0000 [thread overview]
Message-ID: <20260802151916.38931-1-ali@iusegentoo.com> (raw)
In-Reply-To: <20260802121354.14245-1-ali@iusegentoo.com>
Please drop this one. Four of the five hunks are right, the first one is
not, and it is a regression rather than a fix.
The rtw_ap.c hunk is not an HT capability site at all:
p = rtw_get_ie(ie + _BEACON_IE_OFFSET_,
WLAN_EID_SSID,
&ie_len,
(pbss_network->ie_length - _BEACON_IE_OFFSET_));
if (p && ie_len >= sizeof(struct ieee80211_ht_cap)) {
memcpy(pbss_network->ssid.ssid, (p + 2), ie_len);
That is the SSID, and I put an HT capability sized lower bound on it.
sizeof(struct ieee80211_ht_cap) is 26, SSIDs are 0 to 32 bytes, so every
SSID shorter than 26 characters now fails the test and the copy and the
ssid_length assignment are skipped. rtw_check_beacon_data() is the AP
setup path, so this breaks bringing up an AP with an ordinary SSID. I
should have checked which element each site fetches instead of assuming
all five were the same.
While looking at it, the check that site actually needs is the opposite
bound. rtw_get_ie() writes the raw IE length byte to *len and only limits
it against the remaining buffer:
tmp = *(p + 1);
if (i + 2 + tmp > limit)
break;
if (*p == index) {
*len = tmp;
so ie_len can be up to 255, while the destination is
struct ndis_802_11_ssid {
u32 ssid_length;
u8 ssid[32];
};
and rtw_check_beacon_data() validates nothing but len <= MAX_IE_SZ before
that memcpy. An SSID element longer than 32 bytes overruns ssid[] inside
pmlmepriv->cur_network.network. It comes in through cfg80211 start_ap and
change_beacon, so it needs CAP_NET_ADMIN and a beacon that hostapd would
not normally build, but the bound is missing.
I will send a v2 with only the four HT capability sites, and the SSID
length check separately, since it is a different bug in the other
direction.
Sorry for the noise.
--
Ali
prev parent reply other threads:[~2026-08-02 15:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-02 12:13 [PATCH] staging: rtl8723bs: validate HT capability IE length before use Ali Ahmet Memis
2026-08-02 15:19 ` Ali Ahmet Memis [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=20260802151916.38931-1-ali@iusegentoo.com \
--to=ali@iusegentoo.com \
--cc=gregkh@linuxfoundation.org \
--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