All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Gustavo A. R. Silva" <gustavoars@kernel.org>
To: Kees Cook <keescook@chromium.org>
Cc: 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
Date: Tue, 15 Feb 2022 13:21:10 -0600	[thread overview]
Message-ID: <20220215192110.GA883653@embeddedor> (raw)
In-Reply-To: <202202151016.C0471D6E@keescook>

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 “flexible array members”[1] for these
> > cases. The older style of one-element or zero-length arrays should
> > no longer be used[2].
> > 
> > This code was transformed with the help of Coccinelle:
> > (next-20220214$ spatch --jobs $(getconf _NPROCESSORS_ONLN) --sp-file script.cocci --include-headers --dir . > output.patch)
> > 
> > @@
> > identifier S, member, array;
> > type T1, T2;
> > @@
> > 
> > struct S {
> >   ...
> >   T1 member;
> >   T2 array[
> > - 0
> >   ];
> > };
> 
> 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:
> 
> Reviewed-by: Kees Cook <keescook@chromium.org>

I'll add this to my -next tree.

Thanks!
--
Gustavo

WARNING: multiple messages have this Message-ID (diff)
From: "Gustavo A. R. Silva" <gustavoars@kernel.org>
To: Kees Cook <keescook@chromium.org>
Cc: alsa-devel@alsa-project.org, linux-ia64@vger.kernel.org,
	linux-sh@vger.kernel.org, nouveau@lists.freedesktop.org,
	dri-devel@lists.freedesktop.org, linux-mm@kvack.org,
	devicetree@vger.kernel.org, target-devel@vger.kernel.org,
	linux-hardening@vger.kernel.org, sparclinux@vger.kernel.org,
	linux-i3c@lists.infradead.org, linux-arch@vger.kernel.org,
	linux-s390@vger.kernel.org, linux-scsi@vger.kernel.org,
	linux-bluetooth@vger.kernel.org, linux-rdma@vger.kernel.org,
	linux-staging@lists.linux.dev, linux-acpi@vger.kernel.org,
	bcm-kernel-feedback-list@broadcom.com,
	linux-ext4@vger.kernel.org, intel-gfx@lists.freedesktop.org,
	linux-xtensa@linux-xtensa.org, mpi3mr-linuxdrv.pdl@broadcom.com,
	coresight@lists.linaro.org, sparmaintainer@unisys.com,
	linux-um@lists.infradead.org, greybus-dev@lists.linaro.org,
	linux-rpi-kernel@lists.infradead.org, linux-omap@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, devel@acpica.org,
	linux-cifs@vger.kernel.org, netdev@vger.kernel.org,
	samba-technical@lists.samba.org, linux-kernel@vger.kernel.org,
	linux-perf-users@vger.kernel.org,
	GR-QLogic-Storage-Upstream@marvell.com,
	linux-crypto@vger.kernel.org, linux-alpha@vger.kernel.org
Subject: Re: [PATCH][next] treewide: Replace zero-length arrays with flexible-array members
Date: Tue, 15 Feb 2022 13:21:10 -0600	[thread overview]
Message-ID: <20220215192110.GA883653@embeddedor> (raw)
In-Reply-To: <202202151016.C0471D6E@keescook>

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 “flexible array members”[1] for these
> > cases. The older style of one-element or zero-length arrays should
> > no longer be used[2].
> > 
> > This code was transformed with the help of Coccinelle:
> > (next-20220214$ spatch --jobs $(getconf _NPROCESSORS_ONLN) --sp-file script.cocci --include-headers --dir . > output.patch)
> > 
> > @@
> > identifier S, member, array;
> > type T1, T2;
> > @@
> > 
> > struct S {
> >   ...
> >   T1 member;
> >   T2 array[
> > - 0
> >   ];
> > };
> 
> 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:
> 
> Reviewed-by: Kees Cook <keescook@chromium.org>

I'll add this to my -next tree.

Thanks!
--
Gustavo

