Account for the VA hole differently (simpler)

This commit is contained in:
christos 2016-05-22 01:09:09 +00:00
parent 2bd2f7a2de
commit 2b0df44082
2 changed files with 5 additions and 7 deletions

View File

@ -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 @@ struct mdproc {
#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 */

View File

@ -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"
@ -481,9 +481,6 @@ pax_aslr_init_vm(struct lwp *l, struct vmspace *vm, struct exec_package *ep)
#ifdef PAX_ASLR_DEBUG
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);