On 04/20, Roland McGrath wrote:
Afaics ptrace_attach() needs this lock only to pin -mm, no other other
reasons. ptrace_traceme() doesn't need it at all.
I'm pretty sure that -mm check is only meant to exclude kernel threads.
It should check PF_KTHREAD now,
Yes.
But
IOW, 2 threads T1 and T2. T2 forks the child C. T1 ptraces C. C dies
and becomes EXIT_ZOMBIE. It sends the notification to thread-group.
Then, any thread does do_wait(). But since ptrace_reparented() = T
we don't release C but send the notification again. This doesn't
look right.