Re: [PATCH wireless 1/2] wifi: brcmfmac: fwsignal: bound the AMPDU reorder indices
From: Arend van Spriel
Date: Tue Nov 24 2026 - 15:14:05 EST
On Mon, 16 Nov 2026 02:58:42 +0800, Maoyi Xie <maoyixie.tju@xxxxxxxxx> wrote:
> brcmf_fws_rxreorder() allocates max_idx + 1 slots when a reorder flow
> starts. It then uses the indices of each frame without a check.
>
> rfi->pktslots[rfi->cur_idx] = pkt;
>
> A cur_idx above the allocated maximum makes the driver write and read
> past pktslots[]. An exp_idx above max_idx makes
> brcmf_rxreorder_get_skb_list() read past the array or loop forever.
>
> Store the allocated maximum in the flow. Bound max_idx by it and the
> other indices by max_idx. Deliver a frame that fails the check without
> reordering.
>
> This was found with a static analysis tool that we develop. A userspace
> harness that compiles the fwsignal.c functions unchanged runs under
> AddressSanitizer. It shows the out-of-bounds accesses and the endless
> loop before this patch, but not after it. No hardware was available for
> testing.
>
> Fixes: 87edd8916ee2 ("brcmfmac: add AMPDU reordering functionality")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Maoyi Xie <maoyixie.tju@xxxxxxxxx>
> ---
> .../broadcom/brcm80211/brcmfmac/core.h | 2 ++
> .../broadcom/brcm80211/brcmfmac/fwsignal.c | 24 ++++++++++++++++---
> 2 files changed, 23 insertions(+), 3 deletions(-)
Acked-by: Arend van Spriel <arend.vanspriel@xxxxxxxxxxxx>
Regards,
Arend