diff options
Diffstat (limited to 'kernel/signal.c')
-rw-r--r-- | kernel/signal.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/kernel/signal.c b/kernel/signal.c index 84917fe507f7..6af1210092c3 100644 --- a/kernel/signal.c +++ b/kernel/signal.c | |||
@@ -1623,7 +1623,6 @@ static void ptrace_stop(int exit_code, int clear_code, siginfo_t *info) | |||
1623 | /* Let the debugger run. */ | 1623 | /* Let the debugger run. */ |
1624 | __set_current_state(TASK_TRACED); | 1624 | __set_current_state(TASK_TRACED); |
1625 | spin_unlock_irq(¤t->sighand->siglock); | 1625 | spin_unlock_irq(¤t->sighand->siglock); |
1626 | try_to_freeze(); | ||
1627 | read_lock(&tasklist_lock); | 1626 | read_lock(&tasklist_lock); |
1628 | if (!unlikely(killed) && may_ptrace_stop()) { | 1627 | if (!unlikely(killed) && may_ptrace_stop()) { |
1629 | do_notify_parent_cldstop(current, CLD_TRAPPED); | 1628 | do_notify_parent_cldstop(current, CLD_TRAPPED); |
@@ -1641,6 +1640,13 @@ static void ptrace_stop(int exit_code, int clear_code, siginfo_t *info) | |||
1641 | } | 1640 | } |
1642 | 1641 | ||
1643 | /* | 1642 | /* |
1643 | * While in TASK_TRACED, we were considered "frozen enough". | ||
1644 | * Now that we woke up, it's crucial if we're supposed to be | ||
1645 | * frozen that we freeze now before running anything substantial. | ||
1646 | */ | ||
1647 | try_to_freeze(); | ||
1648 | |||
1649 | /* | ||
1644 | * We are back. Now reacquire the siglock before touching | 1650 | * We are back. Now reacquire the siglock before touching |
1645 | * last_siginfo, so that we are sure to have synchronized with | 1651 | * last_siginfo, so that we are sure to have synchronized with |
1646 | * any signal-sending on another CPU that wants to examine it. | 1652 | * any signal-sending on another CPU that wants to examine it. |
@@ -1757,9 +1763,15 @@ int get_signal_to_deliver(siginfo_t *info, struct k_sigaction *return_ka, | |||
1757 | sigset_t *mask = ¤t->blocked; | 1763 | sigset_t *mask = ¤t->blocked; |
1758 | int signr = 0; | 1764 | int signr = 0; |
1759 | 1765 | ||
1766 | relock: | ||
1767 | /* | ||
1768 | * We'll jump back here after any time we were stopped in TASK_STOPPED. | ||
1769 | * While in TASK_STOPPED, we were considered "frozen enough". | ||
1770 | * Now that we woke up, it's crucial if we're supposed to be | ||
1771 | * frozen that we freeze now before running anything substantial. | ||
1772 | */ | ||
1760 | try_to_freeze(); | 1773 | try_to_freeze(); |
1761 | 1774 | ||
1762 | relock: | ||
1763 | spin_lock_irq(¤t->sighand->siglock); | 1775 | spin_lock_irq(¤t->sighand->siglock); |
1764 | for (;;) { | 1776 | for (;;) { |
1765 | struct k_sigaction *ka; | 1777 | struct k_sigaction *ka; |