diff options
author | 2015-07-19 17:00:39 +0000 | |
---|---|---|
committer | 2015-07-19 17:00:39 +0000 | |
commit | 4c22dcc7ef404c94a4bb981dce4dfd919fbd16ca (patch) | |
tree | 1495c4c8cdccb9f4165bd6750cd28bfc9ddfe4d2 | |
parent | whitespace; (diff) | |
download | wireguard-openbsd-4c22dcc7ef404c94a4bb981dce4dfd919fbd16ca.tar.xz wireguard-openbsd-4c22dcc7ef404c94a4bb981dce4dfd919fbd16ca.zip |
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@
-rw-r--r-- | sys/arch/mips64/mips64/trap.c | 4 |
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", |