summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@redhat.com>2013-06-07 10:09:40 +1000
committerStephen Rothwell <sfr@canb.auug.org.au>2013-06-07 15:43:16 +1000
commitfaf3bf5e946663aca8d48bfcd0ce2e2a9516a47a (patch)
tree406988b97be1e9ea7aa7bf450e2388885e1c34b6
parent045797638915f8d67172d95a732df4bc1f767609 (diff)
coredump: avoid the uninitialized cn->corename if core_pattern is empty
If core_pattern is "" or "|", cn->corename is used uninitialized by filp_open() or call_usermodehelper_exec(). Signed-off-by: Oleg Nesterov <oleg@redhat.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: Colin Walters <walters@verbum.org> Cc: Denys Vlasenko <vda.linux@googlemail.com> Cc: Jiri Slaby <jslaby@suse.cz> Cc: Lennart Poettering <mzxreary@0pointer.de> Cc: Lucas De Marchi <lucas.de.marchi@gmail.com> Cc: Neil Horman <nhorman@tuxdriver.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
-rw-r--r--fs/coredump.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/coredump.c b/fs/coredump.c
index 5968064ecfa8..72f816d6cad9 100644
--- a/fs/coredump.c
+++ b/fs/coredump.c
@@ -165,6 +165,7 @@ static int format_corename(struct core_name *cn, struct coredump_params *cprm)
cn->corename = NULL;
if (expand_corename(cn, core_name_size))
return -ENOMEM;
+ cn->corename[0] = '\0';
if (ispipe)
++pat_ptr;