From 325a418446cd7f019069ab1a3e9b1514466b91ad Mon Sep 17 00:00:00 2001 From: Visa Hankala Date: Mon, 3 Aug 2015 13:32:16 +0000 Subject: On mips64, enable IPIs before calling refreshcreds() in trap(), to avoid a potential deadlock. ok miod@, deraadt@ --- sys/arch/mips64/mips64/trap.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'sys') 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 -- cgit v1.2.3