Commit 71ce92f3 authored by Dan Aloni's avatar Dan Aloni Committed by Linus Torvalds

make sysctl/kernel/core_pattern and fs/exec.c agree on maximum core filename size

Make sysctl/kernel/core_pattern and fs/exec.c agree on maximum core
filename size and change it to 128, so that extensive patterns such as
'/local/cores/%e-%h-%s-%t-%p.core' won't result in truncated filename
generation.
Signed-off-by: default avatarDan Aloni <da-x@monatomic.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent bc88d5d4
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
#endif #endif
int core_uses_pid; int core_uses_pid;
char core_pattern[128] = "core"; char core_pattern[CORENAME_MAX_SIZE] = "core";
int suid_dumpable = 0; int suid_dumpable = 0;
EXPORT_SYMBOL(suid_dumpable); EXPORT_SYMBOL(suid_dumpable);
...@@ -1264,8 +1264,6 @@ int set_binfmt(struct linux_binfmt *new) ...@@ -1264,8 +1264,6 @@ int set_binfmt(struct linux_binfmt *new)
EXPORT_SYMBOL(set_binfmt); EXPORT_SYMBOL(set_binfmt);
#define CORENAME_MAX_SIZE 64
/* format_corename will inspect the pattern parameter, and output a /* format_corename will inspect the pattern parameter, and output a
* name into corename, which must have space for at least * name into corename, which must have space for at least
* CORENAME_MAX_SIZE bytes plus one byte for the zero terminator. * CORENAME_MAX_SIZE bytes plus one byte for the zero terminator.
......
...@@ -17,6 +17,8 @@ struct pt_regs; ...@@ -17,6 +17,8 @@ struct pt_regs;
#ifdef __KERNEL__ #ifdef __KERNEL__
#define CORENAME_MAX_SIZE 128
/* /*
* This structure is used to hold the arguments that are used when loading binaries. * This structure is used to hold the arguments that are used when loading binaries.
*/ */
......
...@@ -227,7 +227,7 @@ static ctl_table kern_table[] = { ...@@ -227,7 +227,7 @@ static ctl_table kern_table[] = {
.ctl_name = KERN_CORE_PATTERN, .ctl_name = KERN_CORE_PATTERN,
.procname = "core_pattern", .procname = "core_pattern",
.data = core_pattern, .data = core_pattern,
.maxlen = 128, .maxlen = CORENAME_MAX_SIZE,
.mode = 0644, .mode = 0644,
.proc_handler = &proc_dostring, .proc_handler = &proc_dostring,
.strategy = &sysctl_string, .strategy = &sysctl_string,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment