aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>2007-09-05 06:05:56 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-09-10 21:57:47 -0400
commit7d94143291e4e625e2bc3b1ebdc7143ee7a9a2f1 (patch)
treec4f8a974a33dd6ac1feacf18f217ee326c8af5eb /arch/i386
parent897ee77bfba12b83752027427a41009961458ee6 (diff)
Fix spurious syscall tracing after PTRACE_DETACH + PTRACE_ATTACH
When PTRACE_SYSCALL was used and then PTRACE_DETACH is used, the TIF_SYSCALL_TRACE flag is left set on the formerly-traced task. This means that when a new tracer comes along and does PTRACE_ATTACH, it's possible he gets a syscall tracing stop even though he's never used PTRACE_SYSCALL. This happens if the task was in the middle of a system call when the second PTRACE_ATTACH was done. The symptom is an unexpected SIGTRAP when the tracer thinks that only SIGSTOP should have been provoked by his ptrace calls so far. A few machines already fixed this in ptrace_disable (i386, ia64, m68k). But all other machines do not, and still have this bug. On x86_64, this constitutes a regression in IA32 compatibility support. Since all machines now use TIF_SYSCALL_TRACE for this, I put the clearing of TIF_SYSCALL_TRACE in the generic ptrace_detach code rather than adding it to every other machine's ptrace_disable. Signed-off-by: Roland McGrath <roland@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/i386')
-rw-r--r--arch/i386/kernel/ptrace.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/arch/i386/kernel/ptrace.c b/arch/i386/kernel/ptrace.c
index 0c8f00e69c4d..7c1b92522e95 100644
--- a/arch/i386/kernel/ptrace.c
+++ b/arch/i386/kernel/ptrace.c
@@ -274,7 +274,6 @@ static void clear_singlestep(struct task_struct *child)
274void ptrace_disable(struct task_struct *child) 274void ptrace_disable(struct task_struct *child)
275{ 275{
276 clear_singlestep(child); 276 clear_singlestep(child);
277 clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
278 clear_tsk_thread_flag(child, TIF_SYSCALL_EMU); 277 clear_tsk_thread_flag(child, TIF_SYSCALL_EMU);
279} 278}
280 279