summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorVisa Hankala <visa@cvs.openbsd.org>2015-08-03 13:32:16 +0000
committerVisa Hankala <visa@cvs.openbsd.org>2015-08-03 13:32:16 +0000
commit325a418446cd7f019069ab1a3e9b1514466b91ad (patch)
tree5d43dfecc5b24385039b6e86f9943dd083ec582d /sys
parent70922e0c3fe740161f4cc04794801f3f27f227fe (diff)
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