Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys Small changes:
details: https://anonhg.NetBSD.org/src/rev/f8f3e5a3909a
branches: trunk
changeset: 339625:f8f3e5a3909a
user: maxv <maxv%NetBSD.org@localhost>
date: Fri Jul 31 07:37:17 2015 +0000
description:
Small changes:
- rename pax_aslr_init() to pax_aslr_init_vm()
- remove the PAX_ flags (unused)
- fix a comment in pax.h
diffstat:
sys/kern/kern_exec.c | 6 +++---
sys/kern/kern_pax.c | 16 ++++------------
sys/sys/pax.h | 6 +++---
3 files changed, 10 insertions(+), 18 deletions(-)
diffs (105 lines):
diff -r 90277e8f3a7e -r f8f3e5a3909a sys/kern/kern_exec.c
--- a/sys/kern/kern_exec.c Fri Jul 31 04:02:40 2015 +0000
+++ b/sys/kern/kern_exec.c Fri Jul 31 07:37:17 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_exec.c,v 1.412 2014/12/14 23:49:28 chs Exp $ */
+/* $NetBSD: kern_exec.c,v 1.413 2015/07/31 07:37:17 maxv Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.412 2014/12/14 23:49:28 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.413 2015/07/31 07:37:17 maxv Exp $");
#include "opt_exec.h"
#include "opt_execfmt.h"
@@ -1123,7 +1123,7 @@
vm->vm_minsaddr = (void *)epp->ep_minsaddr;
#ifdef PAX_ASLR
- pax_aslr_init(l, vm);
+ pax_aslr_init_vm(l, vm);
#endif /* PAX_ASLR */
/* Now map address space. */
diff -r 90277e8f3a7e -r f8f3e5a3909a sys/kern/kern_pax.c
--- a/sys/kern/kern_pax.c Fri Jul 31 04:02:40 2015 +0000
+++ b/sys/kern/kern_pax.c Fri Jul 31 07:37:17 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_pax.c,v 1.29 2015/07/30 15:28:18 maxv Exp $ */
+/* $NetBSD: kern_pax.c,v 1.30 2015/07/31 07:37:17 maxv 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.29 2015/07/30 15:28:18 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_pax.c,v 1.30 2015/07/31 07:37:17 maxv Exp $");
#include "opt_pax.h"
@@ -144,14 +144,6 @@
static void pax_segvguard_cb(void *);
#endif /* PAX_SEGVGUARD */
-/* PaX internal setspecific flags */
-#define PAX_MPROTECT_EXPLICIT_ENABLE (void *)0x01
-#define PAX_MPROTECT_EXPLICIT_DISABLE (void *)0x02
-#define PAX_SEGVGUARD_EXPLICIT_ENABLE (void *)0x03
-#define PAX_SEGVGUARD_EXPLICIT_DISABLE (void *)0x04
-#define PAX_ASLR_EXPLICIT_ENABLE (void *)0x05
-#define PAX_ASLR_EXPLICIT_DISABLE (void *)0x06
-
SYSCTL_SETUP(sysctl_security_pax_setup, "sysctl security.pax setup")
{
const struct sysctlnode *rnode = NULL, *cnode;
@@ -380,7 +372,7 @@
}
void
-pax_aslr_init(struct lwp *l, struct vmspace *vm)
+pax_aslr_init_vm(struct lwp *l, struct vmspace *vm)
{
if (!pax_aslr_active(l))
return;
@@ -413,7 +405,7 @@
pax_aslr_stack(struct lwp *l, struct exec_package *epp, u_long *max_stack_size)
{
if (pax_aslr_active(l)) {
- u_long d = PAX_ASLR_DELTA(cprng_fast32(),
+ u_long d = PAX_ASLR_DELTA(cprng_fast32(),
PAX_ASLR_DELTA_STACK_LSB,
PAX_ASLR_DELTA_STACK_LEN);
PAX_DPRINTF("stack 0x%lx d=0x%lx 0x%lx",
diff -r 90277e8f3a7e -r f8f3e5a3909a sys/sys/pax.h
--- a/sys/sys/pax.h Fri Jul 31 04:02:40 2015 +0000
+++ b/sys/sys/pax.h Fri Jul 31 07:37:17 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pax.h,v 1.12 2015/07/30 15:28:18 maxv Exp $ */
+/* $NetBSD: pax.h,v 1.13 2015/07/31 07:37:17 maxv Exp $ */
/*-
* Copyright (c) 2006 Elad Efrat <elad%NetBSD.org@localhost>
@@ -38,7 +38,7 @@
#ifdef PAX_ASLR
/*
- * We stick this here because we need it in kern/exec_elf32.c for now.
+ * We stick this here because we need it in kern/exec_elf.c for now.
*/
#ifndef PAX_ASLR_DELTA_EXEC_LEN
#define PAX_ASLR_DELTA_EXEC_LEN 12
@@ -59,7 +59,7 @@
#define PAX_ASLR_DELTA(delta, lsb, len) \
(((delta) & ((1UL << (len)) - 1)) << (lsb))
bool pax_aslr_active(struct lwp *);
-void pax_aslr_init(struct lwp *, struct vmspace *);
+void pax_aslr_init_vm(struct lwp *, struct vmspace *);
void pax_aslr_stack(struct lwp *, struct exec_package *, u_long *);
void pax_aslr(struct lwp *, vaddr_t *, vaddr_t, int);
Home |
Main Index |
Thread Index |
Old Index