From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Navaneeth K <knavaneeth786@gmail.com>
Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
stable <stable@kernel.org>
Subject: Re: [PATCH] staging: rtl8723bs: properly validate the data in rtw_get_ie_ex()
Date: Mon, 23 Feb 2026 16:29:51 +0100 [thread overview]
Message-ID: <2026022356-borrower-poise-80a9@gregkh> (raw)
In-Reply-To: <4fa1f4f6-3abe-4acf-938d-abc49a14b6aa@gmail.com>
On Mon, Feb 23, 2026 at 08:53:54PM +0530, Navaneeth K wrote:
> I don't have the physical RTL8723BS hardware on hand anymore to test a live
> connection, but I was able to verify your logic thoroughly in user-space.
> To be absolutely sure, I extracted both the old and patched functions into a
> standalone C harness and ran them through Asan and AFL++.
> Feeding a crafted 5-byte allocation(with a lying length byte) to the old
> code predictably triggered a 47-byte heap-buffer-overflow right at the
> memcpy.
> Against your patched code, I ran that same payload along with 20 other
> edge-case tests (1-byte buffers, empty bodies, OUI boundary mismatches,
> etc.). It cleanly rejected all of them with zero ASan errors.
> I also compiled the patched function as an AFL++ target and let it freely
> mutate the EID, length, and body bytes. After over 100,000 executions, it
> reported 0 crashes and 0 hangs.
> The logic is definitely solid. Changing the loop guard to "while (cnt + 2 <=
> in_len)" guarantees we always have at least 2 bytes before we touch the EID
> and length. Reading ie_len once and explicitly checking if it exceeds in_len
> completely stops the memcpy from reading past the end of the allocation.
>
> I have the raw ASan logs, AFL stats, and the C test harnesses saved if
> needed!.
>
> Tested-by: Navaneeth K <knavaneeth786@gmail.com>
> Reviewed-by: Navaneeth K <knavaneeth786@gmail.com>
Wow, that's way more than I expected, thank you! Raw logs and test
harness is not needed, I'll trust you, worst case, we revert it if
someone complains it breaks their device :)
thanks,
greg k-h
prev parent reply other threads:[~2026-02-23 15:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-23 13:31 [PATCH] staging: rtl8723bs: properly validate the data in rtw_get_ie_ex() Greg Kroah-Hartman
2026-02-23 15:23 ` Navaneeth K
2026-02-23 15:29 ` Greg Kroah-Hartman [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=2026022356-borrower-poise-80a9@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=knavaneeth786@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=stable@kernel.org \
/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