Skip to content

Commit a403df2

Browse files
committed
ptrace/m68k: Stop open coding ptrace_report_syscall
The generic function ptrace_report_syscall does a little more than syscall_trace on m68k. The function ptrace_report_syscall stops early if PT_TRACED is not set, it sets ptrace_message, and returns the result of fatal_signal_pending. Setting ptrace_message to a passed in value of 0 is effectively not setting ptrace_message, making that additional work a noop. Returning the result of fatal_signal_pending and letting the caller ignore the result becomes a noop in this change. When a process is ptraced, the flag PT_PTRACED is always set in current->ptrace. Testing for PT_PTRACED in ptrace_report_syscall is just an optimization to fail early if the process is not ptraced. Later on in ptrace_notify, ptrace_stop will test current->ptrace under tasklist_lock and skip performing any work if the task is not ptraced. Cc: Geert Uytterhoeven <[email protected]> Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: "Eric W. Biederman" <[email protected]>
1 parent 4264178 commit a403df2

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

arch/m68k/kernel/ptrace.c

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -273,17 +273,7 @@ long arch_ptrace(struct task_struct *child, long request,
273273

274274
asmlinkage void syscall_trace(void)
275275
{
276-
ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD)
277-
? 0x80 : 0));
278-
/*
279-
* this isn't the same as continuing with a signal, but it will do
280-
* for normal use. strace only continues with a signal if the
281-
* stopping signal is not SIGTRAP. -brl
282-
*/
283-
if (current->exit_code) {
284-
send_sig(current->exit_code, current, 1);
285-
current->exit_code = 0;
286-
}
276+
ptrace_report_syscall(0);
287277
}
288278

289279
#if defined(CONFIG_COLDFIRE) || !defined(CONFIG_MMU)

0 commit comments

Comments
 (0)