Re: [PATCH v6 1/5] staging: rtl8723bs: fix potential out-of-bounds read in rtw_restruct_wmm_ie

From: Greg Kroah-Hartman

Date: Sat Feb 07 2026 - 08:07:57 EST


On Fri, Jan 30, 2026 at 07:56:54PM +0100, Luka Gejak wrote:
> The current code checks 'i + 5 < in_len' at the end of the if statement.
> However, it accesses 'in_ie[i + 5]' before that check, which can lead
> to an out-of-bounds read. Move the length check to the beginning of the
> conditional to ensure the index is within bounds before accessing the
> array.
>
> Fixes: 554c0a3abf21 ("staging: Add rtl8723bs sdio wifi driver")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Luka Gejak <lukagejak5@xxxxxxxxx>
> ---
> drivers/staging/rtl8723bs/core/rtw_mlme.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)

Nit, you have an exta ' ' in the subject line :(

I'll take it, just be more careful next time please.

thanks,

greg k-h