Module Name:    src
Committed By:   maxv
Date:           Sat Sep 17 12:09:23 UTC 2016

Modified Files:
        src/sys/kern: init_main.c

Log Message:
This is just a temporary stack that holds fake arguments, and that gets
remapped as RW in sys_execve. Still, in this small window, it does not need
to be executable.


To generate a diff of this commit:
cvs rdiff -u -r1.482 -r1.483 src/sys/kern/init_main.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/init_main.c
diff -u src/sys/kern/init_main.c:1.482 src/sys/kern/init_main.c:1.483
--- src/sys/kern/init_main.c:1.482	Thu Jul  7 06:55:43 2016
+++ src/sys/kern/init_main.c	Sat Sep 17 12:09:22 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: init_main.c,v 1.482 2016/07/07 06:55:43 msaitoh Exp $	*/
+/*	$NetBSD: init_main.c,v 1.483 2016/09/17 12:09:22 maxv Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -97,7 +97,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.482 2016/07/07 06:55:43 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.483 2016/09/17 12:09:22 maxv Exp $");
 
 #include "opt_ddb.h"
 #include "opt_inet.h"
@@ -931,10 +931,10 @@ start_init(void *arg)
 	 */
 	addr = (vaddr_t)STACK_ALLOC(USRSTACK, PAGE_SIZE);
 	if (uvm_map(&p->p_vmspace->vm_map, &addr, PAGE_SIZE,
-                    NULL, UVM_UNKNOWN_OFFSET, 0,
-                    UVM_MAPFLAG(UVM_PROT_ALL, UVM_PROT_ALL, UVM_INH_COPY,
-		    UVM_ADV_NORMAL,
-                    UVM_FLAG_FIXED|UVM_FLAG_OVERLAY|UVM_FLAG_COPYONW)) != 0)
+	    NULL, UVM_UNKNOWN_OFFSET, 0,
+	    UVM_MAPFLAG(UVM_PROT_RW, UVM_PROT_RW, UVM_INH_COPY,
+	    UVM_ADV_NORMAL,
+	    UVM_FLAG_FIXED|UVM_FLAG_OVERLAY|UVM_FLAG_COPYONW)) != 0)
 		panic("init: couldn't allocate argument space");
 	p->p_vmspace->vm_maxsaddr = (void *)STACK_MAX(addr, PAGE_SIZE);
 

Reply via email to