WARNING: multiple messages have this Message-ID (diff)
From: "Gustavo A. R. Silva" <gustavoars@kernel.org>
To: Kees Cook <keescook@chromium.org>
Cc: 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
Date: Tue, 15 Feb 2022 13:21:10 -0600	[thread overview]
Message-ID: <20220215192110.GA883653@embeddedor> (raw)
In-Reply-To: <202202151016.C0471D6E@keescook>

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 “flexible array members”[1] for these
> > cases. The older style of one-element or zero-length arrays should
> > no longer be used[2].
> > 
> > This code was transformed with the help of Coccinelle:
> > (next-20220214$ spatch --jobs $(getconf _NPROCESSORS_ONLN) --sp-file script.cocci --include-headers --dir . > output.patch)
> > 
> > @@
> > identifier S, member, array;
> > type T1, T2;
> > @@
> > 
> > struct S {
> >   ...
> >   T1 member;
> >   T2 array[
> > - 0
> >   ];
> > };
> 
> 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:
> 
> Reviewed-by: Kees Cook <keescook@chromium.org>

I'll add this to my -next tree.

Thanks!
--
Gustavo

-- 
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c

WARNING: multiple messages have this Message-ID (diff)
From: "Gustavo A. R. Silva" <gustavoars@kernel.org>
To: Kees Cook <keescook@chromium.org>
Cc: 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
Date: Tue, 15 Feb 2022 13:21:10 -0600	[thread overview]
Message-ID: <20220215192110.GA883653@embeddedor> (raw)
In-Reply-To: <202202151016.C0471D6E@keescook>

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 “flexible array members”[1] for these
> > cases. The older style of one-element or zero-length arrays should
> > no longer be used[2].
> > 
> > This code was transformed with the help of Coccinelle:
> > (next-20220214$ spatch --jobs $(getconf _NPROCESSORS_ONLN) --sp-file script.cocci --include-headers --dir . > output.patch)
> > 
> > @@
> > identifier S, member, array;
> > type T1, T2;
> > @@
> > 
> > struct S {
> >   ...
> >   T1 member;
> >   T2 array[
> > - 0
> >   ];
> > };
> 
> 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:
> 
> Reviewed-by: Kees Cook <keescook@chromium.org>

I'll add this to my -next tree.

Thanks!
--
Gustavo

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

WARNING: multiple messages have this Message-ID (diff)
From: "Gustavo A. R. Silva" <gustavoars@kernel.org>
To: Kees Cook <keescook@chromium.org>
Cc: alsa-devel@alsa-project.org, linux-ia64@vger.kernel.org,
	linux-sh@vger.kernel.org, nouveau@lists.freedesktop.org,
	dri-devel@lists.freedesktop.org, linux-mm@kvack.org,
	devicetree@vger.kernel.org, target-devel@vger.kernel.org,
	linux-hardening@vger.kernel.org, sparclinux@vger.kernel.org,
	linux-i3c@lists.infradead.org, linux-arch@vger.kernel.org,
	linux-s390@vger.kernel.org, linux-scsi@vger.kernel.org,
	linux-bluetooth@vger.kernel.org, linux-rdma@vger.kernel.org,
	linux-staging@lists.linux.dev, linux-acpi@vger.kernel.org,
	bcm-kernel-feedback-list@broadcom.com,
	linux-ext4@vger.kernel.org, intel-gfx@lists.freedesktop.org,
	linux-xtensa@linux-xtensa.org, mpi3mr-linuxdrv.pdl@broadcom.com,
	coresight@lists.linaro.org, sparmaintainer@unisys.com,
	linux-um@lists.infradead.org, greybus-dev@lists.linaro.org,
	linux-rpi-kernel@lists.infradead.org, linux-omap@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, devel@acpica.org,
	linux-cifs@vger.kernel.org, netdev@vger.kernel.org,
	samba-technical@lists.samba.org, linux-kernel@vger.kernel.org,
	linux-perf-users@vger.kernel.org,
	GR-QLogic-Storage-Upstream@marvell.com,
	linux-crypto@vger.kernel.org, linux-alpha@vger.kernel.org
