Skip to content

Commit

Permalink
Revert "ptrace: PTRACE_DETACH should do flush_ptrace_hw_breakpoint(ch…
Browse files Browse the repository at this point in the history
…ild)"

This reverts commit fab840f.

This commit even has the test-case to prove that the tracee
can be killed by SIGTRAP if the debugger does not remove the
breakpoints before PTRACE_DETACH.

However, this is exactly what wineserver deliberately does,
set_thread_context() calls PTRACE_ATTACH + PTRACE_DETACH just
for PTRACE_POKEUSER(DR*) in between.

So we should revert this fix and document that PTRACE_DETACH
should keep the breakpoints.

Reported-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Oleg Nesterov authored and Linus Torvalds committed Aug 6, 2013
1 parent 1853a65 commit 35114fc
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,6 @@ static int ptrace_detach(struct task_struct *child, unsigned int data)
/* Architecture-specific hardware disable .. */
ptrace_disable(child);
clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
flush_ptrace_hw_breakpoint(child);

write_lock_irq(&tasklist_lock);
/*
Expand Down

0 comments on commit 35114fc

Please sign in to comment.