Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/compat/linux/arch/arm/linux_ptrace.c,v rcsdiff: /ftp/cvs/cvsroot/src/sys/compat/linux/arch/arm/linux_ptrace.c,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.16.14.1 retrieving revision 1.17 diff -u -p -r1.16.14.1 -r1.17 --- src/sys/compat/linux/arch/arm/linux_ptrace.c 2015/11/15 20:42:32 1.16.14.1 +++ src/sys/compat/linux/arch/arm/linux_ptrace.c 2012/09/04 00:08:59 1.17 @@ -1,4 +1,4 @@ -/* $NetBSD: linux_ptrace.c,v 1.16.14.1 2015/11/15 20:42:32 bouyer Exp $ */ +/* $NetBSD: linux_ptrace.c,v 1.17 2012/09/04 00:08:59 matt Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: linux_ptrace.c,v 1.16.14.1 2015/11/15 20:42:32 bouyer Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_ptrace.c,v 1.17 2012/09/04 00:08:59 matt Exp $"); #include #include @@ -43,6 +43,7 @@ __KERNEL_RCSID(0, "$NetBSD: linux_ptrace #include #include +#include #include #include @@ -140,6 +141,7 @@ linux_sys_ptrace_arch(struct lwp *l, con goto out; } mutex_enter(t->p_lock); + mutex_exit(proc_lock); /* * You cannot do what you want to the process if: @@ -147,7 +149,6 @@ linux_sys_ptrace_arch(struct lwp *l, con */ if (!ISSET(t->p_slflag, PSL_TRACED)) { mutex_exit(t->p_lock); - mutex_exit(proc_lock); error = EPERM; goto out; } @@ -160,11 +161,9 @@ linux_sys_ptrace_arch(struct lwp *l, con if (ISSET(t->p_slflag, PSL_FSTRACE) || t->p_pptr != p || t->p_stat != SSTOP || !t->p_waited) { mutex_exit(t->p_lock); - mutex_exit(proc_lock); error = EBUSY; goto out; } - mutex_exit(proc_lock); /* XXX: ptrace needs revamp for multi-threading support. */ if (t->p_nlwps > 1) { mutex_exit(t->p_lock);