lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d247d8ec-0ab6-c552-fef5-8d48b245a7dd@embeddedor.com>
Date:   Wed, 24 May 2023 04:43:08 -0600
From:   "Gustavo A. R. Silva" <gustavo@...eddedor.com>
To:     Arnd Bergmann <arnd@...nel.org>, Ping-Ke Shih <pkshih@...ltek.com>,
        Kalle Valo <kvalo@...nel.org>
Cc:     Arnd Bergmann <arnd@...db.de>, Ching-Te Ku <ku920601@...ltek.com>,
        linux-wireless@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] rtw89: use flexible array member in rtw89_btc_btf_tlv



On 5/23/23 05:32, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@...db.de>
> 
> struct rtw89_btc_btf_tlv contains a one-byte member that is intended as a
> flexible array:
> 
> In function 'fortify_memcpy_chk',
>      inlined from '_append_tdma' at drivers/net/wireless/realtek/rtw89/coex.c:1579:3:
> include/linux/fortify-string.h:583:25: error: call to '__write_overflow_field' declared with attribute warning: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Werror=attribute-warning]
>    583 |                         __write_overflow_field(p_size_field, size);
>        |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> Make this actually use a flexible array to let the compiler understand.
> 
> Signed-off-by: Arnd Bergmann <arnd@...db.de>

Reviewed-by: Gustavo A. R. Silva <gustavoars@...nel.org>

Thanks!
--
Gustavo

> ---
>   drivers/net/wireless/realtek/rtw89/coex.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/realtek/rtw89/coex.c b/drivers/net/wireless/realtek/rtw89/coex.c
> index 3a586a971e8f..bda0e1e99a8c 100644
> --- a/drivers/net/wireless/realtek/rtw89/coex.c
> +++ b/drivers/net/wireless/realtek/rtw89/coex.c
> @@ -206,7 +206,7 @@ static const struct rtw89_btc_ver rtw89_btc_ver_defs[] = {
>   struct rtw89_btc_btf_tlv {
>   	u8 type;
>   	u8 len;
> -	u8 val[1];
> +	u8 val[];
>   } __packed;
>   
>   enum btc_btf_set_report_en {

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