ptrace/arm: revert "hw_breakpoints: Fix racy access to ptrace breakpoints"
authorOleg Nesterov <[email protected]>
Mon, 8 Jul 2013 23:00:51 +0000 (16:00 -0700)
committerLinus Torvalds <[email protected]>
Tue, 9 Jul 2013 17:33:25 +0000 (10:33 -0700)
This reverts commit bf0b8f4b55e5 ("hw_breakpoints: Fix racy access to
ptrace breakpoints").

The patch was fine but we can no longer race with SIGKILL after commit
9899d11f6544 ("ptrace: ensure arch_ptrace/ptrace_request can never race
with SIGKILL"), the __TASK_TRACED tracee can't be woken up and
->ptrace_bps[] can't go away.

Signed-off-by: Oleg Nesterov <[email protected]>
Acked-by: Will Deacon <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Jan Kratochvil <[email protected]>
Cc: Michael Neuling <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Paul Mundt <[email protected]>
Cc: Prasad <[email protected]>
Cc: Russell King <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
arch/arm/kernel/ptrace.c

index 2bc1514d6dbe84955d0d070db1ae2ac6e65a5fbd..0dd3b79b15c3d90f0ad54f52d4240392fb51258e 100644 (file)
@@ -886,20 +886,12 @@ long arch_ptrace(struct task_struct *child, long request,
 
 #ifdef CONFIG_HAVE_HW_BREAKPOINT
                case PTRACE_GETHBPREGS:
-                       if (ptrace_get_breakpoints(child) < 0)
-                               return -ESRCH;
-
                        ret = ptrace_gethbpregs(child, addr,
                                                (unsigned long __user *)data);
-                       ptrace_put_breakpoints(child);
                        break;
                case PTRACE_SETHBPREGS:
-                       if (ptrace_get_breakpoints(child) < 0)
-                               return -ESRCH;
-
                        ret = ptrace_sethbpregs(child, addr,
                                                (unsigned long __user *)data);
-                       ptrace_put_breakpoints(child);
                        break;
 #endif