Re: [PATCH 08/14] ptrace: make do_signal_stop() use ptrace_stop()if the task is being ptraced

From: Oleg Nesterov
Date: Sun Nov 28 2010 - 15:01:25 EST


On 11/26, Tejun Heo wrote:
>
> A ptraced task would still stop at do_signal_stop() when it's stopping
> for stop signals and do_signal_stop() behaves the same whether the
> task is ptraced or not. However, in addition to stopping,
> ptrace_stop() also does ptrace specific stuff like calling
> architecture specific callbacks, so this behavior makes the code more
> fragile and difficult to understand.

OK. This patch adds the obviously user-visible change. It looks
very minor, but I never know when it comes to ptrace.

To simplify, suppose that we have a single-thread tracee, and
debugger "acks" SIGSTOP, say, it does ptrace(PTRACE_CONT, SIGSTOP).

Before this patch, the tracee stops in TASK_STOPPED, now it calls
ptrace_stop() and goes to TASK_TRACED state.

Add Jan. I hope this is OK, but this might break the tracer if
it looks into fs/proc (probably only test-cases do this).


At least, with or without this patch ->last_siginfo is NULL, good.


The check in do_signal_stop() looks racy though, see the next
email.

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/