Actually, I was wrong. Any process can attach to a running
process and security is enforced by making sure that the
two processes have the same effective pid/gid.
However, when a process PTRACE_ATTACHes to another, the
attached process will be made the child of the attaching
process using the p_pptr field of the task_struct.
I still haven't gotten a test program that reads the
register of another process via ptrace working.
If you have one, please let me know.
-Arun