diff options
author | Tobias Ulmer <tobiasu@cvs.openbsd.org> | 2014-06-13 00:02:38 +0000 |
---|---|---|
committer | Tobias Ulmer <tobiasu@cvs.openbsd.org> | 2014-06-13 00:02:38 +0000 |
commit | c084491b09cf1ac1a632a38c90b98bc8d7045716 (patch) | |
tree | a6a73d9fd3e827ff52985f816dd0ba1c5601e3a6 /sys | |
parent | 60c5ff3d463014006b5474153ab3d84ce139c99c (diff) |
Fix ptrace() hanging hppa MP systems
Fiddling with uvm, registers and breakpoints requires taking the kernel lock
Problem spotted by tedu@
ok kettenis@ deraadt@ miod@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/hppa/hppa/trap.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/arch/hppa/hppa/trap.c b/sys/arch/hppa/hppa/trap.c index 72f261b43b4..ce286ba6466 100644 --- a/sys/arch/hppa/hppa/trap.c +++ b/sys/arch/hppa/hppa/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.134 2014/05/11 00:12:44 guenther Exp $ */ +/* $OpenBSD: trap.c,v 1.135 2014/06/13 00:02:37 tobiasu Exp $ */ /* * Copyright (c) 1998-2004 Michael Shalayeff @@ -264,13 +264,14 @@ trap(int type, struct trapframe *frame) case T_IBREAK | T_USER: case T_DBREAK | T_USER: { int code = TRAP_BRKPT; + + KERNEL_LOCK(); #ifdef PTRACE ss_clear_breakpoints(p); if (opcode == SSBREAKPOINT) code = TRAP_TRACE; #endif /* pass to user debugger */ - KERNEL_LOCK(); trapsignal(p, SIGTRAP, type & ~T_USER, code, sv); KERNEL_UNLOCK(); } @@ -278,10 +279,9 @@ trap(int type, struct trapframe *frame) #ifdef PTRACE case T_TAKENBR | T_USER: + KERNEL_LOCK(); ss_clear_breakpoints(p); - /* pass to user debugger */ - KERNEL_LOCK(); trapsignal(p, SIGTRAP, type & ~T_USER, TRAP_TRACE, sv); KERNEL_UNLOCK(); break; |