Skip to content

Commit a225f15

Browse files
parport0ldv-alt
authored andcommitted
powerpc/ptrace: replace ptrace_report_syscall() with a tracehook call
Arch code should use tracehook_*() helpers, as documented in include/linux/tracehook.h, ptrace_report_syscall() is not expected to be used outside that file. The patch does not look very nice, but at least it is correct and opens the way for PTRACE_GET_SYSCALL_INFO API. Co-authored-by: Dmitry V. Levin <ldv@altlinux.org> Fixes: 5521eb4 ("powerpc/ptrace: Add support for PTRACE_SYSEMU") Signed-off-by: Elvira Khabirova <lineprinter@altlinux.org> Signed-off-by: Dmitry V. Levin <ldv@altlinux.org> [mpe: Take this as a minimal fix for 4.20, we'll rework it later] Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
1 parent 9ef3463 commit a225f15

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

arch/powerpc/kernel/ptrace.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3266,12 +3266,17 @@ long do_syscall_trace_enter(struct pt_regs *regs)
32663266
user_exit();
32673267

32683268
if (test_thread_flag(TIF_SYSCALL_EMU)) {
3269-
ptrace_report_syscall(regs);
32703269
/*
3270+
* A nonzero return code from tracehook_report_syscall_entry()
3271+
* tells us to prevent the syscall execution, but we are not
3272+
* going to execute it anyway.
3273+
*
32713274
* Returning -1 will skip the syscall execution. We want to
32723275
* avoid clobbering any register also, thus, not 'gotoing'
32733276
* skip label.
32743277
*/
3278+
if (tracehook_report_syscall_entry(regs))
3279+
;
32753280
return -1;
32763281
}
32773282

0 commit comments

Comments
 (0)