* + coredump-add-core_pattern-specifier-for-si_code.patch added to mm-nonmm-unstable branch
@ 2026-04-25 17:09 Andrew Morton
2026-04-27 15:28 ` Christian Brauner
0 siblings, 1 reply; 2+ messages in thread
From: Andrew Morton @ 2026-04-25 17:09 UTC (permalink / raw)
To: mm-commits, viro, skhan, jack, corbet, broonie, brauner,
emanuele.rocca, akpm
The patch titled
Subject: coredump: add core_pattern specifier for si_code
has been added to the -mm mm-nonmm-unstable branch. Its filename is
coredump-add-core_pattern-specifier-for-si_code.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/coredump-add-core_pattern-specifier-for-si_code.patch
This patch will later appear in the mm-nonmm-unstable branch at
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next via various
branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there most days
------------------------------------------------------
From: Emanuele Rocca <emanuele.rocca@arm.com>
Subject: coredump: add core_pattern specifier for si_code
Date: Tue, 17 Mar 2026 16:00:06 +0100
The specifiers supported by core_pattern include the option to indicate
the signal number si_signo by using %s. Other than identifying which
signal generated a core dump (eg: 11 for SIGSEGV), it is useful to know
the reason why a certain signal was sent. The signal code si_code (eg: 2
for SEGV_ACCERR) provides this information.
Adding the signal code to core_pattern can benefit in particular sysadmins
who pipe core dumps to user-space programs for later analysis.
systemd-coredump(8) is a notable example of such programs.
Link: https://lore.kernel.org/ablsdmLsMKm0z5wt@NH27D9T0LF
Signed-off-by: Emanuele Rocca <emanuele.rocca@arm.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Christian Brauner <brauner@kernel.org>
Cc: Jan Kara <jack@suse.cz>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Mark Brown <broonie@kernel.org>
Cc: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
Documentation/admin-guide/sysctl/kernel.rst | 1 +
fs/coredump.c | 5 +++++
2 files changed, 6 insertions(+)
--- a/Documentation/admin-guide/sysctl/kernel.rst~coredump-add-core_pattern-specifier-for-si_code
+++ a/Documentation/admin-guide/sysctl/kernel.rst
@@ -170,6 +170,7 @@ core_pattern
%d dump mode, matches ``PR_SET_DUMPABLE`` and
``/proc/sys/fs/suid_dumpable``
%s signal number
+ %n signal code
%t UNIX time of dump
%h hostname
%e executable filename (may be shortened, could be changed by prctl etc)
--- a/fs/coredump.c~coredump-add-core_pattern-specifier-for-si_code
+++ a/fs/coredump.c
@@ -403,6 +403,11 @@ static bool coredump_parse(struct core_n
err = cn_printf(cn, "%d",
cprm->siginfo->si_signo);
break;
+ /* code of the signal that caused the coredump */
+ case 'n':
+ err = cn_printf(cn, "%d",
+ cprm->siginfo->si_code);
+ break;
/* UNIX time of coredump */
case 't': {
time64_t time;
_
Patches currently in -mm which might be from emanuele.rocca@arm.com are
coredump-add-core_pattern-specifier-for-si_code.patch
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: + coredump-add-core_pattern-specifier-for-si_code.patch added to mm-nonmm-unstable branch
2026-04-25 17:09 + coredump-add-core_pattern-specifier-for-si_code.patch added to mm-nonmm-unstable branch Andrew Morton
@ 2026-04-27 15:28 ` Christian Brauner
0 siblings, 0 replies; 2+ messages in thread
From: Christian Brauner @ 2026-04-27 15:28 UTC (permalink / raw)
To: Andrew Morton
Cc: mm-commits, viro, skhan, jack, corbet, broonie, emanuele.rocca
On Sat, Apr 25, 2026 at 10:09:12AM -0700, Andrew Morton wrote:
>
> The patch titled
> Subject: coredump: add core_pattern specifier for si_code
> has been added to the -mm mm-nonmm-unstable branch. Its filename is
> coredump-add-core_pattern-specifier-for-si_code.patch
>
> This patch will shortly appear at
> https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/coredump-add-core_pattern-specifier-for-si_code.patch
>
> This patch will later appear in the mm-nonmm-unstable branch at
> git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
>
> Before you just go and hit "reply", please:
> a) Consider who else should be cc'ed
> b) Prefer to cc a suitable mailing list as well
> c) Ideally: find the original patch on the mailing list and do a
> reply-to-all to that, adding suitable additional cc's
>
> *** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
>
> The -mm tree is included into linux-next via various
> branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
> and is updated there most days
>
> ------------------------------------------------------
> From: Emanuele Rocca <emanuele.rocca@arm.com>
> Subject: coredump: add core_pattern specifier for si_code
> Date: Tue, 17 Mar 2026 16:00:06 +0100
>
> The specifiers supported by core_pattern include the option to indicate
> the signal number si_signo by using %s. Other than identifying which
> signal generated a core dump (eg: 11 for SIGSEGV), it is useful to know
> the reason why a certain signal was sent. The signal code si_code (eg: 2
> for SEGV_ACCERR) provides this information.
>
> Adding the signal code to core_pattern can benefit in particular sysadmins
> who pipe core dumps to user-space programs for later analysis.
> systemd-coredump(8) is a notable example of such programs.
>
> Link: https://lore.kernel.org/ablsdmLsMKm0z5wt@NH27D9T0LF
> Signed-off-by: Emanuele Rocca <emanuele.rocca@arm.com>
> Cc: Alexander Viro <viro@zeniv.linux.org.uk>
> Cc: Al Viro <viro@zeniv.linux.org.uk>
> Cc: Christian Brauner <brauner@kernel.org>
> Cc: Jan Kara <jack@suse.cz>
> Cc: Jonathan Corbet <corbet@lwn.net>
> Cc: Mark Brown <broonie@kernel.org>
> Cc: Shuah Khan <skhan@linuxfoundation.org>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> ---
commit 701f7f4fbabbf4989ba6fbf033b160dd943221d5
Author: Emanuele Rocca <emanuele.rocca@arm.com>
AuthorDate: Mon Mar 23 14:02:16 2026 +0100
Commit: Christian Brauner <brauner@kernel.org>
CommitDate: Mon Mar 23 16:29:15 2026 +0100
pidfds: add coredump_code field to pidfd_info
Is merged upstream. Two things:
(1) I've clarified that the si_code is supposed to be exposed via the
pidfd and so it has been done. The funneling of endless arguments
via this procfs file will stop.
(2) Andrew, I've reworked fs/coredump.c completely and I'll route
patches as part of the vfs trees. Please just ping me in case I
don't get notified somehow.
In any case, patch upstream. This should be dropped.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-04-27 15:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-25 17:09 + coredump-add-core_pattern-specifier-for-si_code.patch added to mm-nonmm-unstable branch Andrew Morton
2026-04-27 15:28 ` Christian Brauner
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.