Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp5155776rwd; Tue, 23 May 2023 19:38:01 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7sq+FvbOKk8WzKdcXf47jqLsIntSQy/7qr/WjX9uuf40bF6b3TO42ZkiAU4DGAZUvd+wUx X-Received: by 2002:a17:902:d48b:b0:1ae:87d8:a0c3 with SMTP id c11-20020a170902d48b00b001ae87d8a0c3mr17647680plg.10.1684895881360; Tue, 23 May 2023 19:38:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684895881; cv=none; d=google.com; s=arc-20160816; b=EQnUqfw3cYSGMnS1yheQ8oiXmyZF58UX88gVxT14YJkhD+m9RCcw/3E19mzV0+8CeG 0HrgMCgB+1YnsuIVJliLY170QSTFNmN8N1rl9M4I5okNcY3bJz9opEFYvVqUZCRVttAc 9BGrEEv8Bdbrk5fk5zYEZnd6MpEbY94ZaK01i87WZyxpJ8dEpxCwJ1y/xWpD51/Z8c2b 7PXhUQeZdUF6nVn40wQySiL5fmTUzOHswR1Z7lw/pzQMgGwTKOjaKE40eRPa7plkYIEa L/5a4JBqn7xa7D4Y4CNFjCv/xwZN0J+2WbkiBtszBpHsEsmbJ2CtcqC3EhC9kfQl6Qq8 LfQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=aasTBZQZv56mUB/he0G3yIgLrQXzoF0Jna8m775QSPo=; b=WDMzMQFyYXNYy9XFxMmYqjvbOo9KRTFPwkviPYQZiuPQlEamC9IEk92I5gIlHn4zpQ /MFIoFMr+TnDGNPvWMWzjccC2fCk+XZVRPgQ/p518bvOCKD3G2yFsBghZr7QLCn3lb2P wFezCbWKXWN1jx8RZiKPIFu+ji/W3s+OvluAP8BoLn5qYcWRYg1nSsPtw55eXY6IMro7 ieodG0ecsXX4oJn2sAwmoCEZVPqiL6uYWThPEDbKeT0J2VfgXc/lE46ouxmZ59g+ORLo CfZCX3JlnoDnRJLcr08M37vn6LtttPLDN8/XhcEsuIt3MdB8BPWI3jN9tF11yGPQR2to hXbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@embeddedor.com header.s=default header.b=yVeyFgkg; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b5-20020a170902e94500b001ab0c00aec4si6638556pll.482.2023.05.23.19.37.51; Tue, 23 May 2023 19:38:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@embeddedor.com header.s=default header.b=yVeyFgkg; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236486AbjEXCcQ (ORCPT + 63 others); Tue, 23 May 2023 22:32:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229991AbjEXCcP (ORCPT ); Tue, 23 May 2023 22:32:15 -0400 X-Greylist: delayed 90 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Tue, 23 May 2023 19:32:14 PDT Received: from omta40.uswest2.a.cloudfilter.net (omta40.uswest2.a.cloudfilter.net [35.89.44.39]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 74293C5 for ; Tue, 23 May 2023 19:32:14 -0700 (PDT) Received: from eig-obgw-5004a.ext.cloudfilter.net ([10.0.29.221]) by cmsmtp with ESMTP id 1bEuqBPQ6bK1V1eGyqSgPz; Wed, 24 May 2023 02:30:44 +0000 Received: from gator4166.hostgator.com ([108.167.133.22]) by cmsmtp with ESMTPS id 1eGwqzKP77EP01eGxq65nh; Wed, 24 May 2023 02:30:43 +0000 X-Authority-Analysis: v=2.4 cv=ZoT+lv3G c=1 sm=1 tr=0 ts=646d76d3 a=1YbLdUo/zbTtOZ3uB5T3HA==:117 a=WzbPXH4gqzPVN0x6HrNMNA==:17 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=IkcTkHD0fZMA:10 a=P0xRbXHiH_UA:10 a=wYkD_t78qR0A:10 a=VwQbUJbxAAAA:8 a=n9Sqmae0AAAA:8 a=NEAV23lmAAAA:8 a=mDV3o1hIAAAA:8 a=8x618Ytda_mi-GpODIUA:9 a=QEXdDO2ut3YA:10 a=3IOs8h2EC4YA:10 a=AjGcO6oz07-iQ99wixmX:22 a=UmAUUZEt6-oIqEbegvw9:22 a=_FVE-zBwftR9WsbkzFJk:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=embeddedor.com; s=default; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=aasTBZQZv56mUB/he0G3yIgLrQXzoF0Jna8m775QSPo=; b=yVeyFgkgSqd9sVwqNbCmQd10v5 ZrYkd0xRd9opKBUoM+cnKlDhJ6IVP0hWMLfj1uR4clLebAx4ULey9Oluk5HTGQ/kTrsSH0tHTmC+d fmOcr/Hd7d25OrzWDz9llsPhnkkccI1Q48foyO8rbM4Jr2TRJ1oPfoV9/HXdf7co/OEmZ/A5WMgPB bB6bO5SI+bv3ZufNjm31d/SzqCeuU+HMX+5zsK85xGwcoi/Lh1pdYC+XJu/j32YRfwPRqOtjoiny5 u3axL2ESVtn2ZTgosSL5d5MOymt4B/dGMVaNyzzL+rlxw3ETn1lCubM87paAEO9QQ7K3Un+3W/R5J vD0+Zcug==; Received: from 187-162-21-192.static.axtel.net ([187.162.21.192]:41992 helo=[192.168.15.7]) by gator4166.hostgator.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.95) (envelope-from ) id 1q1eGw-000m3M-9t; Tue, 23 May 2023 21:30:42 -0500 Message-ID: <13a74848-d961-7424-da7e-2bb7b904e899@embeddedor.com> Date: Tue, 23 May 2023 20:31:36 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH][next] wifi: rtw89: coex: Fix __write_overflow_field error Content-Language: en-US To: Ping-Ke Shih , "Gustavo A. R. Silva" , Kalle Valo Cc: "linux-wireless@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-hardening@vger.kernel.org" References: From: "Gustavo A. R. Silva" In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator4166.hostgator.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - embeddedor.com X-BWhitelist: no X-Source-IP: 187.162.21.192 X-Source-L: No X-Exim-ID: 1q1eGw-000m3M-9t X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 187-162-21-192.static.axtel.net ([192.168.15.7]) [187.162.21.192]:41992 X-Source-Auth: gustavo@embeddedor.com X-Email-Count: 3 X-Org: HG=hgshared;ORG=hostgator; X-Source-Cap: Z3V6aWRpbmU7Z3V6aWRpbmU7Z2F0b3I0MTY2Lmhvc3RnYXRvci5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfG2EffLzVddMmp8A9w1u8XgTl+PbcF101BZVz6xrNuENwzfoF15bPC4iGlFdifQkUBbZ8ycJwNTPp+7kSRIVU1tWmZ1MzM4BO9wrxrB+TWMpxuBMCx+b BD0i9KgryzwL9bmTuhM1AzSyViEcZiITSRUOcMiYl4pKJjuumgijOlNA9QLVFiNsyKUz0m24fofdLDRnaC1aOggDTNN8G09LzzNcauG6QiIMtj2MfNgxa2MV X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On 5/23/23 20:21, Ping-Ke Shih wrote: > > >> -----Original Message----- >> From: Gustavo A. R. Silva >> Sent: Wednesday, May 24, 2023 10:13 AM >> To: Ping-Ke Shih ; Kalle Valo >> Cc: linux-wireless@vger.kernel.org; linux-kernel@vger.kernel.org; Gustavo A. R. Silva >> ; linux-hardening@vger.kernel.org >> Subject: [PATCH][next] wifi: rtw89: coex: Fix __write_overflow_field error >> >> One-element arrays as fake flexible arrays are deprecated, and we are >> moving towards adopting C99 flexible-array members instead. >> >> Fix the following error seen under GCC-13 and -fstrict-flex-arrays=3: >> 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); >> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> >> This helps with the ongoing efforts to tighten the FORTIFY_SOURCE >> routines on memcpy() and help us make progress towards globally >> enabling -fstrict-flex-arrays=3 [1]. >> >> This results in no differences in binary output. >> >> Link: https://github.com/KSPP/linux/issues/21 >> Link: https://github.com/KSPP/linux/issues/299 >> Link: https://gcc.gnu.org/pipermail/gcc-patches/2022-October/602902.html [1] >> Signed-off-by: Gustavo A. R. Silva >> --- >> 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 { > > Arnd has sent the same patch [1] as yours. Oh that's great! What a coincidence. :) Thanks for letting me know. -- Gustavo > > [1] https://lore.kernel.org/linux-wireless/27a7010de8be4006a3e4b95e851781c6@realtek.com/T/#mca619c8261b87b88eedd391ceafb34c40d513ce5 >