Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/x86/x86 I realized the changes I made broke the !as...



details:   https://anonhg.NetBSD.org/src/rev/7be7583c1bfd
branches:  trunk
changeset: 320821:7be7583c1bfd
user:      maxv <maxv%NetBSD.org@localhost>
date:      Sat Jul 21 21:26:30 2018 +0000

description:
I realized the changes I made broke the !aslr conf, so enable aslr by
default now rather than later (and rather than adding more ifdefs).

Now the location of the direct map is randomized at boot time in GENERIC.

diffstat:

 sys/arch/x86/x86/pmap.c |  10 +++-------
 1 files changed, 3 insertions(+), 7 deletions(-)

diffs (39 lines):

diff -r db9937c7e3c5 -r 7be7583c1bfd sys/arch/x86/x86/pmap.c
--- a/sys/arch/x86/x86/pmap.c   Sat Jul 21 19:39:44 2018 +0000
+++ b/sys/arch/x86/x86/pmap.c   Sat Jul 21 21:26:30 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.292 2018/07/21 06:09:13 maxv Exp $  */
+/*     $NetBSD: pmap.c,v 1.293 2018/07/21 21:26:30 maxv Exp $  */
 
 /*
  * Copyright (c) 2008, 2010, 2016, 2017 The NetBSD Foundation, Inc.
@@ -170,7 +170,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.292 2018/07/21 06:09:13 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.293 2018/07/21 21:26:30 maxv Exp $");
 
 #include "opt_user_ldt.h"
 #include "opt_lockdebug.h"
@@ -1405,7 +1405,7 @@
 }
 #endif
 
-#if defined(__HAVE_DIRECT_MAP) && defined(X86ASLR)
+#if defined(__HAVE_DIRECT_MAP)
 /*
  * Randomize the location of an area. We count the holes in the VM space. We
  * randomly select one hole, and then randomly select an area within that hole.
@@ -1601,11 +1601,7 @@
                panic("pmap_init_directmap: lastpa incorrect");
        }
 
-#ifdef X86ASLR
        startva = slotspace_rand(SLAREA_DMAP, lastpa, NBPD_L2);
-#else
-       startva = PMAP_DIRECT_DEFAULT_BASE;
-#endif
        endva = startva + lastpa;
 
        /* We will use this temporary va. */



Home | Main Index | Thread Index | Old Index