Re: [PATCH 5.10] staging: rtl8723bs: fix OOB read in OnAssocRsp() IE loop

From: Luka Gejak

Date: Mon Oct 12 2026 - 10:50:17 EST


October 12, 2026 at 4:06 PM, "Mikhail Dmitrichenko" <mdmitrichenko@xxxxxxxxxxxxx> wrote:


>
> From: Alexandru Hossu <hossu.alexandru@xxxxxxxxx>
>
> commit f9654207e92283e0acac5d64fe5f8835383b5a23 upstream.
>
> The IE parsing loop in OnAssocRsp() advances by (pIE->length + 2) each
> iteration but only guards on i < pkt_len. When a malicious AP sends an
> AssocResponse whose last IE has only one byte remaining in the frame
> (the element_id byte lands at pkt_len-1), the loop reads pIE->length
> from pframe[pkt_len], which is one byte past the allocated receive buffer.
>
> Additionally, even when the header bytes are in bounds, pIE->length
> itself can extend the data window beyond pkt_len, silently passing a
> truncated IE to the handler functions.
>
> Add two guards at the top of the loop body:
> 1. Break if fewer than sizeof(*pIE) bytes remain (can't read header).
> 2. Break if the IE's declared data extends past pkt_len.
>
> Fixes: 554c0a3abf21 ("staging: Add rtl8723bs sdio wifi driver")
> Cc: stable <stable@xxxxxxxxxx>
> Signed-off-by: Alexandru Hossu <hossu.alexandru@xxxxxxxxx>
> Reviewed-by: Luka Gejak <luka.gejak@xxxxxxxxx>
> Link: https://patch.msgid.link/20260522004531.1038924-6-hossu.alexandru@xxxxxxxxx
> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
[...]

Hi Mikhail,

It seems to me that this was sent by accident by running git format-patch -1

You probably forgot to commit so git made last commit into a patch file.

Either way staging rtl8723bs is getting removed in linux 7.4 so any
further commits for rtl8723bs are discouraged.

Best regards,
Luka Gejak