Re: [PATCH 10/11] ptrace: move JOBCTL_TRAPPING wait to wait(2) andptrace_check_attach()

From: Tejun Heo
Date: Wed May 11 2011 - 15:46:08 EST


Hello,

On Wed, May 11, 2011 at 07:00:58PM +0200, Oleg Nesterov wrote:
> On 05/11, Oleg Nesterov wrote:
> >
> > You know, I'd wish I could find the serious bugs in this patch. The
> > code becomes really hairy. -EAGAIN in do_wait() doesn't make it more
> > simple ;)
>
> Mwahaha! I seem to see the bug ;)

:-)

> When the caller is do_wait(), we can't assume we are the tracer when
> we drop tasklist. Original tracer can detach, then another unrelated
> process can attach again and provoke JOBCTL_TRAPPING. wait_event()
> can hang forever.
>
> Unfortunately, this is easy to fix :/

Yeah, it's basically the same problem raised in other two patches.
Making wait interruptible and clearing pending stop/traps on
detach/kill/cont/whatever should do the trick. I'll reply the
previous message for the suggested change.

Thanks.

--
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/