Source-Changes-HG archive

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

[src/trunk]: src/sys Account for the VA hole differently (simpler)



details:   https://anonhg.NetBSD.org/src/rev/8660530ac1fb
branches:  trunk
changeset: 345362:8660530ac1fb
user:      christos <christos%NetBSD.org@localhost>
date:      Sun May 22 01:09:09 2016 +0000

description:
Account for the VA hole differently (simpler)

diffstat:

 sys/arch/sparc64/include/proc.h |  5 +++--
 sys/kern/kern_pax.c             |  7 ++-----
 2 files changed, 5 insertions(+), 7 deletions(-)

diffs (46 lines):

diff -r 40e53adb270e -r 8660530ac1fb sys/arch/sparc64/include/proc.h
--- a/sys/arch/sparc64/include/proc.h   Sat May 21 21:07:43 2016 +0000
+++ b/sys/arch/sparc64/include/proc.h   Sun May 22 01:09:09 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: proc.h,v 1.15 2016/05/19 15:36:35 christos Exp $ */
+/*     $NetBSD: proc.h,v 1.16 2016/05/22 01:09:09 christos Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -60,6 +60,7 @@
 
 #define netbsd32_syscall_intern syscall_intern
 
-#define PAX_ASLR_RAND_MMAP_MAX 0x40000
+/* Override to account for the VA hole */
+#define        PAX_ASLR_DELTA_MMAP_LEN 18
 
 #endif /* _SPARC64_PROC_H */
diff -r 40e53adb270e -r 8660530ac1fb sys/kern/kern_pax.c
--- a/sys/kern/kern_pax.c       Sat May 21 21:07:43 2016 +0000
+++ b/sys/kern/kern_pax.c       Sun May 22 01:09:09 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_pax.c,v 1.47 2016/05/19 21:39:15 christos Exp $   */
+/*     $NetBSD: kern_pax.c,v 1.48 2016/05/22 01:09:09 christos Exp $   */
 
 /*
  * Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_pax.c,v 1.47 2016/05/19 21:39:15 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_pax.c,v 1.48 2016/05/22 01:09:09 christos Exp $");
 
 #include "opt_pax.h"
 
@@ -482,9 +482,6 @@
        if (pax_aslr_flags & PAX_ASLR_FIXED)
                rand = pax_aslr_rand;
 #endif
-#ifdef PAX_ASLR_RAND_MMAP_MAX
-       rand &= PAX_ASLR_RAND_MMAP_MAX - 1;
-#endif
        vm->vm_aslr_delta_mmap = PAX_ASLR_DELTA(rand,
            PAX_ASLR_DELTA_MMAP_LSB, len);
 



Home | Main Index | Thread Index | Old Index