Thread (98 messages) 98 messages, 14 authors, 11h ago

Re: [patch 12/18] ptrace, treewide: Rename ptrace_report_syscall_entry() to ptrace_report_syscall_permit_entry()

From: Oleg Nesterov <oleg@redhat.com>
Date: 2026-07-10 11:17:59
Also in: linux-alpha, linux-arch, linux-doc, linux-m68k, linux-mips, linux-riscv, linux-s390, linux-sh, linux-um, lkml, loongarch, sparclinux

On 07/10, Michal Suchánek wrote:
quoted
--- a/arch/alpha/kernel/ptrace.c
+++ b/arch/alpha/kernel/ptrace.c
@@ -375,7 +375,7 @@ asmlinkage unsigned long syscall_trace_e
 	struct pt_regs *regs = current_pt_regs();

 	if (test_thread_flag(TIF_SYSCALL_TRACE) &&
-		ptrace_report_syscall_entry(regs)) {
+		!ptrace_report_syscall_permit_entry(regs)) {
 		syscall_set_nr(current, regs, -1);
Why is this done here?

Presumably the ptrace_report_syscall_entry returns false here becasue
the tracer put -1 into whatever register specifies the syscall number
(or it was there to start with) which was then read back, compared to
-1, leading to returning false.  Now it's set to -1 again?
I don't know why arch/alpha/ does syscall_set_nr(-1).

But note that ptrace_report_syscall_entry() doesn't even check whether
the syscall number was changed. It only checks fatal_signal_pending().

Oleg.

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help