diff options
Diffstat (limited to 'kernel/signal.c')
-rw-r--r-- | kernel/signal.c | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/kernel/signal.c b/kernel/signal.c index 0af8868525d6..5ffb5626e072 100644 --- a/kernel/signal.c +++ b/kernel/signal.c | |||
@@ -1908,7 +1908,7 @@ static void ptrace_stop(int exit_code, int why, int clear_code, siginfo_t *info) | |||
1908 | preempt_disable(); | 1908 | preempt_disable(); |
1909 | read_unlock(&tasklist_lock); | 1909 | read_unlock(&tasklist_lock); |
1910 | preempt_enable_no_resched(); | 1910 | preempt_enable_no_resched(); |
1911 | schedule(); | 1911 | freezable_schedule(); |
1912 | } else { | 1912 | } else { |
1913 | /* | 1913 | /* |
1914 | * By the time we got the lock, our tracer went away. | 1914 | * By the time we got the lock, our tracer went away. |
@@ -1930,13 +1930,6 @@ static void ptrace_stop(int exit_code, int why, int clear_code, siginfo_t *info) | |||
1930 | } | 1930 | } |
1931 | 1931 | ||
1932 | /* | 1932 | /* |
1933 | * While in TASK_TRACED, we were considered "frozen enough". | ||
1934 | * Now that we woke up, it's crucial if we're supposed to be | ||
1935 | * frozen that we freeze now before running anything substantial. | ||
1936 | */ | ||
1937 | try_to_freeze(); | ||
1938 | |||
1939 | /* | ||
1940 | * We are back. Now reacquire the siglock before touching | 1933 | * We are back. Now reacquire the siglock before touching |
1941 | * last_siginfo, so that we are sure to have synchronized with | 1934 | * last_siginfo, so that we are sure to have synchronized with |
1942 | * any signal-sending on another CPU that wants to examine it. | 1935 | * any signal-sending on another CPU that wants to examine it. |
@@ -2092,7 +2085,7 @@ static bool do_signal_stop(int signr) | |||
2092 | } | 2085 | } |
2093 | 2086 | ||
2094 | /* Now we don't run again until woken by SIGCONT or SIGKILL */ | 2087 | /* Now we don't run again until woken by SIGCONT or SIGKILL */ |
2095 | schedule(); | 2088 | freezable_schedule(); |
2096 | return true; | 2089 | return true; |
2097 | } else { | 2090 | } else { |
2098 | /* | 2091 | /* |
@@ -2200,15 +2193,14 @@ int get_signal_to_deliver(siginfo_t *info, struct k_sigaction *return_ka, | |||
2200 | if (unlikely(uprobe_deny_signal())) | 2193 | if (unlikely(uprobe_deny_signal())) |
2201 | return 0; | 2194 | return 0; |
2202 | 2195 | ||
2203 | relock: | ||
2204 | /* | 2196 | /* |
2205 | * We'll jump back here after any time we were stopped in TASK_STOPPED. | 2197 | * Do this once, we can't return to user-mode if freezing() == T. |
2206 | * While in TASK_STOPPED, we were considered "frozen enough". | 2198 | * do_signal_stop() and ptrace_stop() do freezable_schedule() and |
2207 | * Now that we woke up, it's crucial if we're supposed to be | 2199 | * thus do not need another check after return. |
2208 | * frozen that we freeze now before running anything substantial. | ||
2209 | */ | 2200 | */ |
2210 | try_to_freeze(); | 2201 | try_to_freeze(); |
2211 | 2202 | ||
2203 | relock: | ||
2212 | spin_lock_irq(&sighand->siglock); | 2204 | spin_lock_irq(&sighand->siglock); |
2213 | /* | 2205 | /* |
2214 | * Every stopped thread goes here after wakeup. Check to see if | 2206 | * Every stopped thread goes here after wakeup. Check to see if |