Re: Ptrace documentation, draft #1

From: Oleg Nesterov
Date: Mon May 16 2011 - 13:50:07 EST

On 05/16, Tejun Heo wrote:
> On Mon, May 16, 2011 at 06:53:52PM +0200, Oleg Nesterov wrote:
> > > If you do GETSIGINFO and look at si->si_code, user generated signals
> > > can't have non-zero value there
> >
> > Hmm. The can? sys_kill() sets si_code = 0, but tkill() or queueinfo()
> > can pass any si_code < 0. Also, the kernel can generate the signal
> > with si_code > 0.
> Yeah, sure, not non-zero then, but it's still distinguishible, no?

Hmm. Now it is me who is missing context. And probably I misunderstood
the original question:

Kernel delivers an extra SIGTRAP to tracee after execve syscall
returns. This is an ordinary signal
??? can this SIGTRAP be distinguished from "real" user-generated SIGTRAP
by looking at its siginfo?

I meant, we can't distinguish this SIGTRAP. But if PTRACE_O_TRACEEXEC is
set then the tracee reports PTRACE_EVENT_EXEC, this is probably
distinguishible. IIUC, si_code > 0 if the tracee reports an event.


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at