]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] missing binfmt check
authorDave Jones <davej@suse.de>
Fri, 31 May 2002 03:47:22 +0000 (20:47 -0700)
committerLinus Torvalds <torvalds@penguin.transmeta.com>
Fri, 31 May 2002 03:47:22 +0000 (20:47 -0700)
As per the old comment, this patch adds checking of the return
value of setup_arg_pages() and aborts cleanly. From 2.4
(also a missing GPL tag)

fs/binfmt_elf.c

index 35da43e5f674e2d58d7b3d4319735a0533bcf712..992356ef36b1fc8d63a3a082793f36bf60e8930a 100644 (file)
@@ -607,7 +607,12 @@ static int load_elf_binary(struct linux_binprm * bprm, struct pt_regs * regs)
        /* Do this so that we can load the interpreter, if need be.  We will
           change some of these later */
        current->mm->rss = 0;
-       setup_arg_pages(bprm); /* XXX: check error */
+       retval = setup_arg_pages(bprm);
+       if (retval < 0) {
+               send_sig(SIGKILL, current, 0);
+               return retval;
+       }
+       
        current->mm->start_stack = bprm->p;
 
        /* Now we do a little grungy work by mmaping the ELF image into
@@ -1279,3 +1284,4 @@ static void __exit exit_elf_binfmt(void)
 
 module_init(init_elf_binfmt)
 module_exit(exit_elf_binfmt)
+MODULE_LICENSE("GPL");