From patchwork Fri Feb 3 01:29:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gustavo A. R. Silva" X-Patchwork-Id: 52253 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp580286wrn; Thu, 2 Feb 2023 17:32:54 -0800 (PST) X-Google-Smtp-Source: AK7set/GBKodGWz3m1GtMxjCu0mLkfjWOk16kH+KuRjTiPknckU5/UTlAYBHAda1wgY76cbtL35L X-Received: by 2002:a17:907:6290:b0:88d:ba89:1853 with SMTP id nd16-20020a170907629000b0088dba891853mr4175988ejc.36.1675387974132; Thu, 02 Feb 2023 17:32:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675387974; cv=none; d=google.com; s=arc-20160816; b=yHG79Vw5iO0c5VUlqgyVCV4wAiR2Bf8Bqj7LCxgksZIsrFPTeQTCyZ4/QccXidE1mX FL8Qk8Jxr+cOO9Sk91lOCAR5AYkfkH6WmuJCL/fL8ul4i5Tsf5NEEuzF8hWBF6LJmH0G TDUdWLQCDyKI9KoNzwri76501rxbMwtgZVm7XZ0Q1Od5K57Xna8YR/KB0C85hZzXxARP 3JaPruNQ/Aloub4kOYRr3LLjlfA8ZBMXFNprRwt/NBJvcWuutU/EPQgeKlXARCUh6yHw mxgZuGWlvWUUemlwVEZmQCcS49VC7RA3SSYJAg3AxmZr1E9kGN4x6rsLtpH6JVbyOsAL tTXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=e1uRtae6tXUruX6Q6oOMcoKMhHiYMXnM7koSkTpZLDk=; b=hKVgbB44eKlwrmv6epakiogJ0q3o/W/o3Iu6ozKgwuYl8t47AJBvKTcY2gOL8Y4y2w iU91YFbLFV+hT41fuL+W70pBJkgXJQcEcoYPDzm+jJD81+JnZlLkZ7hbl3y5qQgMFYw2 GC8asRq2Mi5aEQdtL/sHnccTUwYrq007bwyKDEckQTKh2oq0YCBLeZ+qRCQp8p9zKhjJ tv70MTGrbTx4rvR9sfH0GCeDPFhyNtcqTgXuc6jAtmteCWe2BWaiPFz5Fo++vgN2dR3j Q0kUpJdGsssmiX10gtXJGBVmTFBf9cvSBBfi4i1I8TjlEdMu7kixyvWc8qGHbCri3tsJ Qf1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JZhlctIc; 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 fq10-20020a1709069d8a00b00889b6520ae1si1182344ejc.44.2023.02.02.17.32.29; Thu, 02 Feb 2023 17:32:54 -0800 (PST) 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=JZhlctIc; 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 S230456AbjBCB3i (ORCPT + 99 others); Thu, 2 Feb 2023 20:29:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230217AbjBCB3g (ORCPT ); Thu, 2 Feb 2023 20:29:36 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C20D47C71A; Thu, 2 Feb 2023 17:29:34 -0800 (PST) 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 ams.source.kernel.org (Postfix) with ESMTPS id 6AD8BB82560; Fri, 3 Feb 2023 01:29:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 65836C433D2; Fri, 3 Feb 2023 01:29:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1675387772; bh=hOtbfO5ACqKII86Tj3f0eqnQOhB2cqeQ/aBmhLjhLPI=; h=Date:From:To:Cc:Subject:From; b=JZhlctIc/IqnodVD0zClmzGgWe3S/rgUrNmM9dwtnucsYYu6/TOFWcqxhpOtt3Pa8 XtBMq3k5YcGNXCDh5YWgQLMZ8yz+tKPMvX6fES63LC9RbThaWrTlkNSXniOLPXU/nX X4iFWg5T8latubEjcpytl5vZV1lLB4LhLf1/NxXV2HNp9xKZAytkfggs8IGrxzgFq7 I2bi9duy4IkhwWpQJnxP6S7YF3LEQYvzPewjlEJ4rWD3i/SwalCS6Q6hpUE/dHJNJx jrZyZAk51dQaiWW8oRcs7FB/UsfvA6rP2gqephVlQ2ETkT+2m2ESvEMqjo5tDqdLQu DRz/21WL+4fRA== Date: Thu, 2 Feb 2023 19:29:47 -0600 From: "Gustavo A. R. Silva" To: Arend van Spriel , Franky Lin , Hante Meuleman , Kalle Valo , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, SHA-cyfmac-dev-list@infineon.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, "Gustavo A. R. Silva" , linux-hardening@vger.kernel.org Subject: [PATCH][next] brcmfmac: Replace one-element array with flexible-array member Message-ID: MIME-Version: 1.0 Content-Disposition: inline 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 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-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756771620303675499?= X-GMAIL-MSGID: =?utf-8?q?1756771620303675499?= One-element arrays are deprecated, and we are replacing them with flexible array members instead. So, replace one-element array with flexible-array member in struct brcmf_tlv. 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/79 Link: https://github.com/KSPP/linux/issues/253 Link: https://gcc.gnu.org/pipermail/gcc-patches/2022-October/602902.html [1] Signed-off-by: Gustavo A. R. Silva Reviewed-by: Kees Cook --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h index e90a30808c22..0e1fa3f0dea2 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h @@ -383,7 +383,7 @@ struct brcmf_cfg80211_info { struct brcmf_tlv { u8 id; u8 len; - u8 data[1]; + u8 data[]; }; static inline struct wiphy *cfg_to_wiphy(struct brcmf_cfg80211_info *cfg)