ptrace: mm_need_new_owner: use ->real_parent to search in the siblings
authorOleg Nesterov <[email protected]>
Wed, 17 Jun 2009 23:27:29 +0000 (16:27 -0700)
committerLinus Torvalds <[email protected]>
Thu, 18 Jun 2009 20:03:49 +0000 (13:03 -0700)
"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]>
Acked-by: Roland McGrath <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
kernel/exit.c

index 533e5f85669af0f1d1a8ffdd789b3706015b97b6..213f906f5e165dd07d73e9e7db9debf6b682f703 100644 (file)
@@ -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;
        }