From: Andrew Morton <akpm@linux-foundation.org>
To: mm-commits@vger.kernel.org,viro@zeniv.linux.org.uk,skhan@linuxfoundation.org,jack@suse.cz,corbet@lwn.net,broonie@kernel.org,brauner@kernel.org,emanuele.rocca@arm.com,akpm@linux-foundation.org
Subject: + coredump-add-core_pattern-specifier-for-si_code.patch added to mm-nonmm-unstable branch
Date: Sat, 25 Apr 2026 10:09:12 -0700 [thread overview]
Message-ID: <20260425170913.63E9CC2BCB0@smtp.kernel.org> (raw)
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
next reply other threads:[~2026-04-25 17:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-25 17:09 Andrew Morton [this message]
2026-04-27 15:28 ` + coredump-add-core_pattern-specifier-for-si_code.patch added to mm-nonmm-unstable branch Christian Brauner
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=20260425170913.63E9CC2BCB0@smtp.kernel.org \
--to=akpm@linux-foundation.org \
--cc=brauner@kernel.org \
--cc=broonie@kernel.org \
--cc=corbet@lwn.net \
--cc=emanuele.rocca@arm.com \
--cc=jack@suse.cz \
--cc=mm-commits@vger.kernel.org \
--cc=skhan@linuxfoundation.org \
--cc=viro@zeniv.linux.org.uk \
/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.