Module Name: src
Committed By: maxv
Date: Thu Oct 22 11:48:02 UTC 2015
Modified Files:
src/sys/kern: kern_exec.c
Log Message:
Reset the PaX flags, make sure ep_emul_arg is NULL, and add a comment.
To generate a diff of this commit:
cvs rdiff -u -r1.420 -r1.421 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.420 src/sys/kern/kern_exec.c:1.421
--- src/sys/kern/kern_exec.c:1.420 Tue Oct 13 00:29:34 2015
+++ src/sys/kern/kern_exec.c Thu Oct 22 11:48:02 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_exec.c,v 1.420 2015/10/13 00:29:34 pgoyette Exp $ */
+/* $NetBSD: kern_exec.c,v 1.421 2015/10/22 11:48:02 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.420 2015/10/13 00:29:34 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.421 2015/10/22 11:48:02 maxv Exp $");
#include "opt_exec.h"
#include "opt_execfmt.h"
@@ -450,6 +450,11 @@ check_exec(struct lwp *l, struct exec_pa
return 0;
}
+ /*
+ * Reset all the fields that may have been modified by the
+ * loader.
+ */
+ KASSERT(epp->ep_emul_arg == NULL);
if (epp->ep_emul_root != NULL) {
vrele(epp->ep_emul_root);
epp->ep_emul_root = NULL;
@@ -458,6 +463,7 @@ check_exec(struct lwp *l, struct exec_pa
vrele(epp->ep_interp);
epp->ep_interp = NULL;
}
+ epp->ep_pax_flags = 0;
/* make sure the first "interesting" error code is saved. */
if (error == ENOEXEC)