Module Name: src Committed By: maxv Date: Fri Apr 18 11:44:31 UTC 2014
Modified Files: src/sys/kern: kern_exec.c Log Message: 'error' is not set on failure. This is a true bug: everything is freed and unlocked while zero is returned. Since there's no error, execve_runproc() will get called and will try to use those freed things. PS: This bug was here before uebayasi@'s changes To generate a diff of this commit: cvs rdiff -u -r1.402 -r1.403 src/sys/kern/kern_exec.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/kern/kern_exec.c diff -u src/sys/kern/kern_exec.c:1.402 src/sys/kern/kern_exec.c:1.403 --- src/sys/kern/kern_exec.c:1.402 Fri Apr 18 06:59:32 2014 +++ src/sys/kern/kern_exec.c Fri Apr 18 11:44:31 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_exec.c,v 1.402 2014/04/18 06:59:32 uebayasi Exp $ */ +/* $NetBSD: kern_exec.c,v 1.403 2014/04/18 11:44:31 maxv Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -59,7 +59,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.402 2014/04/18 06:59:32 uebayasi Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.403 2014/04/18 11:44:31 maxv Exp $"); #include "opt_exec.h" #include "opt_execfmt.h" @@ -732,6 +732,7 @@ execve_loadvm(struct lwp *l, const char if (len > epp->ep_ssize) { /* in effect, compare to initial limit */ DPRINTF(("%s: stack limit exceeded %zu\n", __func__, len)); + error = ENOMEM; goto bad; } /* adjust "active stack depth" for process VSZ */