Subject: Re: [Intel-gfx] [PATCH][next] treewide: Replace zero-length arrays with flexible-array members
Date: Tue, 15 Feb 2022 13:21:10 -0600	[thread overview]
Message-ID: <20220215192110.GA883653@embeddedor> (raw)
In-Reply-To: <202202151016.C0471D6E@keescook>

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 “flexible array members”[1] for these
> > cases. The older style of one-element or zero-length arrays should
> > no longer be used[2].
> > 
> > This code was transformed with the help of Coccinelle:
> > (next-20220214$ spatch --jobs $(getconf _NPROCESSORS_ONLN) --sp-file script.cocci --include-headers --dir . > output.patch)
> > 
> > @@
> > identifier S, member, array;
> > type T1, T2;
> > @@
> > 
> > struct S {
> >   ...
> >   T1 member;
> >   T2 array[
> > - 0
> >   ];
> > };
> 
> 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:
> 
> Reviewed-by: Kees Cook <keescook@chromium.org>

I'll add this to my -next tree.

Thanks!
--
Gustavo

WARNING: multiple messages have this Message-ID (diff)
From: "Gustavo A. R. Silva" <gustavoars@kernel.org>
To: Kees Cook <keescook@chromium.org>
Cc: alsa-devel@alsa-project.org, linux-ia64@vger.kernel.org,
	linux-sh@vger.kernel.org, nouveau@lists.freedesktop.org,
	dri-devel@lists.freedesktop.org, linux-mm@kvack.org,
	devicetree@vger.kernel.org, target-devel@vger.kernel.org,
	linux-hardening@vger.kernel.org, sparclinux@vger.kernel.org,
	linux-i3c@lists.infradead.org, linux-arch@vger.kernel.org,
	linux-s390@vger.kernel.org, linux-scsi@vger.kernel.org,
	linux-bluetooth@vger.kernel.org, linux-rdma@vger.kernel.org,
	linux-staging@lists.linux.dev, linux-acpi@vger.kernel.org,
	bcm-kernel-feedback-list@broadcom.com,
	linux-ext4@vger.kernel.org, intel-gfx@lists.freedesktop.org,
	linux-xtensa@linux-xtensa.org, mpi3mr-linuxdrv.pdl@broadcom.com,
	coresight@lists.linaro.org, sparmaintainer@unisys.com,
	linux-um@lists.infradead.org, greybus-dev@lists.linaro.org,
	linux-rpi-kernel@lists.infradead.org, linux-omap@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, devel@acpica.org,
	linux-cifs@vger.kernel.org, netdev@vger.kernel.org,
	samba-technical@lists.samba.org, linux-kernel@vger.kernel.org,
	linux-perf-users@vger.kernel.org,
	GR-QLogic-Storage-Upstream@marvell.com,
	linux-crypto@vger.kernel.org, linux-alpha@vger.kernel.org
Subject: Re: [Nouveau] [PATCH][next] treewide: Replace zero-length arrays with flexible-array members
Date: Tue, 15 Feb 2022 13:21:10 -0600	[thread overview]
Message-ID: <20220215192110.GA883653@embeddedor> (raw)
In-Reply-To: <202202151016.C0471D6E@keescook>

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 “flexible array members”[1] for these
> > cases. The older style of one-element or zero-length arrays should
> > no longer be used[2].
> > 
> > This code was transformed with the help of Coccinelle:
> > (next-20220214$ spatch --jobs $(getconf _NPROCESSORS_ONLN) --sp-file script.cocci --include-headers --dir . > output.patch)
> > 
> > @@
> > identifier S, member, array;
> > type T1, T2;
> > @@
> > 
> > struct S {
> >   ...
> >   T1 member;
> >   T2 array[
> > - 0
> >   ];
> > };
> 
> 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:
> 
> Reviewed-by: Kees Cook <keescook@chromium.org>

I'll add this to my -next tree.

Thanks!
--
Gustavo

WARNING: multiple messages have this Message-ID (diff)
From: "Gustavo A. R. Silva" <gustavoars@kernel.org>
To: Kees Cook <keescook@chromium.org>
Cc: 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
Date: Tue, 15 Feb 2022 13:21:10 -0600	[thread overview]
Message-ID: <20220215192110.GA883653@embeddedor> (raw)
In-Reply-To: <202202151016.C0471D6E@keescook>

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 “flexible array members”[1] for these
> > cases. The older style of one-element or zero-length arrays should
> > no longer be used[2].
> > 
> > This code was transformed with the help of Coccinelle:
> > (next-20220214$ spatch --jobs $(getconf _NPROCESSORS_ONLN) --sp-file script.cocci --include-headers --dir . > output.patch)
> > 
> > @@
> > identifier S, member, array;
> > type T1, T2;
> > @@
> > 
> > struct S {
> >   ...
> >   T1 member;
> >   T2 array[
> > - 0
> >   ];
> > };
> 
> 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:
> 
> Reviewed-by: Kees Cook <keescook@chromium.org>

