diff options
Diffstat (limited to 'kernel/signal.c')
-rw-r--r-- | kernel/signal.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/kernel/signal.c b/kernel/signal.c index 06177e2b3917..97e575a3387e 100644 --- a/kernel/signal.c +++ b/kernel/signal.c | |||
@@ -825,9 +825,11 @@ static int check_kill_permission(int sig, struct siginfo *info, | |||
825 | * TRAP_STOP to notify ptracer of an event. @t must have been seized by | 825 | * TRAP_STOP to notify ptracer of an event. @t must have been seized by |
826 | * ptracer. | 826 | * ptracer. |
827 | * | 827 | * |
828 | * If @t is running, STOP trap will be taken. If already trapped, STOP | 828 | * If @t is running, STOP trap will be taken. If trapped for STOP and |
829 | * trap will be eventually taken without returning to userland after the | 829 | * ptracer is listening for events, tracee is woken up so that it can |
830 | * existing traps are finished by PTRACE_CONT. | 830 | * re-trap for the new event. If trapped otherwise, STOP trap will be |
831 | * eventually taken without returning to userland after the existing traps | ||
832 | * are finished by PTRACE_CONT. | ||
831 | * | 833 | * |
832 | * CONTEXT: | 834 | * CONTEXT: |
833 | * Must be called with @task->sighand->siglock held. | 835 | * Must be called with @task->sighand->siglock held. |
@@ -838,7 +840,7 @@ static void ptrace_trap_notify(struct task_struct *t) | |||
838 | assert_spin_locked(&t->sighand->siglock); | 840 | assert_spin_locked(&t->sighand->siglock); |
839 | 841 | ||
840 | task_set_jobctl_pending(t, JOBCTL_TRAP_NOTIFY); | 842 | task_set_jobctl_pending(t, JOBCTL_TRAP_NOTIFY); |
841 | signal_wake_up(t, 0); | 843 | signal_wake_up(t, t->jobctl & JOBCTL_LISTENING); |
842 | } | 844 | } |
843 | 845 | ||
844 | /* | 846 | /* |
@@ -1894,6 +1896,9 @@ static void ptrace_stop(int exit_code, int why, int clear_code, siginfo_t *info) | |||
1894 | spin_lock_irq(¤t->sighand->siglock); | 1896 | spin_lock_irq(¤t->sighand->siglock); |
1895 | current->last_siginfo = NULL; | 1897 | current->last_siginfo = NULL; |
1896 | 1898 | ||
1899 | /* LISTENING can be set only during STOP traps, clear it */ | ||
1900 | current->jobctl &= ~JOBCTL_LISTENING; | ||
1901 | |||
1897 | /* | 1902 | /* |
1898 | * Queued signals ignored us while we were stopped for tracing. | 1903 | * Queued signals ignored us while we were stopped for tracing. |
1899 | * So check for any that we should take before resuming user mode. | 1904 | * So check for any that we should take before resuming user mode. |