summaryrefslogtreecommitdiff
path: root/sys/arch/mips64
diff options
context:
space:
mode:
authorvisa <visa@cvs.openbsd.org>2015-07-19 17:00:40 +0000
committervisa <visa@cvs.openbsd.org>2015-07-19 17:00:40 +0000
commita13fa911b97c0db882e9301103c8944474e2cf7b (patch)
tree8380167800f44838975b237da4edfb948ed9c989 /sys/arch/mips64
parentb597e063465f25f6f640f4f9e66d3f9ffa2fa1c2 (diff)
Add proper kernel locking in the fpe_branch_emulate() function, to
prevent race conditions that could corrupt amap entries, among other things. ok miod@ pirofti@
Diffstat (limited to 'sys/arch/mips64')
-rw-r--r--sys/arch/mips64/mips64/trap.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/arch/mips64/mips64/trap.c b/sys/arch/mips64/mips64/trap.c
index dcdb6b4c467..47dc02ba01f 100644
--- a/sys/arch/mips64/mips64/trap.c
+++ b/sys/arch/mips64/mips64/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.106 2015/06/05 16:35:24 deraadt Exp $ */
+/* $OpenBSD: trap.c,v 1.107 2015/07/19 17:00:39 visa Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -1520,8 +1520,10 @@ fpe_branch_emulate(struct proc *p, struct trap_frame *tf, uint32_t insn,
#endif
return rc;
}
+ KERNEL_LOCK();
rc = uvm_fault_wire(map, p->p_md.md_fppgva,
p->p_md.md_fppgva + PAGE_SIZE, PROT_MASK);
+ KERNEL_UNLOCK();
if (rc != 0) {
#ifdef DEBUG
printf("%s: uvm_fault_wire on %p failed: %d\n",