diff options
-rw-r--r-- | kernel/ptrace.c | 13 | ||||
-rw-r--r-- | kernel/signal.c | 2 |
2 files changed, 12 insertions, 3 deletions
diff --git a/kernel/ptrace.c b/kernel/ptrace.c index 24d04477b257..78ab24a7b0e4 100644 --- a/kernel/ptrace.c +++ b/kernel/ptrace.c | |||
@@ -96,9 +96,20 @@ void __ptrace_unlink(struct task_struct *child) | |||
96 | */ | 96 | */ |
97 | if (!(child->flags & PF_EXITING) && | 97 | if (!(child->flags & PF_EXITING) && |
98 | (child->signal->flags & SIGNAL_STOP_STOPPED || | 98 | (child->signal->flags & SIGNAL_STOP_STOPPED || |
99 | child->signal->group_stop_count)) | 99 | child->signal->group_stop_count)) { |
100 | child->jobctl |= JOBCTL_STOP_PENDING; | 100 | child->jobctl |= JOBCTL_STOP_PENDING; |
101 | 101 | ||
102 | /* | ||
103 | * This is only possible if this thread was cloned by the | ||
104 | * traced task running in the stopped group, set the signal | ||
105 | * for the future reports. | ||
106 | * FIXME: we should change ptrace_init_task() to handle this | ||
107 | * case. | ||
108 | */ | ||
109 | if (!(child->jobctl & JOBCTL_STOP_SIGMASK)) | ||
110 | child->jobctl |= SIGSTOP; | ||
111 | } | ||
112 | |||
102 | /* | 113 | /* |
103 | * If transition to TASK_STOPPED is pending or in TASK_TRACED, kick | 114 | * If transition to TASK_STOPPED is pending or in TASK_TRACED, kick |
104 | * @child in the butt. Note that @resume should be used iff @child | 115 | * @child in the butt. Note that @resume should be used iff @child |
diff --git a/kernel/signal.c b/kernel/signal.c index b3f78d09a105..206551563cce 100644 --- a/kernel/signal.c +++ b/kernel/signal.c | |||
@@ -1994,8 +1994,6 @@ static bool do_signal_stop(int signr) | |||
1994 | */ | 1994 | */ |
1995 | if (!(sig->flags & SIGNAL_STOP_STOPPED)) | 1995 | if (!(sig->flags & SIGNAL_STOP_STOPPED)) |
1996 | sig->group_exit_code = signr; | 1996 | sig->group_exit_code = signr; |
1997 | else | ||
1998 | WARN_ON_ONCE(!current->ptrace); | ||
1999 | 1997 | ||
2000 | sig->group_stop_count = 0; | 1998 | sig->group_stop_count = 0; |
2001 | 1999 | ||