Joerg
Yes, sorry about forgetting about this bug. The fix is very simple:
disallow tracing of init, even by root. Init is special in other ways
anyway (you cannot kill init with any outside signal including SIGKILL
etc), as it has to run so that zombies can be given to somebody. The fix
is easy:
in linux/kernel/ptrace.c, function sys_ptrace(), add these two lines to
just after checking against PTRACE_TRACEME:
----- pseudo-patch -----
/* set the ptrace bit in the proccess flags. */
return 0;
}
+ if (pid == 1)
+ return -EPERM;
if (!(child = get_task(pid)))
return -ESRCH;
if (request == PTRACE_ATTACH) {
----- pseudo-patch -----
That may not have been what people wanted, but it's consistent with how
the rest of the kernel handles the init task. So no, you won't be able
to trace init, but on the other hand you won't be able to mess with the
internal kernel process pointers either..
Linus