From fde23a4633d2a8bdcdcf2ad448ba33a9b389ec04 Mon Sep 17 00:00:00 2001 From: Artur Grabowski Date: Sat, 1 Dec 2007 16:20:08 +0000 Subject: Don't be lazy in the locking in SYSCALL_DEBUG code. KERNEL_PROC_UNLOCK is not safe for recursion (becuase it clears P_BIGLOCK) so we have to make that lock conditional as well. Found by tholo@ when reviewing the i386 diff. --- sys/arch/amd64/amd64/syscall.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'sys/arch') diff --git a/sys/arch/amd64/amd64/syscall.c b/sys/arch/amd64/amd64/syscall.c index c0031aee6d6..0d4f036bc5e 100644 --- a/sys/arch/amd64/amd64/syscall.c +++ b/sys/arch/amd64/amd64/syscall.c @@ -1,4 +1,4 @@ -/* $OpenBSD: syscall.c,v 1.10 2007/11/27 18:09:37 art Exp $ */ +/* $OpenBSD: syscall.c,v 1.11 2007/12/01 16:20:07 art Exp $ */ /* $NetBSD: syscall.c,v 1.1 2003/04/26 18:39:32 fvdl Exp $ */ /*- @@ -138,9 +138,11 @@ syscall(struct trapframe frame) if (!nolock) KERNEL_PROC_LOCK(p); #ifdef SYSCALL_DEBUG - KERNEL_PROC_LOCK(p); + if (nolock) + KERNEL_PROC_LOCK(p); scdebug_call(p, code, argp); - KERNEL_PROC_UNLOCK(p); + if (nolock) + KERNEL_PROC_UNLOCK(p); #endif #ifdef KTRACE if (KTRPOINT(p, KTR_SYSCALL)) { -- cgit v1.2.3