diff options
-rw-r--r-- | include/linux/ptrace.h | 3 | ||||
-rw-r--r-- | kernel/fork.c | 12 |
2 files changed, 3 insertions, 12 deletions
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h index fd8669fc339f..9b5d2c901d06 100644 --- a/include/linux/ptrace.h +++ b/include/linux/ptrace.h | |||
@@ -227,6 +227,9 @@ static inline void ptrace_init_task(struct task_struct *child, bool ptrace) | |||
227 | if (unlikely(ptrace) && current->ptrace) { | 227 | if (unlikely(ptrace) && current->ptrace) { |
228 | child->ptrace = current->ptrace; | 228 | child->ptrace = current->ptrace; |
229 | __ptrace_link(child, current->parent); | 229 | __ptrace_link(child, current->parent); |
230 | |||
231 | sigaddset(&child->pending.signal, SIGSTOP); | ||
232 | set_tsk_thread_flag(child, TIF_SIGPENDING); | ||
230 | } | 233 | } |
231 | } | 234 | } |
232 | 235 | ||
diff --git a/kernel/fork.c b/kernel/fork.c index 3c72a5b321a7..4d4117e01504 100644 --- a/kernel/fork.c +++ b/kernel/fork.c | |||
@@ -37,7 +37,6 @@ | |||
37 | #include <linux/swap.h> | 37 | #include <linux/swap.h> |
38 | #include <linux/syscalls.h> | 38 | #include <linux/syscalls.h> |
39 | #include <linux/jiffies.h> | 39 | #include <linux/jiffies.h> |
40 | #include <linux/tracehook.h> | ||
41 | #include <linux/futex.h> | 40 | #include <linux/futex.h> |
42 | #include <linux/compat.h> | 41 | #include <linux/compat.h> |
43 | #include <linux/kthread.h> | 42 | #include <linux/kthread.h> |
@@ -1522,17 +1521,6 @@ long do_fork(unsigned long clone_flags, | |||
1522 | audit_finish_fork(p); | 1521 | audit_finish_fork(p); |
1523 | 1522 | ||
1524 | /* | 1523 | /* |
1525 | * Child is ready but hasn't started running yet. Queue | ||
1526 | * SIGSTOP if it's gonna be ptraced - it doesn't matter who | ||
1527 | * attached/attaching to this task, the pending SIGSTOP is | ||
1528 | * right in any case. | ||
1529 | */ | ||
1530 | if (unlikely(p->ptrace)) { | ||
1531 | sigaddset(&p->pending.signal, SIGSTOP); | ||
1532 | set_tsk_thread_flag(p, TIF_SIGPENDING); | ||
1533 | } | ||
1534 | |||
1535 | /* | ||
1536 | * We set PF_STARTING at creation in case tracing wants to | 1524 | * We set PF_STARTING at creation in case tracing wants to |
1537 | * use this to distinguish a fully live task from one that | 1525 | * use this to distinguish a fully live task from one that |
1538 | * hasn't finished SIGSTOP raising yet. Now we clear it | 1526 | * hasn't finished SIGSTOP raising yet. Now we clear it |