lkml.org 
[lkml]   [2009]   [Feb]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH -mm 2/2] ptrace_untrace: fix the SIGNAL_STOP_STOPPED check
On 02/19, Roland McGrath wrote:
>
> > This bug is ancient too. ptrace_untrace() must not resume the task
> > if the group stop in progress, we should set TASK_STOPPED instead.
>
> Right, the change looks correct.
>
> > 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.
>
> Neither of these should be true today as I understand the code.

Suppose we have

int main(void)
{
kill(getpid(), SIGSTOP);

for (;;)
;
}

If you strace this task nobody clears SIGNAL_STOP_STOPPED.

As for bookkeeping of ->group_stop_count, I think ptrace_stop() is wrong
in many ways. For example, it decrements ->group_stop_count but doesn't
set SIGNAL_STOP_STOPPED if it becomes zero.

Oleg.



\
 
 \ /
  Last update: 2009-02-20 20:19    [W:0.061 / U:0.336 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site