mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-12-27 11:06:41 -05:00
coredump: show supported coredump modes
Allow userspace to discover what coredump modes are supported. Link: https://lore.kernel.org/20250516-work-coredump-socket-v8-6-664f3caf2516@kernel.org Acked-by: Luca Boccassi <luca.boccassi@gmail.com> Reviewed-by: Jann Horn <jannh@google.com> Reviewed-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com> Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
@@ -1248,6 +1248,12 @@ static int proc_dostring_coredump(const struct ctl_table *table, int write,
|
||||
|
||||
static const unsigned int core_file_note_size_min = CORE_FILE_NOTE_SIZE_DEFAULT;
|
||||
static const unsigned int core_file_note_size_max = CORE_FILE_NOTE_SIZE_MAX;
|
||||
static char core_modes[] = {
|
||||
"file\npipe"
|
||||
#ifdef CONFIG_UNIX
|
||||
"\nsocket"
|
||||
#endif
|
||||
};
|
||||
|
||||
static const struct ctl_table coredump_sysctls[] = {
|
||||
{
|
||||
@@ -1291,6 +1297,13 @@ static const struct ctl_table coredump_sysctls[] = {
|
||||
.extra1 = SYSCTL_ZERO,
|
||||
.extra2 = SYSCTL_ONE,
|
||||
},
|
||||
{
|
||||
.procname = "core_modes",
|
||||
.data = core_modes,
|
||||
.maxlen = sizeof(core_modes) - 1,
|
||||
.mode = 0444,
|
||||
.proc_handler = proc_dostring,
|
||||
},
|
||||
};
|
||||
|
||||
static int __init init_fs_coredump_sysctls(void)
|
||||
|
||||
Reference in New Issue
Block a user