Re: [PATCH] ptrace: make PTRACE_DETACH work on non-stopped tracees.

From: Oleg Nesterov
Date: Wed Jun 19 2013 - 12:57:18 EST


On 06/19, Pedro Alves wrote:
>
> On 06/19/2013 05:09 PM, Jan Kratochvil wrote:
> > On Wed, 19 Jun 2013 17:15:36 +0200, Denys Vlasenko wrote:
> >> CCing Jan to hear his comments from gdb side.
>
> PTRACE_DETACH takes a signal number in the data parameter.
> What happens to if the tracer passes a non-zero signal?

non-zero doesn't matter, zero is equally bad.

ptrace_detach() simply does child->exit_code = data, assuming
that child will look at it after resume. This is just wrong if
the child is not stopped.

Oleg.

--
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/