summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorkettenis <kettenis@openbsd.org>2016-09-01 09:05:37 +0000
committerkettenis <kettenis@openbsd.org>2016-09-01 09:05:37 +0000
commit42c31fbc77c23a168c65b2a26b2eea10c3e06afc (patch)
tree8f417a431373223c65197631c0f6d653ff2a8840 /sys
parentvarious cleanup; (diff)
downloadwireguard-openbsd-42c31fbc77c23a168c65b2a26b2eea10c3e06afc.tar.xz
wireguard-openbsd-42c31fbc77c23a168c65b2a26b2eea10c3e06afc.zip
Avoid mapping the vector page W|X. Map it using PROT_READ|PROT_WRITE
initially and change it to PROT_READ|PROT_EXEC as soon as we have called pmap_bootstrap(), at which piint we're done modifying the page. ok jsg@, deraadt@, patrick@
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/armv7/armv7/armv7_machdep.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/arch/armv7/armv7/armv7_machdep.c b/sys/arch/armv7/armv7/armv7_machdep.c
index a2543c6f1bf..afd7ca2e36d 100644
--- a/sys/arch/armv7/armv7/armv7_machdep.c
+++ b/sys/arch/armv7/armv7/armv7_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: armv7_machdep.c,v 1.38 2016/08/26 11:59:04 kettenis Exp $ */
+/* $OpenBSD: armv7_machdep.c,v 1.39 2016/09/01 09:05:37 kettenis Exp $ */
/* $NetBSD: lubbock_machdep.c,v 1.2 2003/07/15 00:25:06 lukem Exp $ */
/*
@@ -673,7 +673,7 @@ initarm(void *arg0, void *arg1, void *arg2)
/* Map the vector page. */
pmap_map_entry(l1pagetable, vector_page, systempage.pv_pa,
- PROT_READ | PROT_WRITE | PROT_EXEC, PTE_CACHE);
+ PROT_READ | PROT_WRITE, PTE_CACHE);
/* Map the FDT. */
pmap_map_chunk(l1pagetable, fdt.pv_va, fdt.pv_pa,
@@ -774,6 +774,8 @@ initarm(void *arg0, void *arg1, void *arg2)
pmap_bootstrap((pd_entry_t *)kernel_l1pt.pv_va, KERNEL_VM_BASE,
KERNEL_VM_BASE + KERNEL_VM_SIZE);
+ vector_page_setprot(PROT_READ | PROT_EXEC);
+
/*
* Restore proper bus_space operation, now that pmap is initialized.
*/