Messages in this thread | ![/](/images/icornerl.gif) | | Date | Wed, 22 Dec 2010 11:54:36 +0100 | From | Tejun Heo <> | Subject | Re: [PATCH 10/16] ptrace: clean transitions between TASK_STOPPED and TRACED |
| |
Hello,
On Tue, Dec 21, 2010 at 06:31:55PM +0100, Tejun Heo wrote: > > This looks racy. Suppose that "current" is ptraced, in this case > > it can initiate the new group-stop even if SIGNAL_STOP_STOPPED > > is set and we have another TASK_STOPPED thead T. > > > > Suppose that another (or same) debugger ataches to this thread T, > > wakes it up and sets GROUP_STOP_TRAPPING. > > > > T resumes, calls ptrace_stop() in TASK_STOPPED, and temporary drops > > ->siglock. > > > > Now, this task_clear_group_stop(T) confuses ptrace_check_attach(T). > > > > I think ptrace_stop() should be called in TASK_RUNNING state. > > This also makes sense because we may call arch_ptrace_stop(). > > I'm feeling a bit too dense to process the above right now. I'll > respond to the above next morning after a strong cup of coffee. :-)
Ah, right, the lock drop across arch_ptrace_stop(). Yeah, I agree calling ptrace_stop() with TASK_RUNNING would solve it. I'll think about it a bit more.
Thank you.
-- tejun
| ![\](/images/icornerr.gif) |