Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys rename DEBUG_ASLR -> PAX_ASLR_DEBUG
details: https://anonhg.NetBSD.org/src/rev/93964316ccf8
branches: trunk
changeset: 753108:93964316ccf8
user: christos <christos%NetBSD.org@localhost>
date: Mon Mar 15 20:35:19 2010 +0000
description:
rename DEBUG_ASLR -> PAX_ASLR_DEBUG
diffstat:
sys/conf/files | 3 ++-
sys/kern/exec_elf.c | 10 +++++-----
sys/kern/kern_pax.c | 12 ++++++------
3 files changed, 13 insertions(+), 12 deletions(-)
diffs (107 lines):
diff -r 6266db3b078d -r 93964316ccf8 sys/conf/files
--- a/sys/conf/files Mon Mar 15 20:02:55 2010 +0000
+++ b/sys/conf/files Mon Mar 15 20:35:19 2010 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: files,v 1.982 2010/03/13 08:33:26 darran Exp $
+# $NetBSD: files,v 1.983 2010/03/15 20:35:19 christos Exp $
# @(#)files.newconf 7.5 (Berkeley) 5/10/93
version 20090313
@@ -109,6 +109,7 @@
PAX_ASLR_DELTA_STACK_LSB
PAX_ASLR_DELTA_STACK_LEN
PAX_ASLR_DELTA_PROG_LEN
+ PAX_ASLR_DEBUG
defflag opt_fileassoc.h FILEASSOC
diff -r 6266db3b078d -r 93964316ccf8 sys/kern/exec_elf.c
--- a/sys/kern/exec_elf.c Mon Mar 15 20:02:55 2010 +0000
+++ b/sys/kern/exec_elf.c Mon Mar 15 20:35:19 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: exec_elf.c,v 1.13 2010/02/22 19:46:18 drochner Exp $ */
+/* $NetBSD: exec_elf.c,v 1.14 2010/03/15 20:35:20 christos Exp $ */
/*-
* Copyright (c) 1994, 2000, 2005 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(1, "$NetBSD: exec_elf.c,v 1.13 2010/02/22 19:46:18 drochner Exp $");
+__KERNEL_RCSID(1, "$NetBSD: exec_elf.c,v 1.14 2010/03/15 20:35:20 christos Exp $");
#ifdef _KERNEL_OPT
#include "opt_pax.h"
@@ -139,18 +139,18 @@
if (pax_align == 0)
pax_align = PGSHIFT;
-#ifdef DEBUG_ASLR
+#ifdef PAX_ASLR_DEBUG
uprintf("r=0x%x a=0x%x p=0x%x Delta=0x%lx\n", r,
ilog2(pax_align), PGSHIFT, PAX_ASLR_DELTA(r,
ilog2(pax_align), PAX_ASLR_DELTA_EXEC_LEN));
#endif
pax_offset = ELF_TRUNC(PAX_ASLR_DELTA(r,
- ilog2(pax_align), PAX_ASLR_DELTA_EXEC_LEN), pax_align);
+ ilog2(pax_align), PAX_ASLR_DELTA_EXEC_LEN), pax_align) + PAGE_SIZE;
for (i = 0; i < eh->e_phnum; i++)
ph[i].p_vaddr += pax_offset;
eh->e_entry += pax_offset;
-#ifdef DEBUG_ASLR
+#ifdef PAX_ASLR_DEBUG
uprintf("pax offset=0x%zx entry=0x%llx\n",
pax_offset, (unsigned long long)eh->e_entry);
#endif
diff -r 6266db3b078d -r 93964316ccf8 sys/kern/kern_pax.c
--- a/sys/kern/kern_pax.c Mon Mar 15 20:02:55 2010 +0000
+++ b/sys/kern/kern_pax.c Mon Mar 15 20:35:19 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_pax.c,v 1.22 2008/06/04 12:26:20 ad Exp $ */
+/* $NetBSD: kern_pax.c,v 1.23 2010/03/15 20:35:20 christos Exp $ */
/*-
* Copyright (c) 2006 Elad Efrat <elad%NetBSD.org@localhost>
@@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_pax.c,v 1.22 2008/06/04 12:26:20 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_pax.c,v 1.23 2010/03/15 20:35:20 christos Exp $");
#include "opt_pax.h"
@@ -321,7 +321,7 @@
return;
if (!(f & MAP_FIXED) && ((orig_addr == 0) || !(f & MAP_ANON))) {
-#ifdef DEBUG_ASLR
+#ifdef PAX_ASLR_DEBUG
uprintf("applying to 0x%lx orig_addr=0x%lx f=%x\n",
(unsigned long)*addr, (unsigned long)orig_addr, f);
#endif
@@ -329,11 +329,11 @@
*addr += l->l_proc->p_vmspace->vm_aslr_delta_mmap;
else
*addr -= l->l_proc->p_vmspace->vm_aslr_delta_mmap;
-#ifdef DEBUG_ASLR
+#ifdef PAX_ASLR_DEBUG
uprintf("result 0x%lx\n", *addr);
#endif
}
-#ifdef DEBUG_ASLR
+#ifdef PAX_ASLR_DEBUG
else
uprintf("not applying to 0x%lx orig_addr=0x%lx f=%x\n",
(unsigned long)*addr, (unsigned long)orig_addr, f);
@@ -347,7 +347,7 @@
u_long d = PAX_ASLR_DELTA(arc4random(),
PAX_ASLR_DELTA_STACK_LSB,
PAX_ASLR_DELTA_STACK_LEN);
-#ifdef DEBUG_ASLR
+#ifdef PAX_ASLR_DEBUG
uprintf("stack 0x%lx d=0x%lx 0x%lx\n",
epp->ep_minsaddr, d, epp->ep_minsaddr - d);
#endif
Home |
Main Index |
Thread Index |
Old Index