From 65b594ff615422b06a7ae21350c013c6a4131c1f Mon Sep 17 00:00:00 2001 From: ad Date: Wed, 4 Jun 2008 12:16:06 +0000 Subject: [PATCH] Make sure the PAX flags are copied/zeroed correctly. --- sys/kern/kern_exec.c | 5 +++-- sys/sys/proc.h | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index 5775d0bade49..0976b1464353 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -1,4 +1,4 @@ -/* $NetBSD: kern_exec.c,v 1.272 2008/04/24 18:39:24 ad Exp $ */ +/* $NetBSD: kern_exec.c,v 1.273 2008/06/04 12:16:06 ad Exp $ */ /*- * Copyright (C) 1993, 1994, 1996 Christopher G. Demetriou @@ -33,7 +33,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.272 2008/04/24 18:39:24 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.273 2008/06/04 12:16:06 ad Exp $"); #include "opt_ktrace.h" #include "opt_syscall_debug.h" @@ -492,6 +492,7 @@ execve1(struct lwp *l, const char *path, char * const *args, pack.ep_emul_root = NULL; pack.ep_interp = NULL; pack.ep_esch = NULL; + pack.ep_pax_flags = 0; #ifdef LKM rw_enter(&exec_lock, RW_READER); diff --git a/sys/sys/proc.h b/sys/sys/proc.h index 9b122a161773..53ef31581fba 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -1,4 +1,4 @@ -/* $NetBSD: proc.h,v 1.278 2008/06/03 22:14:24 ad Exp $ */ +/* $NetBSD: proc.h,v 1.279 2008/06/04 12:16:06 ad Exp $ */ /*- * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc. @@ -308,6 +308,7 @@ struct proc { size_t p_psnargv; /* :: offset of ps_nargvstr in above */ size_t p_psenv; /* :: offset of ps_envstr in above */ size_t p_psnenv; /* :: offset of ps_nenvstr in above */ + u_int p_pax; /* :: PAX flags */ /* * End area that is copied on creation @@ -318,7 +319,6 @@ struct proc { u_short p_acflag; /* p: Acc. flags; see struct lwp also */ struct mdproc p_md; /* p: Any machine-dependent fields */ vaddr_t p_stackbase; /* :: ASLR randomized stack base */ - u_int p_pax; /* :: PAX flags */ }; #define p_rlimit p_limit->pl_rlimit