Message ID | 20230523113241.2772811-1-arnd@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2083023vqo; Tue, 23 May 2023 05:03:04 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7DwpSW4HG9V01/lVAccTJjcIwEV5GEH976Lldqs/Uk3INNerW2IkUniqhjZmj5k72bqe6a X-Received: by 2002:a17:902:d4d0:b0:1ac:83d1:9269 with SMTP id o16-20020a170902d4d000b001ac83d19269mr15645551plg.16.1684843383749; Tue, 23 May 2023 05:03:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684843383; cv=none; d=google.com; s=arc-20160816; b=pBETM6wuRa98ZRq2qJZ+XiBvMor8G3wXtLnc0vf7BhgQwqvWJ9r8PbF8ROq7JkFS0P MnibY/NoQGjMJSDnouyeFVqCp8Rr4ILDmdKgG/hStgzeBJkJ2UkSDWKmhhiikpWLVV4L c8zZo2ZpGzmP0bYDL/9c/zYTUTWzAajYTK3kq/3okiVZM3MjNkI+bP2UPGMpsgaXOByy DmOCfszLtNCTS/k3EI2rnL+RdF+DGzw9WL+4cMoOurFVwEi2zXCz/BCxzOBmYKSLDQAC sKQCkDj9Su3oHbahn3tWECWfm7ix3aA+6dykSSNt03Kmj2yK4CSW423yv2D1MvrJ3Ln8 ZJXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=IsShx5kUHHQCOr3bTjbAR2yHgoYRKWawCqRxLqgDS2U=; b=zT2l6ljsL0pBtFVPq+0NMc8OCUmXkBafRhAm3ncwdNT79QMe08McPMaHdfxspx/maR Lpi4xfa8r7P9befFlf/SmKqRbASFGXwFHqpGhQnIvSvZY3yZihDVxwDIJnql2nlanDA1 Mha0jfpSgKIZ1GqMN7rdRPrYaaMwkbUQ+oCZb0D8sxWQ8h+awnyfqpHwzSeZc7VUibC3 u+oWxomA8/qh0L5OuVrw78PO0fW4chjLJSE3VVMAdKzwU2dfIs+o1ns/kgLKcUXFyfZ8 Zi6ytM/5/5kFoja77cB3dVepj7l5uP9WGxVKamMbVeGnS4Tnd7Dm1x67jOOTBx4AD2js 33AQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nEZoTThK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l16-20020a170903245000b001aaec5cffb2si3140690pls.280.2023.05.23.05.02.47; Tue, 23 May 2023 05:03:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=nEZoTThK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-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 S236530AbjEWLcw (ORCPT <rfc822;ahmedalshaiji.dev@gmail.com> + 99 others); Tue, 23 May 2023 07:32:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233339AbjEWLct (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 23 May 2023 07:32:49 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3E81118; Tue, 23 May 2023 04:32:47 -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 775A7624B1; Tue, 23 May 2023 11:32:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3DEBAC433EF; Tue, 23 May 2023 11:32:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684841566; bh=2bCPs80POr2NdwT8+Ons3d8PhiCamrlaGVRkZrlM6lE=; h=From:To:Cc:Subject:Date:From; b=nEZoTThKhYtXo+kWcB9qgcW7hG6DntBrWl26EKEVW7f2UNh/xaYl+GVOaEFMNaYyu zT1icWzPXXIcx09nmv2q/TC8KBveSSrvv+J5wiq7ne4KgoxoRS93aaYvhsU4wA3IOu jqKkuzItD/fQwDRuniETV2NkioYDDyPHzUc2suFmT8oWydw1Q4MMD/0+ok5aN3/b85 tOc9X3dOwYCkXgr8YyPCXQ7cbLhGrJiSHbWnmfHdZNqfsL2z9ba/Ie8ENqy63GfYT/ rlmwhIujRiV70+h73UN7+KGYqQW/oFLDS/sKCX5UCzW4aAbtWn/QAVaGLhaMi4Pr/I ArlTn3Vw2tf0w== From: Arnd Bergmann <arnd@kernel.org> To: Ping-Ke Shih <pkshih@realtek.com>, Kalle Valo <kvalo@kernel.org> Cc: Arnd Bergmann <arnd@arndb.de>, Ching-Te Ku <ku920601@realtek.com>, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] rtw89: use flexible array member in rtw89_btc_btf_tlv Date: Tue, 23 May 2023 13:32:35 +0200 Message-Id: <20230523113241.2772811-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766686335599717214?= X-GMAIL-MSGID: =?utf-8?q?1766686335599717214?= |
Series |
rtw89: use flexible array member in rtw89_btc_btf_tlv
|
|
Commit Message
Arnd Bergmann
May 23, 2023, 11:32 a.m. UTC
From: Arnd Bergmann <arnd@arndb.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@arndb.de> --- drivers/net/wireless/realtek/rtw89/coex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Comments
> -----Original Message----- > From: Arnd Bergmann <arnd@kernel.org> > Sent: Tuesday, May 23, 2023 7:33 PM > To: Ping-Ke Shih <pkshih@realtek.com>; Kalle Valo <kvalo@kernel.org> > Cc: Arnd Bergmann <arnd@arndb.de>; DeanKu <ku920601@realtek.com>; linux-wireless@vger.kernel.org; > linux-kernel@vger.kernel.org > Subject: [PATCH] rtw89: use flexible array member in rtw89_btc_btf_tlv > > From: Arnd Bergmann <arnd@arndb.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@arndb.de> Reviewed-by: Ping-Ke Shih <pkshih@realtek.com> > --- > 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.39.2
On 5/23/23 05:32, Arnd Bergmann wrote: > From: Arnd Bergmann <arnd@arndb.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@arndb.de> Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.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 {
Arnd Bergmann <arnd@kernel.org> wrote: > From: Arnd Bergmann <arnd@arndb.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@arndb.de> > Reviewed-by: Ping-Ke Shih <pkshih@realtek.com> > Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org> Patch applied to wireless-next.git, thanks. 47e612268ea0 wifi: rtw89: use flexible array member in rtw89_btc_btf_tlv
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 {