Skip to content

Commit fe1bc6a

Browse files
committed
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>
1 parent edf2ed1 commit fe1bc6a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

kernel/signal.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1617,7 +1617,7 @@ static int sigkill_pending(struct task_struct *tsk)
16171617
* If we actually decide not to stop at all because the tracer
16181618
* is gone, we keep current->exit_code unless clear_code.
16191619
*/
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)
16211621
__releases(&current->sighand->siglock)
16221622
__acquires(&current->sighand->siglock)
16231623
{
@@ -1655,7 +1655,7 @@ static void ptrace_stop(int exit_code, int clear_code, siginfo_t *info)
16551655
spin_unlock_irq(&current->sighand->siglock);
16561656
read_lock(&tasklist_lock);
16571657
if (may_ptrace_stop()) {
1658-
do_notify_parent_cldstop(current, CLD_TRAPPED);
1658+
do_notify_parent_cldstop(current, why);
16591659
/*
16601660
* Don't want to allow preemption here, because
16611661
* sys_ptrace() needs this task to be inactive.
@@ -1714,7 +1714,7 @@ void ptrace_notify(int exit_code)
17141714

17151715
/* Let the debugger run. */
17161716
spin_lock_irq(&current->sighand->siglock);
1717-
ptrace_stop(exit_code, 1, &info);
1717+
ptrace_stop(exit_code, CLD_TRAPPED, 1, &info);
17181718
spin_unlock_irq(&current->sighand->siglock);
17191719
}
17201720

@@ -1795,7 +1795,7 @@ static int ptrace_signal(int signr, siginfo_t *info,
17951795
ptrace_signal_deliver(regs, cookie);
17961796

17971797
/* Let the debugger run. */
1798-
ptrace_stop(signr, 0, info);
1798+
ptrace_stop(signr, CLD_TRAPPED, 0, info);
17991799

18001800
/* We're back. Did the debugger cancel the sig? */
18011801
signr = current->exit_code;

0 commit comments

Comments
 (0)