[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090129080558.GA26871@redhat.com>
Date: Thu, 29 Jan 2009 09:05:58 +0100
From: Oleg Nesterov <oleg@...hat.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: "Eric W. Biederman" <ebiederm@...ssion.com>,
Roland McGrath <roland@...hat.com>,
linux-kernel@...r.kernel.org
Subject: [PATCH 2/4] reparent_thread: fix the "is it traced" check
reparent_thread() uses ptrace_reparented() to check whether this thread
is ptraced, in that case we should not notify the new parent.
But ptrace_reparented() is not exactly correct when the reparented thread
is traced by /sbin/init, because forget_original_parent() has already
changed ->real_parent.
Currently, the only problem is the false notification. But with the next
patch the kernel crash in this (yes, pathological) case.
Signed-off-by: Oleg Nesterov <oleg@...hat.com>
--- 6.29-rc3/kernel/exit.c~6_FIX_PTRACE_CHECK 2009-01-29 06:21:51.000000000 +0100
+++ 6.29-rc3/kernel/exit.c 2009-01-29 06:57:09.000000000 +0100
@@ -826,7 +826,7 @@ static void reparent_thread(struct task_
/* If we'd notified the old parent about this child's death,
* also notify the new parent.
*/
- if (!ptrace_reparented(p) &&
+ if (!p->ptrace &&
p->exit_state == EXIT_ZOMBIE && thread_group_empty(p))
do_notify_parent(p, p->exit_signal);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists