Source-Changes-HG archive

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

[src/trunk]: src/sys/kern Expose addresses depending on the KASLR setting (fr...



details:   https://anonhg.NetBSD.org/src/rev/b290fb7491bb
branches:  trunk
changeset: 446370:b290fb7491bb
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Dec 03 00:11:02 2018 +0000

description:
Expose addresses depending on the KASLR setting (from mrg@). Restores the
status quo of exposing kernel addresses if there is no KASLR.

diffstat:

 sys/kern/files.kern    |  3 ++-
 sys/kern/init_sysctl.c |  9 +++++++--
 2 files changed, 9 insertions(+), 3 deletions(-)

diffs (53 lines):

diff -r 1ba60689d2d1 -r b290fb7491bb sys/kern/files.kern
--- a/sys/kern/files.kern       Sun Dec 02 21:00:13 2018 +0000
+++ b/sys/kern/files.kern       Mon Dec 03 00:11:02 2018 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.kern,v 1.26 2018/12/02 21:00:13 maxv Exp $
+#      $NetBSD: files.kern,v 1.27 2018/12/03 00:11:02 christos Exp $
 
 #
 # kernel sources
@@ -6,6 +6,7 @@
 define kern:   machdep, uvm
 defflag        opt_kern.h                      KERN
 defflag        opt_script.h                    SETUIDSCRIPTS FDSCRIPTS
+defflag                                        KASLR
 file   compat/common/compat_util.c     kern
 file   compat/common/compat_mod.c      compat_netbsd | compat_netbsd32
 file   conf/debugsyms.c                kern
diff -r 1ba60689d2d1 -r b290fb7491bb sys/kern/init_sysctl.c
--- a/sys/kern/init_sysctl.c    Sun Dec 02 21:00:13 2018 +0000
+++ b/sys/kern/init_sysctl.c    Mon Dec 03 00:11:02 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: init_sysctl.c,v 1.219 2018/11/24 17:26:27 maxv Exp $ */
+/*     $NetBSD: init_sysctl.c,v 1.220 2018/12/03 00:11:02 christos Exp $ */
 
 /*-
  * Copyright (c) 2003, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -30,12 +30,13 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: init_sysctl.c,v 1.219 2018/11/24 17:26:27 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: init_sysctl.c,v 1.220 2018/12/03 00:11:02 christos Exp $");
 
 #include "opt_sysv.h"
 #include "opt_compat_netbsd.h"
 #include "opt_modular.h"
 #include "opt_gprof.h"
+#include "opt_kaslr.h"
 #include "pty.h"
 
 #include <sys/types.h>
@@ -85,7 +86,11 @@
 int kern_has_sysvshm = 0;
 int kern_has_sysvsem = 0;
 
+#ifdef KASLR
 int kern_expose_address = 0;
+#else
+int kern_expose_address = 1;
+#endif
 
 static const u_int sysctl_lwpprflagmap[] = {
        LPR_DETACHED, L_DETACHED,



Home | Main Index | Thread Index | Old Index