ptrace'ing of parent process

Posted by osgx on Stack Overflow See other posts from Stack Overflow or by osgx
Published on 2010-02-07T05:22:49Z Indexed on 2010/04/01 9:43 UTC
Read the original article Hit count: 297

Filed under:
|
|
|

Hello

Can child process use the ptrace system call to trace its parent?

Os is linux 2.6

Thanks.

upd1: I want to trace process1 from "itself". It is impossible, so I do fork and try to do ptrace(process1_pid, PTRACE_ATTACH) from child process. But I can't, there is a strange error, like kernel prohibits child from tracing their parent processes

UPD2: such tracing can be prohibited by security policies. Which polices do this? Where is the checking code in the kernel?

UPD3: on my embedded linux I have no errors with PEEKDATA, but not with GETREGS:

child: getregs parent: -1
errno is 1, strerror is Operation not permitted 

errno = EPERM

© Stack Overflow or respective owner

Related posts about fork

Related posts about linux