diff options
author | Mike Larkin <mlarkin@cvs.openbsd.org> | 2015-08-28 05:00:43 +0000 |
---|---|---|
committer | Mike Larkin <mlarkin@cvs.openbsd.org> | 2015-08-28 05:00:43 +0000 |
commit | c8db614b376e116d0a052e8aef5bf57b7af9c3d0 (patch) | |
tree | 694a6da09c2344823a1a538aae878dd4d3c3b90a | |
parent | 5d513420a7fc3c0221798248e7cd1907078c3630 (diff) |
The PDE covering the APTE space should not confer exec permissions.
ok deraadt
-rw-r--r-- | sys/arch/i386/i386/pmapae.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/arch/i386/i386/pmapae.c b/sys/arch/i386/i386/pmapae.c index 69e0b316023..891f9bddf37 100644 --- a/sys/arch/i386/i386/pmapae.c +++ b/sys/arch/i386/i386/pmapae.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmapae.c,v 1.44 2015/08/25 20:18:44 mlarkin Exp $ */ +/* $OpenBSD: pmapae.c,v 1.45 2015/08/28 05:00:42 mlarkin Exp $ */ /* * Copyright (c) 2006-2008 Michael Shalayeff @@ -695,6 +695,10 @@ pmap_bootstrap_pae(void) PDE(kpm, pdei(va)) = pte | PG_NX; } + va = (vaddr_t)APTE_BASE; + pte = PDE(kpm, pdei(va)); + PDE(kpm, pdei(va)) = pte | PG_NX; + pmap_write_protect(kpm, (vaddr_t)&kernel_text, (vaddr_t)&etext, PROT_READ | PROT_EXEC); pmap_write_protect(kpm, (vaddr_t)&__rodata_start, |