Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp5138208rwd; Tue, 23 May 2023 19:14:07 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6z0YTMNK3fzkvP9ZoeSBQu7SUFRVrjxRiNkOALpqTzJjOJfaTV5maCZm2DAoNCrBww4B65 X-Received: by 2002:a17:902:ab4e:b0:1ae:4ddd:9961 with SMTP id ij14-20020a170902ab4e00b001ae4ddd9961mr15789138plb.20.1684894447207; Tue, 23 May 2023 19:14:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684894447; cv=none; d=google.com; s=arc-20160816; b=yyPPz9G1TKegin6vbbep8bQw2d6/T0zlhRO6zqRkqwxn0OJxNNL411wH3tb7FOiegV ukCHNfu/lZX+2WnhypW1u5IiZs04eVUpUAE01QDXxPcLTAwjKl+NtjOtIFQyXek+lZaA 6o4NXL1JPNyGVrjW/2Kz2zc++HmcNRZ8nYk3+2e6VfyvctcFEwCjsu153GJ5Ipa4SBYV dOal+d4mJUNaBewMClJ9GLqGvjNZjnX2tAKIWEoJks4Z76AxfqZPOEQQ8y9SbyoMlfw8 JjAhwUOJa1X13fmc2kIceYh331/PBoF6vUZ03s3XjgYuzTCvbSSJtt9WKp7Uda/qVtEZ hkUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-disposition :mime-version:message-id:subject:cc:to:from:date:dkim-signature; bh=L/Oizn3HHRYDYBUieqvniZYiXHvUIBDrpzNwHFfcIUw=; b=zN0wC5DHhtgNn6jX8c/uKCxjhbUrWYnwNX+RpAwW3HFBbFM6CFJ3ld6+zRK6wB14iT lSBwQ3wVVyyGiUonw7WJq6r16UOoHQepjJfWabsgLRa8izBzKNWAEVL6EDsyIyoomSLP amFBbyQ1/vRlnlHGGwbC2WDquui1sCtdogc4mZh1rC040Dq9LoS/WWnxUDEaB13lUIGH /uwkK+mQGmH9FGV7zBtK0X4zMjlEtViSLyM9wJFBN+n9nQy0lO+UfuQ/XupFv0eNQxXe zbp3iMAVQswi0THPiLXl5SGr0obIoUITdkyyPnFvlFGma3mS5BHsbiqigwz/nJYMBu4B gC2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DV34t2dY; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i18-20020a17090332d200b001afd19aa672si1893463plr.448.2023.05.23.19.13.54; Tue, 23 May 2023 19:14:07 -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=pass header.i=@kernel.org header.s=k20201202 header.b=DV34t2dY; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238977AbjEXCMH (ORCPT + 62 others); Tue, 23 May 2023 22:12:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236998AbjEXCMG (ORCPT ); Tue, 23 May 2023 22:12:06 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 23507E48; Tue, 23 May 2023 19:11:56 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B4AF2637EF; Wed, 24 May 2023 02:11:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 13B60C433D2; Wed, 24 May 2023 02:11:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684894315; bh=ciYnv1aFoGmFR4E+7iAdi4r/6ifLsJjIccdxEn4Wea8=; h=Date:From:To:Cc:Subject:From; b=DV34t2dY8RSLHh02ZTuPDRWPJ1LpnWMQ320RRABfgjwF/Vuf+AcGOvOEZxQV/3sg8 G2Cb5BziE0Nlc74a8DQpi2eU7G3Y27+3/Rctn8VM1PBPzryM2xaqA3S5AJHSFW62V9 f79v8ey3OcgdkleMit40QgRQcgcI6O15VHNipHz0Mjlw7Cfu2lg+2a00fL4Oc7ped0 E3DNZ/VWgCfUMdjoRrHxA64HVaHXc7rQuiBfhlVzd2b5e+/eUelcY2KJLRJAQxntXl f72UY+bDeXxsev8fxQZ6FfbetVlcC1Z8K3Yy3R+u81+O13TQ0ifpeqzSFA2dakLvua tjbFtI2AcgZzg== Date: Tue, 23 May 2023 20:12:46 -0600 From: "Gustavo A. R. Silva" 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 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham 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 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 { -- 2.34.1