I'll add this to my -next tree.

Thanks!
--
Gustavo

_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um

WARNING: multiple messages have this Message-ID (diff)
From: "Gustavo A. R. Silva" <gustavoars@kernel.org>
To: Kees Cook <keescook@chromium.org>
Cc: 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
Date: Tue, 15 Feb 2022 19:21:10 +0000	[thread overview]
Message-ID: <20220215192110.GA883653@embeddedor> (raw)
In-Reply-To: <202202151016.C0471D6E@keescook>

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 “flexible array members”[1] for these
> > cases. The older style of one-element or zero-length arrays should
> > no longer be used[2].
> > 
> > This code was transformed with the help of Coccinelle:
> > (next-20220214$ spatch --jobs $(getconf _NPROCESSORS_ONLN) --sp-file script.cocci --include-headers --dir . > output.patch)
> > 
> > @@
> > identifier S, member, array;
> > type T1, T2;
> > @@
> > 
> > struct S {
> >   ...
> >   T1 member;
> >   T2 array[
> > - 0
> >   ];
> > };
> 
> 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:
> 
> Reviewed-by: Kees Cook <keescook@chromium.org>

I'll add this to my -next tree.

Thanks!
--
Gustavo

WARNING: multiple messages have this Message-ID (diff)
From: "Gustavo A. R. Silva" <gustavoars@kernel.org>
To: Kees Cook <keescook@chromium.org>
Cc: 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.
Subject: Re: [PATCH][next] treewide: Replace zero-length arrays with flexible-array members
Date: Tue, 15 Feb 2022 13:21:10 -0600	[thread overview]
Message-ID: <20220215192110.GA883653@embeddedor> (raw)
In-Reply-To: <202202151016.C0471D6E@keescook>

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 “flexible array members”[1] for these
> > cases. The older style of one-element or zero-length arrays should
> > no longer be used[2].
> > 
> > This code was transformed with the help of Coccinelle:
> > (next-20220214$ spatch --jobs $(getconf _NPROCESSORS_ONLN) --sp-file script.cocci --include-headers --dir . > output.patch)
> > 
> > @@
> > identifier S, member, array;
> > type T1, T2;
> > @@
> > 
> > struct S {
> >   ...
> >   T1 member;
> >   T2 array[
> > - 0
> >   ];
> > };
> 
> 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:
> 
> Reviewed-by: Kees Cook <keescook@chromium.org>

I'll add this to my -next tree.

