Re: [PATCH] coredump: add core_pattern specifier for si_code

From: Christian Brauner

Date: Thu Mar 19 2026 - 06:31:49 EST


On Wed, Mar 18, 2026 at 02:17:31PM +0100, Emanuele Rocca wrote:
> Hi Christian,
>
> On 2026-03-18 10:45, Christian Brauner wrote:
> > Request %F which installs pidfd for the coredumping process into the
> > coredump helper then use the pidfd info ioctl in you binary with
> > PIDFD_INFO_EXIT | PIDFD_INFO_COREDUMP and you can retrieve the exit
> > status including the signal that was sent to the process.
>
> Correct me if I'm wrong, but PIDFD_INFO_COREDUMP seems to be setting
> coredump_signal, which is siginfo->si_signo? That information is already
> available by using the %s core_pattern specifier anyways.
>
> What I am looking for is si_code instead. Perhaps a field could be added
> to struct pidfs_attr and set in fs/pidfs.c similarly to what is currently
> done for si_signo?

I see. I don't have a problem with doing that. Let's rope in @Jann and
@Oleg to see whether they have any info-leak/security concerns around
this.