Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern Reset the PaX flags, make sure ep_emul_arg is NULL, ...



details:   https://anonhg.NetBSD.org/src/rev/257336d7ad1c
branches:  trunk
changeset: 341164:257336d7ad1c
user:      maxv <maxv%NetBSD.org@localhost>
date:      Thu Oct 22 11:48:02 2015 +0000

description:
Reset the PaX flags, make sure ep_emul_arg is NULL, and add a comment.

diffstat:

 sys/kern/kern_exec.c |  10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diffs (38 lines):

diff -r 7a8aefd89928 -r 257336d7ad1c sys/kern/kern_exec.c
--- a/sys/kern/kern_exec.c      Thu Oct 22 11:38:51 2015 +0000
+++ b/sys/kern/kern_exec.c      Thu Oct 22 11:48:02 2015 +0000
@@ -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 @@
                        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 @@
                        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)



Home | Main Index | Thread Index | Old Index