Re: execve() fails to report errors

Russell King (rmk@arm.linux.org.uk)
Fri, 15 Mar 2002 13:01:33 +0000


On Wed, Mar 06, 2002 at 12:34:37AM +0100, Pavel Machek wrote:
> Now, I do not know if this is the right fix (binfmt_elf looks
> spaghetty to me) but its certainly better than it was.

Here's another fix in this area. If setup_arg_pages() fails, we continue
although nothing went wrong. The following patch kills the process
instead.

Linus/Marcelo - please apply.

--- orig/fs/binfmt_elf.c Fri Mar 15 10:14:29 2002
+++ linux/fs/binfmt_elf.c Mon Mar 11 17:29:03 2002
@@ -585,7 +585,12 @@
/* 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

-- 
Russell King (rmk@arm.linux.org.uk)                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/