Repository navigation
Commit 4fbeceb
signal: Remove the bogus sigkill_pending in ptrace_stop
commit 7d613f9 upstream.
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent 5c6fedc commit 4fbeceb
1 file changed
Lines changed: 4 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2097 | 2097 | | |
2098 | 2098 | | |
2099 | 2099 | | |
2100 | | - | |
2101 | | - | |
2102 | | - | |
2103 | | - | |
2104 | | - | |
2105 | | - | |
2106 | | - | |
2107 | | - | |
2108 | | - | |
2109 | 2100 | | |
2110 | 2101 | | |
2111 | 2102 | | |
| |||
2132 | 2123 | | |
2133 | 2124 | | |
2134 | 2125 | | |
2135 | | - | |
2136 | | - | |
2137 | | - | |
2138 | 2126 | | |
2139 | 2127 | | |
2140 | 2128 | | |
2141 | 2129 | | |
2142 | | - | |
2143 | | - | |
2144 | 2130 | | |
2145 | 2131 | | |
| 2132 | + | |
| 2133 | + | |
| 2134 | + | |
| 2135 | + | |
2146 | 2136 | | |
2147 | 2137 | | |
2148 | 2138 | | |
| |||
0 commit comments