lkml.org 
[lkml]   [2011]   [May]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Ptrace documentation, draft #1
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.

Oleg.



\
 
 \ /
  Last update: 2011-05-16 19:53    [W:0.085 / U:26.576 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site