diff options
author | Oleg Nesterov <oleg@redhat.com> | 2009-04-03 01:58:23 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-03 04:05:00 +0200 |
commit | 1ee1184485df9c9a3503d3a684b911fb7c73d259 (patch) | |
tree | 0216bc3ebccf1c44b86617cd06e7b93510ef5bb8 /kernel/ptrace.c | |
parent | ptrace_detach: the wrong wakeup breaks the ERESTARTxxx logic (diff) | |
download | linux-1ee1184485df9c9a3503d3a684b911fb7c73d259.tar.xz linux-1ee1184485df9c9a3503d3a684b911fb7c73d259.zip |
ptrace_untrace: fix the SIGNAL_STOP_STOPPED check
This bug is ancient too. ptrace_untrace() must not resume the task
if the group stop in progress, we should set TASK_STOPPED instead.
Unfortunately, we still have problems here:
- if the process/thread was traced, SIGNAL_STOP_STOPPED
does not necessary means this thread group is stopped.
- ptrace breaks the bookkeeping of ->group_stop_count.
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Cc: Jerome Marchand <jmarchan@redhat.com>
Cc: Roland McGrath <roland@redhat.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/ptrace.c')
-rw-r--r-- | kernel/ptrace.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/kernel/ptrace.c b/kernel/ptrace.c index 296e8105863a..5105f5a6a2ce 100644 --- a/kernel/ptrace.c +++ b/kernel/ptrace.c @@ -60,11 +60,15 @@ static void ptrace_untrace(struct task_struct *child) { spin_lock(&child->sighand->siglock); if (task_is_traced(child)) { - if (child->signal->flags & SIGNAL_STOP_STOPPED) { + /* + * If the group stop is completed or in progress, + * this thread was already counted as stopped. + */ + if (child->signal->flags & SIGNAL_STOP_STOPPED || + child->signal->group_stop_count) __set_task_state(child, TASK_STOPPED); - } else { + else signal_wake_up(child, 1); - } } spin_unlock(&child->sighand->siglock); } |