From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id AEBBCC433EF for ; Tue, 15 Feb 2022 19:19:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 06DF76B0078; Tue, 15 Feb 2022 14:19:42 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 01DA46B007B; Tue, 15 Feb 2022 14:19:41 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E00256B007D; Tue, 15 Feb 2022 14:19:41 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id D0CF66B0078 for ; Tue, 15 Feb 2022 14:19:41 -0500 (EST) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 808D68248D52 for ; Tue, 15 Feb 2022 19:19:41 +0000 (UTC) X-FDA: 79145978562.29.BB2567E Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf28.hostedemail.com (Postfix) with ESMTP id EAF9CC0006 for ; Tue, 15 Feb 2022 19:19:40 +0000 (UTC) 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 3A349617A1; Tue, 15 Feb 2022 19:19:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E76B9C340EB; Tue, 15 Feb 2022 19:19:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1644952780; bh=RxAYLCqbUWlxjV9GFahzPwnkRBYKU9aVJMxo+INb+K8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=oa82FKq0/HZo1Hieccox0xhuEOltsBpyNCb/oKWHfz9JimsfI5qrPFHosVG+Hw9KD FqjMZvJ5BquXlsEM1IUTOugfyhHJjbL+NoooCvHgJp/wzFU4N6mJ3/+qfEy0h1bhbj fv9Bo5w4LHHM1g+pM9OlS1+FV6MX0/N+Aa88X5OzELy65s1Xs5Q/258d9WBNoUp0fb HMGG+vm/A6PvbbvtXJ00MB45hauRqyRZCekvmCmXYRktZmaEtd9qOIjTryp50cyo1/ 0DT+ajNam/uql+1lfstz9xW/6FSdwogqLIyHb8bwuPl3b0gveaOfCnpwJkPBK0mL1q tCTR2Et3rHU/g== Date: Tue, 15 Feb 2022 21:19:29 +0200 From: Leon Romanovsky To: "Gustavo A. R. Silva" Cc: Kees Cook , GR-QLogic-Storage-Upstream@marvell.com, linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org, linux-ia64@vger.kernel.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, linux-um@lists.infradead.org, linux-xtensa@linux-xtensa.org, linux-crypto@vger.kernel.org, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org, coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, bcm-kernel-feedback-list@broadcom.com, netdev@vger.kernel.org, linux-omap@vger.kernel.org, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, mpi3mr-linuxdrv.pdl@broadcom.com, linux-staging@lists.linux.dev, linux-rpi-kernel@lists.infradead.org, sparmaintainer@unisys.com, linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, linux-ext4@vger.kernel.org, linux-acpi@vger.kernel.org, devel@acpica.org, linux-arch@vger.kernel.org, linux-mm@kvack.org, greybus-dev@lists.linaro.org, linux-i3c@lists.infradead.org, linux-rdma@vger.kernel.org, linux-bluetooth@vger.kernel.org, alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH][next] treewide: Replace zero-length arrays with flexible-array members Message-ID: References: <20220215174743.GA878920@embeddedor> <202202151016.C0471D6E@keescook> <20220215192110.GA883653@embeddedor> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220215192110.GA883653@embeddedor> X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: EAF9CC0006 X-Stat-Signature: kjez86yznrw7rnbaf9qqxxbasttpczr9 Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=oa82FKq0; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf28.hostedemail.com: domain of leon@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=leon@kernel.org X-HE-Tag: 1644952780-353881 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, Feb 15, 2022 at 01:21:10PM -0600, Gustavo A. R. Silva wrote: > On Tue, Feb 15, 2022 at 10:17:40AM -0800, Kees Cook wrote: > > On Tue, Feb 15, 2022 at 11:47:43AM -0600, Gustavo A. R. Silva wrote: > > > There is a regular need in the kernel to provide a way to declare > > > having a dynamically sized set of trailing elements in a structure. > > > Kernel code should always use =E2=80=9Cflexible array members=E2=80= =9D[1] for these > > > cases. The older style of one-element or zero-length arrays should > > > no longer be used[2]. > > >=20 > > > This code was transformed with the help of Coccinelle: > > > (next-20220214$ spatch --jobs $(getconf _NPROCESSORS_ONLN) --sp-fil= e script.cocci --include-headers --dir . > output.patch) > > >=20 > > > @@ > > > identifier S, member, array; > > > type T1, T2; > > > @@ > > >=20 > > > struct S { > > > ... > > > T1 member; > > > T2 array[ > > > - 0 > > > ]; > > > }; > >=20 > > These all look trivially correct to me. Only two didn't have the end = of > > the struct visible in the patch, and checking those showed them to be > > trailing members as well, so: > >=20 > > Reviewed-by: Kees Cook >=20 > I'll add this to my -next tree. I would like to ask you to send mlx5 patch separately to netdev. We are w= orking to delete that file completely and prefer to avoid from unnecessary merge= conflicts. Thanks >=20 > Thanks! > -- > Gustavo