2023-09-18 18:00:06

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH v2] wifi: brcmfmac: Replace 1-element arrays with flexible arrays

Juerg Haefliger <[email protected]> wrote:

> Since commit 2d47c6956ab3 ("ubsan: Tighten UBSAN_BOUNDS on GCC"),
> UBSAN_BOUNDS no longer pretends 1-element arrays are unbounded. Walking
> 'element' and 'channel_list' will trigger warnings, so make them proper
> flexible arrays.
>
> False positive warnings were:
>
> UBSAN: array-index-out-of-bounds in drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c:6984:20
> index 1 is out of range for type '__le32 [1]'
>
> UBSAN: array-index-out-of-bounds in drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c:1126:27
> index 1 is out of range for type '__le16 [1]'
>
> for these lines of code:
>
> 6884 ch.chspec = (u16)le32_to_cpu(list->element[i]);
>
> 1126 params_le->channel_list[i] = cpu_to_le16(chanspec);
>
> Cc: [email protected] # 6.5+
> Signed-off-by: Juerg Haefliger <[email protected]>
> Reviewed-by: Kees Cook <[email protected]>
> Reviewed-by: Gustavo A. R. Silva <[email protected]>

Patch applied to wireless.git, thanks.

4fed494abcd4 wifi: brcmfmac: Replace 1-element arrays with flexible arrays

--
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches