[PPC64] Fix for 32-bit execve() error path

David Gibson david at gibson.dropbear.id.au
Tue Jan 20 14:55:48 EST 2004

Andrew, please apply.

The patch below fixes a bug in ppc64's 32-bit execve() path.  It
duplicates logic already in the normal fs/exec.c do_execve() to avoid
dropping a NULL mm.  The bprm.mm becomes NULL once the exec passes the
"point of no return".  Without this patch a failure past that point
(e.g. mmap() failure) will cause an oops, with it just a killed

diff -urN ppc64-linux-2.5/arch/ppc64/kernel/sys_ppc32.c linux-gogogo/arch/ppc64/kernel/sys_ppc32.c
--- ppc64-linux-2.5/arch/ppc64/kernel/sys_ppc32.c	2004-01-19 14:20:32.484450172 +1100
+++ linux-gogogo/arch/ppc64/kernel/sys_ppc32.c	2004-01-20 14:15:02.093551035 +1100
@@ -2084,7 +2084,8 @@

-	mmdrop(bprm.mm);
+	if (bprm.mm)
+		mmdrop(bprm.mm);

 	if (bprm.file) {

David Gibson			| For every complex problem there is a
david AT gibson.dropbear.id.au	| solution which is simple, neat and
				| wrong.

** Sent via the linuxppc64-dev mail list. See http://lists.linuxppc.org/

More information about the Linuxppc64-dev mailing list