diff options
author | 2014-11-27 21:40:52 +0000 | |
---|---|---|
committer | 2014-11-27 21:40:52 +0000 | |
commit | a6cfe1dd47b4235c4be3220e4d4a00a6de741172 (patch) | |
tree | 6c5adbac3e647a61238a901754322142aa1b0f64 | |
parent | Previous change wasn't quite right and broke "classic' PCI sparc64 machines. (diff) | |
download | wireguard-openbsd-a6cfe1dd47b4235c4be3220e4d4a00a6de741172.tar.xz wireguard-openbsd-a6cfe1dd47b4235c4be3220e4d4a00a6de741172.zip |
The sti(4) driver copies its ROM into kernel memory and executes the code
in there. It explicitly changes the mapping of that memory to RX, but this
only works if the maximum protection of the mapping includes PROT_EXEC.
ok miod@, deraadt@
-rw-r--r-- | sys/uvm/uvm_km.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/uvm/uvm_km.c b/sys/uvm/uvm_km.c index d2424c4ea5a..d0f21231d5c 100644 --- a/sys/uvm/uvm_km.c +++ b/sys/uvm/uvm_km.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_km.c,v 1.120 2014/11/21 06:40:40 deraadt Exp $ */ +/* $OpenBSD: uvm_km.c,v 1.121 2014/11/27 21:40:52 kettenis Exp $ */ /* $NetBSD: uvm_km.c,v 1.42 2001/01/14 02:10:01 thorpej Exp $ */ /* @@ -458,7 +458,8 @@ uvm_km_alloc1(struct vm_map *map, vsize_t size, vsize_t align, boolean_t zeroit) /* allocate some virtual space */ if (__predict_false(uvm_map(map, &kva, size, uvm.kernel_object, UVM_UNKNOWN_OFFSET, align, - UVM_MAPFLAG(PROT_READ | PROT_WRITE, PROT_READ | PROT_WRITE, + UVM_MAPFLAG(PROT_READ | PROT_WRITE, + PROT_READ | PROT_WRITE | PROT_EXEC, UVM_INH_NONE, POSIX_MADV_RANDOM, 0)) != 0)) { return(0); } |