summaryrefslogtreecommitdiff
path: root/sys/uvm/uvm_map.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2023-01-24 00:14:31 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2023-01-24 00:14:31 +0000
commit88323d6ed28c38c09d7275d9f20912d9fb9f75b9 (patch)
tree433cd6a034721fc7e2b08e8b62ed45c5766595d3 /sys/uvm/uvm_map.c
parent29ee0b3c1ea9c88282488cc51fa3cefebe9fe5cb (diff)
uvm_map_extract() UVM_EXTRACT_FIXPROT alias mappings are only used for
read/write operations, so mask out PROT_EXEC to avoid creating an pointless exec mapping in the kernel. We probably need this masking upon minprot (for the non-UVM_EXTRACT_FIXPROT case) also, but I haven't done a test yet. ok kettenis
Diffstat (limited to 'sys/uvm/uvm_map.c')
-rw-r--r--sys/uvm/uvm_map.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/uvm/uvm_map.c b/sys/uvm/uvm_map.c
index b59fb8d73af..95a7fb2ab4d 100644
--- a/sys/uvm/uvm_map.c
+++ b/sys/uvm/uvm_map.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_map.c,v 1.305 2022/12/18 23:41:17 deraadt Exp $ */
+/* $OpenBSD: uvm_map.c,v 1.306 2023/01/24 00:14:30 deraadt Exp $ */
/* $NetBSD: uvm_map.c,v 1.86 2000/11/27 08:40:03 chs Exp $ */
/*
@@ -4470,7 +4470,8 @@ uvm_map_extract(struct vm_map *srcmap, vaddr_t start, vsize_t len,
}
kernel_map->size += cp_len;
if (flags & UVM_EXTRACT_FIXPROT)
- newentry->protection = newentry->max_protection;
+ newentry->protection = newentry->max_protection &
+ ~PROT_MAX;
/*
* Step 2: perform pmap copy.