]> git.baikalelectronics.ru Git - kernel.git/commit
reparent_thread: fix the "is it traced" check
authorOleg Nesterov <oleg@redhat.com>
Thu, 2 Apr 2009 23:58:16 +0000 (16:58 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 3 Apr 2009 02:04:59 +0000 (19:04 -0700)
commit6c1c8169da571417fae9e95aba65c498b9d4d38b
treedda315fddb15936bc74eb9c74bec29b64e65b71c
parent7482eed9ebaa974bfd8d0ef8a1b1fa48170c437b
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@redhat.com>
Cc: Roland McGrath <roland@redhat.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
kernel/exit.c