Module Name:    src
Committed By:   kamil
Date:           Wed May  3 15:53:31 UTC 2017

Modified Files:
        src/sys/kern: sys_ptrace_common.c

Log Message:
Fix kernel panic triggered with LLDB

PT_SETSTEP and PT_CLEARSTEP in the current design must unlock proc_lock and
t->p_lock. These functions use lwp_delref() for a tracee with more than one
LWP. This function internally lock (t->)p_lock and this is lock against
self.

There are coming new ATF test with PT_*STEP with multiple LWPs to catch
these bugs in future changes.

Sponsored by <The NetBSD Foundation>


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/kern/sys_ptrace_common.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/sys_ptrace_common.c
diff -u src/sys/kern/sys_ptrace_common.c:1.21 src/sys/kern/sys_ptrace_common.c:1.22
--- src/sys/kern/sys_ptrace_common.c:1.21	Sat Apr  8 00:25:50 2017
+++ src/sys/kern/sys_ptrace_common.c	Wed May  3 15:53:31 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: sys_ptrace_common.c,v 1.21 2017/04/08 00:25:50 kamil Exp $	*/
+/*	$NetBSD: sys_ptrace_common.c,v 1.22 2017/05/03 15:53:31 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -118,7 +118,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sys_ptrace_common.c,v 1.21 2017/04/08 00:25:50 kamil Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_ptrace_common.c,v 1.22 2017/05/03 15:53:31 kamil Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ptrace.h"
@@ -536,8 +536,6 @@ do_ptrace(struct ptrace_methods *ptm, st
 	switch (req) {
 #ifdef PT_STEP
 	case PT_STEP:
-	case PT_SETSTEP:
-	case PT_CLEARSTEP:
 #endif
 	case PT_CONTINUE:
 	case PT_DETACH:

Reply via email to