ptrace: mm_need_new_owner: use ->real_parent to search in the siblings
PATCH 1/1 ptrace: mm_need_new_owner: use ->real_parent to search in the siblings
"Search in the siblings" should use ->real_parent, not ->parent. If the task is traced then ->parent == tracer, while the task's parent is always ->real_parent.
Signed-off-by Oleg Nesterov <[email protected]>
kernel/exit.c renamed from kernel/exit.c~ +1 -1
@@ -590,7 +590,7 @@ retry:/* * Search in the siblings */ -list_for_each_entry (c, &p->parent->children, sibling) { +list_for_each_entry (c, &p->real_parent->children, sibling) {if (c->mm == mm) goto assign_new_owner; }
Acked-by Roland McGrath <[email protected]>
Note, I would also move "Search in the siblings" before "Search in the children". It should be the most common case.
Thanks,
Roland