Message ID | Y9xjN6Wa3VslgXeX@work |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp580531wrn; Thu, 2 Feb 2023 17:33:39 -0800 (PST) X-Google-Smtp-Source: AK7set8vUIhzVOvijZXNepkGIFG5MQpZN4YTrHREheMAsJi+4TI5iw7Lbksv0yUZTGxq1t5BSb5q X-Received: by 2002:a50:ef0f:0:b0:4a1:2ed2:7822 with SMTP id m15-20020a50ef0f000000b004a12ed27822mr2755091eds.5.1675388018923; Thu, 02 Feb 2023 17:33:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675388018; cv=none; d=google.com; s=arc-20160816; b=RYKOWxCJLvf2f1GSAB+1F+jbtqKrynV9qYVRW5NnngTi5zTnehXpzaTdmTs+/1UiFK E9aAfAWX7MqGt6FvpjHOMJVgOvXnzlJsZWmaNOmbiDL2rhkHKDiZpzSHN+BJP29RrgVg 5+bb4XxLHvg9xZmeT1s873sANw/Yt5wZsylFmPJctuVJBGA7v7R4YLI7sir9NO9+6sIv y4qrImxSDYcHwsTo7xgSq/P6xwBDQ8vTte1/BpHzO6lIQOGHwRS479Vp49D3CwOX7Ejf D2o84Z2tQwTnHHR2O5VcVTNw8MhOof5V+KU3oaDaF38r9ECc/kgkXrvy+Yg8/ftN2ICu xa3A== 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=jML3v7vAOM/ubJngAlA61lxQBpyLzx3dl6OcNbD9duc=; b=ymiRYcKarh7fuJ4aJuo//heNNhWER3Ok0fK4hnlAMgePmLDlOnavi1ShAeAEdTbF+d 7AAzppF5XNA1y2KorWZUVzFnkvyDiZ2v2FV91VR4UNlm1XY4UpCyaTbGVKl5RAl+bcSn V/RjvlT73f4UZCLeNV6GhQJMAlChQNZ0CcaeJp7gvVNKybGNiG1GL9rmakpkqBMSg9XJ g/5/EK1yY+6oVHGoQUeDbIwCzhE2k9gSGI6EkhYXEHxPVedERL/Nzs+6CWx1NrY87sok zt/mnWpGFKylHzywLlJu7MDqiUEQk/VAkYsVeHWnJ30Gi9DCnPx66f72JWoy3Dupf03y pv6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gvqoqpOS; 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 fd1-20020a056402388100b004a23153d992si1167883edb.238.2023.02.02.17.33.14; Thu, 02 Feb 2023 17:33:38 -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=gvqoqpOS; 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 S231575AbjBCB2P (ORCPT <rfc822;il.mystafa@gmail.com> + 99 others); Thu, 2 Feb 2023 20:28:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230343AbjBCB2N (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 2 Feb 2023 20:28:13 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68A1D2CFD0; Thu, 2 Feb 2023 17:28:09 -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 1E3CAB8289F; Fri, 3 Feb 2023 01:28:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E9FACC433EF; Fri, 3 Feb 2023 01:28:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1675387686; bh=YDq9DRcIdKEp/Kugr9aBiusQ8u+FDDTKTPm1TZDr/f4=; h=Date:From:To:Cc:Subject:From; b=gvqoqpOSSNib2tlfvK8CGHUCDMHtfqmB61mU6rLB0+nAxmGZ8BWrhDDfM0G/8/mT8 cZ3rqvfGxy6jIdw2sV1vLbFUWMYm6y0SleW7smBAxgJdOWDs1yWrpfOECUkpRQnOAH yLzOkQNAa27uTG95itmWYHH5KldEqiBj12toXdWvkYjGRPJEZpcKkUwT304JFofCLT ayZ3USV8QVWPt7fMVmOfHtwotw1VEhzVEz4yoN4NXm1RSBKYQ/4/V5w3507ctN/SdZ h1JaPYp69xj72VZ274xfpShjvcYtcjjUo8ILQ5FAl78Ld9M1ARS7arvgEa47b2j16W FILdpib+E6imQ== Date: Thu, 2 Feb 2023 19:28:23 -0600 From: "Gustavo A. R. Silva" <gustavoars@kernel.org> To: Juergen Gross <jgross@suse.com>, Stefano Stabellini <sstabellini@kernel.org>, Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com> Cc: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org, "Gustavo A. R. Silva" <gustavoars@kernel.org>, linux-hardening@vger.kernel.org Subject: [PATCH][next] xen: Replace one-element array with flexible-array member Message-ID: <Y9xjN6Wa3VslgXeX@work> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 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?1756771667381438476?= X-GMAIL-MSGID: =?utf-8?q?1756771667381438476?= |
Series |
[next] xen: Replace one-element array with flexible-array member
|
|
Commit Message
Gustavo A. R. Silva
Feb. 3, 2023, 1:28 a.m. UTC
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 xen_page_directory.
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/255
Link: https://gcc.gnu.org/pipermail/gcc-patches/2022-October/602902.html [1]
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
---
drivers/xen/xen-front-pgdir-shbuf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Thu, Feb 02, 2023 at 07:28:23PM -0600, Gustavo A. R. Silva wrote: > 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 xen_page_directory. > > 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/255 > Link: https://gcc.gnu.org/pipermail/gcc-patches/2022-October/602902.html [1] > Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org> Reviewed-by: Kees Cook <keescook@chromium.org>
On 03.02.23 02:28, Gustavo A. R. Silva wrote: > 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 xen_page_directory. > > 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/255 > Link: https://gcc.gnu.org/pipermail/gcc-patches/2022-October/602902.html [1] > Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org> Reviewed-by: Juergen Gross <jgross@suse.com> Juergen
On 03.02.23 02:28, Gustavo A. R. Silva wrote: > 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 xen_page_directory. > > 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/255 > Link: https://gcc.gnu.org/pipermail/gcc-patches/2022-October/602902.html [1] > Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org> Pushed-to: xen/tip.git for-linus-6.3 Juergen
diff --git a/drivers/xen/xen-front-pgdir-shbuf.c b/drivers/xen/xen-front-pgdir-shbuf.c index 5c0b5cb5b419..b52e0fa595a9 100644 --- a/drivers/xen/xen-front-pgdir-shbuf.c +++ b/drivers/xen/xen-front-pgdir-shbuf.c @@ -30,7 +30,7 @@ struct xen_page_directory { grant_ref_t gref_dir_next_page; #define XEN_GREF_LIST_END 0 - grant_ref_t gref[1]; /* Variable length */ + grant_ref_t gref[]; /* Variable length */ }; /**