Re: [PATCH] pid: Replace struct pid 1-element array with flex-array

From: Jeff Xu
Date: Tue May 30 2023 - 10:45:00 EST


On Thu, May 18, 2023 at 8:07 AM Christian Brauner <brauner@xxxxxxxxxx> wrote:
>
> On Wed, 17 May 2023 15:58:42 -0700, Kees Cook wrote:
> > For pid namespaces, struct pid uses a dynamically sized array member,
> > "numbers". This was implemented using the ancient 1-element fake flexible
> > array, which has been deprecated for decades. Replace it with a C99
> > flexible array, refactor the array size calculations to use struct_size(),
> > and address elements via indexes. Note that the static initializer (which
> > defines a single element) works as-is, and requires no special handling.
> >
> > [...]
>
> Applied to the kernel.fork branch of the brauner/linux.git tree.
> Patches in the kernel.fork branch should appear in linux-next soon.
>
> Please report any outstanding bugs that were missed during review in a
> new review to the original patch series allowing us to drop it.
>
> It's encouraged to provide Acked-bys and Reviewed-bys even though the
> patch has now been applied. If possible patch trailers will be updated.
>
Acked-by: Jeff Xu <jeffxu@xxxxxxxxxx>


> tree: https://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux.git
> branch: kernel.fork
>
> [1/1] pid: Replace struct pid 1-element array with flex-array
> https://git.kernel.org/brauner/linux/c/ad0ff58dc959