diff options
Diffstat (limited to 'kernel/signal.c')
-rw-r--r-- | kernel/signal.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/kernel/signal.c b/kernel/signal.c index 9ff2c26161f9..a28b39e9b014 100644 --- a/kernel/signal.c +++ b/kernel/signal.c | |||
@@ -2018,15 +2018,6 @@ static inline bool may_ptrace_stop(void) | |||
2018 | return true; | 2018 | return true; |
2019 | } | 2019 | } |
2020 | 2020 | ||
2021 | /* | ||
2022 | * Return non-zero if there is a SIGKILL that should be waking us up. | ||
2023 | * Called with the siglock held. | ||
2024 | */ | ||
2025 | static bool sigkill_pending(struct task_struct *tsk) | ||
2026 | { | ||
2027 | return sigismember(&tsk->pending.signal, SIGKILL) || | ||
2028 | sigismember(&tsk->signal->shared_pending.signal, SIGKILL); | ||
2029 | } | ||
2030 | 2021 | ||
2031 | /* | 2022 | /* |
2032 | * This must be called with current->sighand->siglock held. | 2023 | * This must be called with current->sighand->siglock held. |
@@ -2053,17 +2044,16 @@ static void ptrace_stop(int exit_code, int why, int clear_code, siginfo_t *info) | |||
2053 | * calling arch_ptrace_stop, so we must release it now. | 2044 | * calling arch_ptrace_stop, so we must release it now. |
2054 | * To preserve proper semantics, we must do this before | 2045 | * To preserve proper semantics, we must do this before |
2055 | * any signal bookkeeping like checking group_stop_count. | 2046 | * any signal bookkeeping like checking group_stop_count. |
2056 | * Meanwhile, a SIGKILL could come in before we retake the | ||
2057 | * siglock. That must prevent us from sleeping in TASK_TRACED. | ||
2058 | * So after regaining the lock, we must check for SIGKILL. | ||
2059 | */ | 2047 | */ |
2060 | spin_unlock_irq(¤t->sighand->siglock); | 2048 | spin_unlock_irq(¤t->sighand->siglock); |
2061 | arch_ptrace_stop(exit_code, info); | 2049 | arch_ptrace_stop(exit_code, info); |
2062 | spin_lock_irq(¤t->sighand->siglock); | 2050 | spin_lock_irq(¤t->sighand->siglock); |
2063 | if (sigkill_pending(current)) | ||
2064 | return; | ||
2065 | } | 2051 | } |
2066 | 2052 | ||
2053 | /* | ||
2054 | * schedule() will not sleep if there is a pending signal that | ||
2055 | * can awaken the task. | ||
2056 | */ | ||
2067 | set_special_state(TASK_TRACED); | 2057 | set_special_state(TASK_TRACED); |
2068 | 2058 | ||
2069 | /* | 2059 | /* |