From: deraadt Date: Tue, 20 Jun 2017 21:05:46 +0000 (+0000) Subject: use [] instead of * for reaching regions to unmap, making this more X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=93e933124da06ca2a7f5145c500cf6f5e337ba2b;p=openbsd use [] instead of * for reaching regions to unmap, making this more similar to smashing versions written by visa --- diff --git a/sys/arch/amd64/amd64/autoconf.c b/sys/arch/amd64/amd64/autoconf.c index 676c5d962ff..19dcd242fa0 100644 --- a/sys/arch/amd64/amd64/autoconf.c +++ b/sys/arch/amd64/amd64/autoconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.c,v 1.48 2017/05/31 19:18:18 deraadt Exp $ */ +/* $OpenBSD: autoconf.c,v 1.49 2017/06/20 21:05:46 deraadt Exp $ */ /* $NetBSD: autoconf.c,v 1.1 2003/04/26 18:39:26 fvdl Exp $ */ /*- @@ -109,13 +109,13 @@ extern int amd64_has_aesni; void unmap_startup(void) { - extern void *kernel_text, *endboot; - vaddr_t p = (vaddr_t)&kernel_text; + extern int kernel_text[], endboot[]; + vaddr_t p = (vaddr_t)kernel_text; do { pmap_kremove(p, PAGE_SIZE); p += PAGE_SIZE; - } while (p < (vaddr_t)&endboot); + } while (p < (vaddr_t)endboot); } /* diff --git a/sys/arch/i386/i386/autoconf.c b/sys/arch/i386/i386/autoconf.c index b9e101bdc8a..012bf27d13f 100644 --- a/sys/arch/i386/i386/autoconf.c +++ b/sys/arch/i386/i386/autoconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.c,v 1.102 2017/05/31 19:18:18 deraadt Exp $ */ +/* $OpenBSD: autoconf.c,v 1.103 2017/06/20 21:05:46 deraadt Exp $ */ /* $NetBSD: autoconf.c,v 1.20 1996/05/03 19:41:56 christos Exp $ */ /*- @@ -112,13 +112,13 @@ extern int i386_has_xcrypt; void unmap_startup(void) { - extern void *kernel_text, *endboot; - vaddr_t p = (vaddr_t)&kernel_text; + extern int kernel_text[], endboot[]; + vaddr_t p = (vaddr_t)kernel_text; do { pmap_kremove(p, PAGE_SIZE); p += PAGE_SIZE; - } while (p < (vaddr_t)&endboot); + } while (p < (vaddr_t)endboot); } /*