summaryrefslogtreecommitdiff
path: root/sys/ddb/db_sym.c
diff options
context:
space:
mode:
authorMike Larkin <mlarkin@cvs.openbsd.org>2014-12-21 16:27:09 +0000
committerMike Larkin <mlarkin@cvs.openbsd.org>2014-12-21 16:27:09 +0000
commit150a3f578c6b989cb035e5529c23c2c7fbeb0ecc (patch)
tree8ee536e92f7dfa6fc1e83b637acb3c9e0e7786be /sys/ddb/db_sym.c
parent6392d14dd0230c01c3c1b5127edee7472380e352 (diff)
Prevent writing to the kernel area via the direct map. We do this by padding
the end of the kernel area to 2MB, so that the direct map pages can then have the W permission removed (X permission was already removed in a previous diff). This creates a VA hole at the end of bss, so adjust for that since that's where symbols get loaded by the bootloader (for now, map that region RO until the boot loader can be updated to place the symbols at "end" instead of "end of bss"). with help from and ok deraadt@
Diffstat (limited to 'sys/ddb/db_sym.c')
-rw-r--r--sys/ddb/db_sym.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/ddb/db_sym.c b/sys/ddb/db_sym.c
index 934fe22dce5..5c209778f85 100644
--- a/sys/ddb/db_sym.c
+++ b/sys/ddb/db_sym.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: db_sym.c,v 1.35 2014/09/14 14:17:24 jsg Exp $ */
+/* $OpenBSD: db_sym.c,v 1.36 2014/12/21 16:27:08 mlarkin Exp $ */
/* $NetBSD: db_sym.c,v 1.24 2000/08/11 22:50:47 tv Exp $ */
/*
@@ -121,13 +121,13 @@ ddb_init(void)
const db_symformat_t **symf;
const char *name = "bsd";
extern char *esym;
-#if defined(__sparc64__) || defined(__mips__)
+#if defined(__sparc64__) || defined(__mips__) || defined(__amd64__)
extern char *ssym;
#endif
char *xssym, *xesym;
xesym = esym;
-#if defined(__sparc64__) || defined(__mips__)
+#if defined(__sparc64__) || defined(__mips__) || defined(__amd64__)
xssym = ssym;
#else
xssym = (char *)&end;