2009-04-23 21:23:55

by Oleg Nesterov

[permalink] [raw]
Subject: [PATCH] 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]>

--- PTRACE/kernel/exit.c~ 2009-04-09 00:39:10.000000000 +0200
+++ PTRACE/kernel/exit.c 2009-04-23 23:08:37.000000000 +0200
@@ -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;
}


2009-04-23 23:26:21

by Roland McGrath

[permalink] [raw]
Subject: Re: [PATCH] ptrace: mm_need_new_owner: use ->real_parent to search in the siblings

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