diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-07-15 06:10:52 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-07-22 15:57:54 -0400 |
commit | 7266702805f9d824f92ce5c4069eca65d0f21d28 (patch) | |
tree | 2527195dccf6eec9dc20872dc820255df1ce5f4b /kernel | |
parent | 1e0ea0014479f066ba26f937e8740b8902229616 (diff) |
signal: make sure we don't get stopped with pending task_work
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/signal.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/kernel/signal.c b/kernel/signal.c index 677102789cf2..be4f856d52f8 100644 --- a/kernel/signal.c +++ b/kernel/signal.c | |||
@@ -1971,6 +1971,13 @@ static void ptrace_do_notify(int signr, int exit_code, int why) | |||
1971 | void ptrace_notify(int exit_code) | 1971 | void ptrace_notify(int exit_code) |
1972 | { | 1972 | { |
1973 | BUG_ON((exit_code & (0x7f | ~0xffff)) != SIGTRAP); | 1973 | BUG_ON((exit_code & (0x7f | ~0xffff)) != SIGTRAP); |
1974 | if (unlikely(current->task_works)) { | ||
1975 | if (test_and_clear_ti_thread_flag(current_thread_info(), | ||
1976 | TIF_NOTIFY_RESUME)) { | ||
1977 | smp_mb__after_clear_bit(); | ||
1978 | task_work_run(); | ||
1979 | } | ||
1980 | } | ||
1974 | 1981 | ||
1975 | spin_lock_irq(¤t->sighand->siglock); | 1982 | spin_lock_irq(¤t->sighand->siglock); |
1976 | ptrace_do_notify(SIGTRAP, exit_code, CLD_TRAPPED); | 1983 | ptrace_do_notify(SIGTRAP, exit_code, CLD_TRAPPED); |
@@ -2191,6 +2198,14 @@ int get_signal_to_deliver(siginfo_t *info, struct k_sigaction *return_ka, | |||
2191 | struct signal_struct *signal = current->signal; | 2198 | struct signal_struct *signal = current->signal; |
2192 | int signr; | 2199 | int signr; |
2193 | 2200 | ||
2201 | if (unlikely(current->task_works)) { | ||
2202 | if (test_and_clear_ti_thread_flag(current_thread_info(), | ||
2203 | TIF_NOTIFY_RESUME)) { | ||
2204 | smp_mb__after_clear_bit(); | ||
2205 | task_work_run(); | ||
2206 | } | ||
2207 | } | ||
2208 | |||
2194 | if (unlikely(uprobe_deny_signal())) | 2209 | if (unlikely(uprobe_deny_signal())) |
2195 | return 0; | 2210 | return 0; |
2196 | 2211 | ||