summaryrefslogtreecommitdiff
path: root/sys/uvm
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2023-02-13 14:51:50 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2023-02-13 14:51:50 +0000
commitbeaf2a8bac794ec1341f7b7bafd357544e72d193 (patch)
treeb230478e68782dd8c200d46a1b61192fd4059901 /sys/uvm
parentba4b7025797cf52bff0ba3e4fabb181fc78c9a2a (diff)
Upon fork, copy the copyin_check structure to the new map, otherwise
the xonly rules are not applied a child. This was due to the same misunderstanding as with msyscall a few days ago. ok guenther kettenis
Diffstat (limited to 'sys/uvm')
-rw-r--r--sys/uvm/uvm_map.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/uvm/uvm_map.c b/sys/uvm/uvm_map.c
index 7ee39c71838..620cece4f56 100644
--- a/sys/uvm/uvm_map.c
+++ b/sys/uvm/uvm_map.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_map.c,v 1.310 2023/02/11 21:11:37 deraadt Exp $ */
+/* $OpenBSD: uvm_map.c,v 1.311 2023/02/13 14:51:49 deraadt Exp $ */
/* $NetBSD: uvm_map.c,v 1.86 2000/11/27 08:40:03 chs Exp $ */
/*
@@ -3983,6 +3983,14 @@ uvmspace_fork(struct process *pr)
}
}
new_map->flags |= old_map->flags & VM_MAP_SYSCALL_ONCE;
+#ifdef PMAP_CHECK_COPYIN
+ if (PMAP_CHECK_COPYIN) {
+ memcpy(&new_map->check_copyin, &old_map->check_copyin,
+ sizeof(new_map->check_copyin));
+ membar_producer();
+ new_map->check_copyin_count = old_map->check_copyin_count;
+ }
+#endif
vm_map_unlock(old_map);
vm_map_unlock(new_map);