Repository navigation
Commit 7d613f9
committed
signal: Remove the bogus sigkill_pending in ptrace_stop
The existence of sigkill_pending is a little silly as it is
functionally a duplicate of fatal_signal_pending that is used in
exactly one place.
Checking for pending fatal signals and returning early in ptrace_stop
is actively harmful. It casues the ptrace_stop called by
ptrace_signal to return early before setting current->exit_code.
Later when ptrace_signal reads the signal number from
current->exit_code is undefined, making it unpredictable what will
happen.
Instead rely on the fact that schedule will not sleep if there is a
pending signal that can awaken a task.
Removing the explict sigkill_pending test fixes fixes ptrace_signal
when ptrace_stop does not stop because current->exit_code is always
set to to signr.
Cc: stable@vger.kernel.org
Fixes: 3d749b9 ("ptrace: simplify ptrace_stop()->sigkill_pending() path")
Fixes: 1a669c2 ("Add arch_ptrace_stop")
Link: https://lkml.kernel.org/r/87pmsyx29t.fsf@disp2133
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>1 parent 6880fa6 commit 7d613f9
1 file changed
Lines changed: 4 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2182 | 2182 | | |
2183 | 2183 | | |
2184 | 2184 | | |
2185 | | - | |
2186 | | - | |
2187 | | - | |
2188 | | - | |
2189 | | - | |
2190 | | - | |
2191 | | - | |
2192 | | - | |
2193 | | - | |
2194 | 2185 | | |
2195 | 2186 | | |
2196 | 2187 | | |
| |||
2217 | 2208 | | |
2218 | 2209 | | |
2219 | 2210 | | |
2220 | | - | |
2221 | | - | |
2222 | | - | |
2223 | 2211 | | |
2224 | 2212 | | |
2225 | 2213 | | |
2226 | 2214 | | |
2227 | | - | |
2228 | | - | |
2229 | 2215 | | |
2230 | 2216 | | |
| 2217 | + | |
| 2218 | + | |
| 2219 | + | |
| 2220 | + | |
2231 | 2221 | | |
2232 | 2222 | | |
2233 | 2223 | | |
| |||
0 commit comments