Thanks!

  reply	other threads:[~2022-02-15 19:13 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-15 17:47 [PATCH][next] treewide: Replace zero-length arrays with flexible-array members Gustavo A. R. Silva
2022-02-15 17:47 ` Gustavo A. R. Silva
2022-02-15 17:47 ` Gustavo A. R. Silva
2022-02-15 17:47 ` Gustavo A. R. Silva
2022-02-15 17:47 ` [Nouveau] " Gustavo A. R. Silva
2022-02-15 17:47 ` [Intel-gfx] " Gustavo A. R. Silva
2022-02-15 17:47 ` Gustavo A. R. Silva
2022-02-15 17:47 ` Gustavo A. R. Silva
2022-02-15 18:17 ` Kees Cook
2022-02-15 18:17   ` Kees Cook
2022-02-15 18:17   ` Kees Cook
2022-02-15 18:17   ` [Nouveau] " Kees Cook
2022-02-15 18:17   ` Kees Cook
2022-02-15 18:17   ` Kees Cook
2022-02-15 18:17   ` [Intel-gfx] " Kees Cook
2022-02-15 18:17   ` Kees Cook
2022-02-15 19:21   ` Gustavo A. R. Silva [this message]
2022-02-15 19:21     ` Gustavo A. R. Silva
2022-02-15 19:21     ` Gustavo A. R. Silva
2022-02-15 19:21     ` Gustavo A. R. Silva
2022-02-15 19:21     ` [Nouveau] " Gustavo A. R. Silva
2022-02-15 19:21     ` [Intel-gfx] " Gustavo A. R. Silva
2022-02-15 19:21     ` Gustavo A. R. Silva
2022-02-15 19:21     ` Gustavo A. R. Silva
2022-02-15 19:21     ` Gustavo A. R. Silva
2022-02-15 19:19     ` Leon Romanovsky
2022-02-15 19:19       ` Leon Romanovsky
2022-02-15 19:19       ` Leon Romanovsky
2022-02-15 19:19       ` Leon Romanovsky
2022-02-15 19:19       ` Leon Romanovsky
2022-02-15 19:19       ` [Nouveau] " Leon Romanovsky
2022-02-15 19:19       ` Leon Romanovsky
2022-02-15 19:19       ` [Intel-gfx] " Leon Romanovsky
2022-02-15 19:19       ` Leon Romanovsky
2022-02-15 19:32       ` Gustavo A. R. Silva
2022-02-15 19:32         ` Gustavo A. R. Silva
2022-02-15 19:32         ` Gustavo A. R. Silva
2022-02-15 19:32         ` Gustavo A. R. Silva
2022-02-15 19:32         ` [Nouveau] " Gustavo A. R. Silva
2022-02-15 19:32         ` [Intel-gfx] " Gustavo A. R. Silva
2022-02-15 19:32         ` Gustavo A. R. Silva
2022-02-15 19:32         ` Gustavo A. R. Silva
2022-02-15 19:32         ` Gustavo A. R. Silva
2022-02-16 19:05         ` Rafael J. Wysocki
2022-02-16 19:05           ` [Devel] " Rafael J. Wysocki
2022-02-16 19:05           ` Rafael J. Wysocki
2022-02-16 19:05           ` Rafael J. Wysocki
2022-02-16 19:05           ` Rafael J. Wysocki
2022-02-16 19:05           ` [Nouveau] " Rafael J. Wysocki
2022-02-16 19:05           ` Rafael J. Wysocki
2022-02-16 19:05           ` Rafael J. Wysocki
2022-02-16 19:05           ` [Intel-gfx] " Rafael J. Wysocki
2022-02-16 19:05           ` Rafael J. Wysocki
2022-02-16 19:46           ` Gustavo A. R. Silva
2022-02-16 19:46             ` Gustavo A. R. Silva
2022-02-16 19:46             ` Gustavo A. R. Silva
2022-02-16 19:46             ` Gustavo A. R. Silva
2022-02-16 19:46             ` [Nouveau] " Gustavo A. R. Silva
2022-02-16 19:46             ` [Intel-gfx] " Gustavo A. R. Silva
2022-02-16 19:46             ` Gustavo A. R. Silva
2022-02-16 19:46             ` Gustavo A. R. Silva
2022-02-16 19:46             ` Gustavo A. R. Silva
2022-02-15 18:27 ` [next] " bluez.test.bot
2022-02-17  5:44 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2022-02-17  5:47 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2022-02-17  6:19 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-02-17 14:57 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220215192110.GA883653@embeddedor \
    --to=gustavoars@kernel.org \
    --cc=GR-QLogic-Storage-Upstream@marvell.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=coresight@lists.linaro.org \
    --cc=devel@acpica.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=greybus-dev@lists.linaro.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=keescook@chromium.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-alpha@vger.kernel.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-cifs@vger.kernel.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-i3c@lists.infradead.org \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=linux-rpi-kernel@lists.infradead.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=linux-um@lists.infradead.org \
    --cc=linux-xtensa@linux-xtensa.org \
    --cc=mpi3mr-linuxdrv.pdl@broadcom.com \
    --cc=netdev@vger.kernel.org \
    --cc=nouveau@lists.freedesktop.org \
    --cc=samba-technical@lists.samba.org \
    --cc=sparclinux@vger.kernel.org \
    --cc=sparmaintainer@unisys.com \
    --cc=target-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.