summaryrefslogtreecommitdiffstats
path: root/kernel/exit.c
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@tv-sign.ru>2008-02-08 04:18:58 -0800
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-08 09:22:26 -0800
commit6b39c7bfbd1436836c0fb34c5b437fda1a7a3dd4 (patch)
tree60d3d9719eef3076527fcbf9c3cb362fe0f52d61 /kernel/exit.c
parent01b8b07a5d77d22e609267dcae74d15e3e9c5f13 (diff)
downloadlinux-stable-6b39c7bfbd1436836c0fb34c5b437fda1a7a3dd4.tar.gz
linux-stable-6b39c7bfbd1436836c0fb34c5b437fda1a7a3dd4.tar.bz2
linux-stable-6b39c7bfbd1436836c0fb34c5b437fda1a7a3dd4.zip
kill PT_ATTACHED
Since the patch "Fix ptrace_attach()/ptrace_traceme()/de_thread() race" commit f5b40e363ad6041a96e3da32281d8faa191597b9 we set PT_ATTACHED and change child->parent "atomically" wrt task_list lock. This means we can remove the checks like "PT_ATTACHED && ->parent != ptracer" which were needed to catch the "ptrace attach is in progress" case. We can also remove the flag itself since nobody else uses it. Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru> Acked-by: Roland McGrath <roland@redhat.com> Cc: Christoph Hellwig <hch@lst.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/exit.c')
-rw-r--r--kernel/exit.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/kernel/exit.c b/kernel/exit.c
index eb9934a82fc1..1f2c15297f2d 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -1514,18 +1514,7 @@ static int wait_task_continued(struct task_struct *p, int noreap,
static inline int my_ptrace_child(struct task_struct *p)
{
- if (!(p->ptrace & PT_PTRACED))
- return 0;
- if (!(p->ptrace & PT_ATTACHED))
- return 1;
- /*
- * This child was PTRACE_ATTACH'd. We should be seeing it only if
- * we are the attacher. If we are the real parent, this is a race
- * inside ptrace_attach. It is waiting for the tasklist_lock,
- * which we have to switch the parent links, but has already set
- * the flags in p->ptrace.
- */
- return (p->parent != p->real_parent);
+ return p->ptrace & PT_PTRACED;
}
static long do_wait(pid_t pid, int options, struct siginfo __user *infop,