Re: [PATCH v2] staging: rtl8723bs: initialize le_tmp64 in rtw_BIP_verify()
From: YuChen Lin
Date: Mon Mar 23 2026 - 06:46:04 EST
On Sat, Mar 21, 2026 at 3:58 PM Dan Carpenter <dan.carpenter@xxxxxxxxxx> wrote:
>
> On Fri, Mar 20, 2026 at 06:29:13PM +0100, Greg KH wrote:
> > ...
>
> These days, everyone sane zeroes their stack variables, but this driver
> is older than the zeroing code so it's a puzzling thing.
>
> I could imagine a couple different ways that the code might be able to
> work even with uninitialized data... It wouldn't surprise me if the
> check for:
>
> /* BIP packet number should bigger than previous BIP packet */
>
> is some kind of work around for bug?
Hi Greg and Dan,
Thanks for the comments.
I do not have the physical RTL8723BS hardware to perform runtime tests.
Therefore, I cannot confirm if the code currently "works" due to a zeroed
stack, a specific workaround, or if it is silently failing in ways users
haven't reported yet.
Regardless of why it might appear to work now, the current state relies
on uninitialized stack data, which introduces non-deterministic behavior.
Initializing the variable to zero is a reasonable and defensive fix. It
ensures the IPN calculation is predictable and correctly represents the
6-byte value from the MMIE, as identified by Smatch.
I believe this is a safe improvement to ensure the long-term stability
of the driver.
Regards,
Lin YuChen