From 0f4ac9ca8d446c3a59800655a6f2133562553569 Mon Sep 17 00:00:00 2001 From: Oleg Nesterov Date: Fri, 8 Jul 2011 19:13:54 +0200 Subject: [PATCH] --- yaml --- r: 256865 b: refs/heads/master c: dcace06cc29df927a74a6bc0e57b9bef87704377 h: refs/heads/master i: 256863: 7d9d9c2a45a00dfa73f6335e5202f298d7b04b8a v: v3 --- [refs] | 2 +- trunk/include/linux/ptrace.h | 3 +++ trunk/kernel/fork.c | 12 ------------ 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/[refs] b/[refs] index 3e00408f3150..adb8e7c673db 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 6634ae1033ceaeca5877dd75723210f8c2648c17 +refs/heads/master: dcace06cc29df927a74a6bc0e57b9bef87704377 diff --git a/trunk/include/linux/ptrace.h b/trunk/include/linux/ptrace.h index fd8669fc339f..9b5d2c901d06 100644 --- a/trunk/include/linux/ptrace.h +++ b/trunk/include/linux/ptrace.h @@ -227,6 +227,9 @@ static inline void ptrace_init_task(struct task_struct *child, bool ptrace) if (unlikely(ptrace) && current->ptrace) { child->ptrace = current->ptrace; __ptrace_link(child, current->parent); + + sigaddset(&child->pending.signal, SIGSTOP); + set_tsk_thread_flag(child, TIF_SIGPENDING); } } diff --git a/trunk/kernel/fork.c b/trunk/kernel/fork.c index 3c72a5b321a7..4d4117e01504 100644 --- a/trunk/kernel/fork.c +++ b/trunk/kernel/fork.c @@ -37,7 +37,6 @@ #include #include #include -#include #include #include #include @@ -1521,17 +1520,6 @@ long do_fork(unsigned long clone_flags, audit_finish_fork(p); - /* - * Child is ready but hasn't started running yet. Queue - * SIGSTOP if it's gonna be ptraced - it doesn't matter who - * attached/attaching to this task, the pending SIGSTOP is - * right in any case. - */ - if (unlikely(p->ptrace)) { - sigaddset(&p->pending.signal, SIGSTOP); - set_tsk_thread_flag(p, TIF_SIGPENDING); - } - /* * We set PF_STARTING at creation in case tracing wants to * use this to distinguish a fully live task from one that