summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormpi <mpi@openbsd.org>2019-11-01 19:33:09 +0000
committermpi <mpi@openbsd.org>2019-11-01 19:33:09 +0000
commit976df6ebfdbf1ebbdd64d4bad81f2377ccbd82b9 (patch)
treed6f54621251ce993c377c9cd2f29c9fb837c29d8
parentKeep local function definitions in C files. (diff)
downloadwireguard-openbsd-976df6ebfdbf1ebbdd64d4bad81f2377ccbd82b9.tar.xz
wireguard-openbsd-976df6ebfdbf1ebbdd64d4bad81f2377ccbd82b9.zip
Push the KERNEL_LOCK() down in uvm_map_inentry().
The lookup in uvm_map_inentry_fix() is already serialized by the vm_map_lock and such lookup is already executed w/o the KERNEL_LOCK(). ok kettenis@, deraadt@
-rw-r--r--sys/uvm/uvm_map.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/uvm/uvm_map.c b/sys/uvm/uvm_map.c
index b805abfc706..89ed1876317 100644
--- a/sys/uvm/uvm_map.c
+++ b/sys/uvm/uvm_map.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_map.c,v 1.248 2019/11/01 19:18:29 mpi Exp $ */
+/* $OpenBSD: uvm_map.c,v 1.249 2019/11/01 19:33:09 mpi Exp $ */
/* $NetBSD: uvm_map.c,v 1.86 2000/11/27 08:40:03 chs Exp $ */
/*
@@ -1872,16 +1872,16 @@ uvm_map_inentry(struct proc *p, struct p_inentry *ie, vaddr_t addr,
boolean_t ok = TRUE;
if (uvm_map_inentry_recheck(serial, addr, ie)) {
- KERNEL_LOCK();
ok = uvm_map_inentry_fix(p, ie, addr, fn, serial);
if (!ok) {
printf(fmt, p->p_p->ps_comm, p->p_p->ps_pid, p->p_tid,
addr, ie->ie_start, ie->ie_end);
+ KERNEL_LOCK();
p->p_p->ps_acflag |= AMAP;
sv.sival_ptr = (void *)PROC_PC(p);
trapsignal(p, SIGSEGV, 0, SEGV_ACCERR, sv);
+ KERNEL_UNLOCK();
}
- KERNEL_UNLOCK();
}
return (ok);
}