Re: [PATCH v8 5/9] pidfs, coredump: add PIDFD_INFO_COREDUMP

From: Jann Horn
Date: Fri May 16 2025 - 10:38:48 EST


On Fri, May 16, 2025 at 1:26 PM Christian Brauner <brauner@xxxxxxxxxx> wrote:
> Extend the PIDFD_INFO_COREDUMP ioctl() with the new PIDFD_INFO_COREDUMP
> mask flag. This adds the @coredump_mask field to struct pidfd_info.
>
> When a task coredumps the kernel will provide the following information
> to userspace in @coredump_mask:
>
> * PIDFD_COREDUMPED is raised if the task did actually coredump.
> * PIDFD_COREDUMP_SKIP is raised if the task skipped coredumping (e.g.,
> undumpable).
> * PIDFD_COREDUMP_USER is raised if this is a regular coredump and
> doesn't need special care by the coredump server.
> * PIDFD_COREDUMP_ROOT is raised if the generated coredump should be
> treated as sensitive and the coredump server should restrict to the
> generated coredump to sufficiently privileged users.
>
> The kernel guarantees that by the time the connection is made the all
> PIDFD_INFO_COREDUMP info is available.
>
> Acked-by: Luca Boccassi <luca.boccassi@xxxxxxxxx>
> Reviewed-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@xxxxxxxxxxxxx>
> Signed-off-by: Christian Brauner <brauner@xxxxxxxxxx>

Reviewed-by: Jann Horn <jannh@xxxxxxxxxx>

Thanks for clarifying the comments!