summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorvisa <visa@openbsd.org>2015-08-03 13:32:15 +0000
committervisa <visa@openbsd.org>2015-08-03 13:32:15 +0000
commitf11c78bfd1836c2c2b05470f91710ca898e5f734 (patch)
tree914da7d6b3e95370aeb8e92beee96da459b18f17 /sys
parent"ls" requires an argument. (diff)
downloadwireguard-openbsd-f11c78bfd1836c2c2b05470f91710ca898e5f734.tar.xz
wireguard-openbsd-f11c78bfd1836c2c2b05470f91710ca898e5f734.zip
On mips64, enable IPIs before calling refreshcreds() in trap(), to
avoid a potential deadlock. ok miod@, deraadt@
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/mips64/mips64/trap.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/arch/mips64/mips64/trap.c b/sys/arch/mips64/mips64/trap.c
index 47dc02ba01f..f8e20b5326c 100644
--- a/sys/arch/mips64/mips64/trap.c
+++ b/sys/arch/mips64/mips64/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.107 2015/07/19 17:00:39 visa Exp $ */
+/* $OpenBSD: trap.c,v 1.108 2015/08/03 13:32:15 visa Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -181,10 +181,8 @@ trap(struct trap_frame *trapframe)
if (type != T_SYSCALL)
#endif
atomic_inc_int(&uvmexp.traps);
- if (USERMODE(trapframe->sr)) {
+ if (USERMODE(trapframe->sr))
type |= T_USER;
- refreshcreds(p);
- }
/*
* Enable hardware interrupts if they were on before the trap;
@@ -208,6 +206,9 @@ trap(struct trap_frame *trapframe)
break;
}
+ if (type & T_USER)
+ refreshcreds(p);
+
#ifdef CPU_R8000
/*
* Some exception causes on R8000 are actually detected by external