From: Ping-Ke Shih <pkshih@realtek.com>
To: Tristan Madani <tristmd@gmail.com>
Cc: "linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Tristan Madani <tristan@talencesecurity.com>,
"stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: RE: [PATCH wireless] wifi: rtlwifi: fix OOB reads in IE parsing functions
Date: Mon, 7 Sep 2026 04:22:04 +0000 [thread overview]
Message-ID: <2bcd6795858e4796b4c5be09a667ad2c@realtek.com> (raw)
In-Reply-To: <20260904084940.3885379-1-tristmd@gmail.com>
Tristan Madani <tristmd@gmail.com> wrote:
[...]
> @@ -2597,17 +2597,17 @@ static bool rtl_find_221_ie(struct ieee80211_hw *hw, u8 *data,
>
> pos = (u8 *)mgmt->u.beacon.variable;
> end = data + len;
> - while (pos < end) {
> - if (pos[0] == 221) {
> + while (pos + 2 <= end) {
> + if (pos + 2 + pos[1] > end)
> + return false;
> +
> + if (pos[0] == 221 && pos[1] >= 3) {
I think the 3 is because length of OUI is 3 used by rtl_chk_vendor_ouisub().
Please leave a comment for that reason.
> vendor_ie.length = pos[1];
> vendor_ie.octet = &pos[2];
> if (rtl_chk_vendor_ouisub(hw, vendor_ie))
> return true;
> }
>
> - if (pos + 2 + pos[1] > end)
> - return false;
> -
> pos += 2 + pos[1];
> }
> return false;
> --
> 2.47.3
prev parent reply other threads:[~2026-09-07 4:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-04 8:49 [PATCH wireless] wifi: rtlwifi: fix OOB reads in IE parsing functions Tristan Madani
2026-09-07 4:22 ` Ping-Ke Shih [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=2bcd6795858e4796b4c5be09a667ad2c@realtek.com \
--to=pkshih@realtek.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=tristan@talencesecurity.com \
--cc=tristmd@gmail.com \
/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