ptrace (need help with ptrace_check_attach() function)
hi everyone,
I`ve two questions...I`d be thankful if anyone could help me find their answers....
1- what does TASK_PTRACED state mean? and how it differ from TASK_STOPPED state?
2- what is ptrace_check_attch() function used for?
in "kernel/ptrace.c", linux kernel says:
* Check that we have indeed attached to the thing..
/*
* We take the read lock around doing both checks to close a
* possible race where someone else was tracing our child and
* detached between these two checks. After this locked check,
* we are sure that this is our traced child and that can only
* be changed by us so it's not changing right after this.
*/
is it possible that more than one process could successfully execute ptrace_attach() for tracing the same process?
so why we need ptrace_check_attach?
thanks
|