[PATCH]ptrace-wait_task_zombie-do-not-account-traced-sub-threads-fix

From: Oleg Nesterov
Date: Thu Jun 18 2009 - 14:52:24 EST


On 06/15, Roland McGrath wrote:
>
> ACK, but I think it warrants a comment explaining that task_detached() here
> always means "ptrace'd but not reparented".

Please see below. Not sure my comment is more clear...

Signed-off-by: Oleg Nesterov <oleg@xxxxxxxxxx>

--- PTRACE/kernel/exit.c~1_WAIT_REPARENTED_COMMENT 2009-06-18 20:39:07.000000000 +0200
+++ PTRACE/kernel/exit.c 2009-06-18 20:42:05.000000000 +0200
@@ -1188,7 +1188,10 @@ static int wait_task_zombie(struct wait_
}

traced = ptrace_reparented(p);
-
+ /*
+ * It can be ptraced but not reparented, check
+ * !task_detached() to filter out sub-threads.
+ */
if (likely(!traced) && likely(!task_detached(p))) {
struct signal_struct *psig;
struct signal_struct *sig;

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/