Commit fe1bc6a0954611b806f9e158eb0817cf8ba21660
1 parent
edf2ed153b
Exists in
master
and in
39 other branches
ptrace: Add @why to ptrace_stop()
To prepare for cleanup of the interaction between group stop and ptrace, add @why to ptrace_stop(). Existing users are updated such that there is no behavior change. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Roland McGrath <roland@redhat.com>
Showing 1 changed file with 4 additions and 4 deletions Side-by-side Diff
kernel/signal.c
... | ... | @@ -1617,7 +1617,7 @@ |
1617 | 1617 | * If we actually decide not to stop at all because the tracer |
1618 | 1618 | * is gone, we keep current->exit_code unless clear_code. |
1619 | 1619 | */ |
1620 | -static void ptrace_stop(int exit_code, int clear_code, siginfo_t *info) | |
1620 | +static void ptrace_stop(int exit_code, int why, int clear_code, siginfo_t *info) | |
1621 | 1621 | __releases(¤t->sighand->siglock) |
1622 | 1622 | __acquires(¤t->sighand->siglock) |
1623 | 1623 | { |
... | ... | @@ -1655,7 +1655,7 @@ |
1655 | 1655 | spin_unlock_irq(¤t->sighand->siglock); |
1656 | 1656 | read_lock(&tasklist_lock); |
1657 | 1657 | if (may_ptrace_stop()) { |
1658 | - do_notify_parent_cldstop(current, CLD_TRAPPED); | |
1658 | + do_notify_parent_cldstop(current, why); | |
1659 | 1659 | /* |
1660 | 1660 | * Don't want to allow preemption here, because |
1661 | 1661 | * sys_ptrace() needs this task to be inactive. |
... | ... | @@ -1714,7 +1714,7 @@ |
1714 | 1714 | |
1715 | 1715 | /* Let the debugger run. */ |
1716 | 1716 | spin_lock_irq(¤t->sighand->siglock); |
1717 | - ptrace_stop(exit_code, 1, &info); | |
1717 | + ptrace_stop(exit_code, CLD_TRAPPED, 1, &info); | |
1718 | 1718 | spin_unlock_irq(¤t->sighand->siglock); |
1719 | 1719 | } |
1720 | 1720 | |
... | ... | @@ -1795,7 +1795,7 @@ |
1795 | 1795 | ptrace_signal_deliver(regs, cookie); |
1796 | 1796 | |
1797 | 1797 | /* Let the debugger run. */ |
1798 | - ptrace_stop(signr, 0, info); | |
1798 | + ptrace_stop(signr, CLD_TRAPPED, 0, info); | |
1799 | 1799 | |
1800 | 1800 | /* We're back. Did the debugger cancel the sig? */ |
1801 | 1801 | signr = current->exit_code; |