summaryrefslogtreecommitdiffstats
path: root/fs/exec.c
diff options
context:
space:
mode:
authorTetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>2009-01-06 23:41:11 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2009-01-07 00:59:14 +0100
commit350eaf791bebccb9ad5999351f3e328319545f03 (patch)
tree7a9b18b1c2ab34cf62ae5862fbf1cc629ed383fa /fs/exec.c
parentprofile: don't include <asm/ptrace.h> twice. (diff)
downloadlinux-350eaf791bebccb9ad5999351f3e328319545f03.tar.xz
linux-350eaf791bebccb9ad5999351f3e328319545f03.zip
do_coredump(): check return from argv_split()
do_coredump() accesses helper_argv[0] without checking helper_argv != NULL. This can happen if page allocation failed. Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/exec.c')
-rw-r--r--fs/exec.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/exec.c b/fs/exec.c
index 6ca4e3d22a3d..6b09d6fa4f7e 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -1770,6 +1770,11 @@ int do_coredump(long signr, int exit_code, struct pt_regs * regs)
if (ispipe) {
helper_argv = argv_split(GFP_KERNEL, corename+1, &helper_argc);
+ if (!helper_argv) {
+ printk(KERN_WARNING "%s failed to allocate memory\n",
+ __func__);
+ goto fail_unlock;
+ }
/* Terminate the string before the first option */
delimit = strchr(corename, ' ');
if (delimit)