]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
coredump: avoid the uninitialized cn->corename if core_pattern is empty
authorOleg Nesterov <oleg@redhat.com>
Wed, 19 Jun 2013 00:08:20 +0000 (10:08 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 19 Jun 2013 07:27:40 +0000 (17:27 +1000)
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>
fs/coredump.c

index 5968064ecfa8a7f5a0b764d4aa5e08f5249bf5b9..72f816d6cad99d4d1f81433e928d42e540295188 100644 (file)
@@ -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;