Re: [patch 12/18] ptrace, treewide: Rename ptrace_report_syscall_entry() to ptrace_report_syscall_permit_entry()
From: Mukesh Kumar Chaurasiya
Date: Thu Jul 09 2026 - 15:23:14 EST
On Tue, Jul 07, 2026 at 09:06:44PM +0200, Thomas Gleixner wrote:
> The return value of that function is boolean and tells the caller whether
> to permit the syscall processing or not.
>
> Rename the function so the purpose is clear and make the return type bool.
>
> Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxx>
> Cc: Arnd Bergmann <arnd@xxxxxxxx>
> Cc: Oleg Nesterov <oleg@xxxxxxxxxx>
> Cc: Richard Henderson <richard.henderson@xxxxxxxxxx>
> Cc: Vineet Gupta <vgupta@xxxxxxxxxx>
> Cc: Russell King <linux@xxxxxxxxxxxxxxx>
> Cc: Catalin Marinas <catalin.marinas@xxxxxxx>
> Cc: Will Deacon <will@xxxxxxxxxx>
> Cc: Guo Ren <guoren@xxxxxxxxxx>
> Cc: Brian Cain <bcain@xxxxxxxxxx>
> Cc: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>
> Cc: Michal Simek <monstr@xxxxxxxxx>
> Cc: Thomas Bogendoerfer <tsbogend@xxxxxxxxxxxxxxxx>
> Cc: Dinh Nguyen <dinguyen@xxxxxxxxxx>
> Cc: Helge Deller <deller@xxxxxx>
> Cc: Yoshinori Sato <ysato@xxxxxxxxxxxxxxxxxxxx>
> Cc: "David S. Miller" <davem@xxxxxxxxxxxxx>
> Cc: Andreas Larsson <andreas@xxxxxxxxxxx>
> Cc: Chris Zankel <chris@xxxxxxxxxx>
> Cc: linux-alpha@xxxxxxxxxxxxxxx
> Cc: linux-snps-arc@xxxxxxxxxxxxxxxxxxx
> Cc: linux-arm-kernel@xxxxxxxxxxxxxxxxxxx
> Cc: linux-csky@xxxxxxxxxxxxxxx
> Cc: linux-hexagon@xxxxxxxxxxxxxxx
> Cc: linux-m68k@xxxxxxxxxxxxxxxxxxxx
> Cc: linux-mips@xxxxxxxxxxxxxxx
> Cc: linux-openrisc@xxxxxxxxxxxxxxx
> Cc: linux-parisc@xxxxxxxxxxxxxxx
> Cc: linux-sh@xxxxxxxxxxxxxxx
> Cc: sparclinux@xxxxxxxxxxxxxxx
> Cc: linux-um@xxxxxxxxxxxxxxxxxxx
> Cc: linux-arch@xxxxxxxxxxxxxxx
> ---
> arch/alpha/kernel/ptrace.c | 2 +-
> arch/arc/kernel/ptrace.c | 2 +-
> arch/arm/kernel/ptrace.c | 2 +-
> arch/arm64/kernel/ptrace.c | 2 +-
> arch/csky/kernel/ptrace.c | 2 +-
> arch/hexagon/kernel/traps.c | 2 +-
> arch/m68k/kernel/ptrace.c | 2 +-
> arch/microblaze/kernel/ptrace.c | 2 +-
> arch/mips/kernel/ptrace.c | 2 +-
> arch/nios2/kernel/ptrace.c | 2 +-
> arch/openrisc/kernel/ptrace.c | 2 +-
> arch/parisc/kernel/ptrace.c | 10 ++++------
> arch/sh/kernel/ptrace_32.c | 2 +-
> arch/sparc/kernel/ptrace_32.c | 2 +-
> arch/sparc/kernel/ptrace_64.c | 2 +-
> arch/um/kernel/ptrace.c | 2 +-
> arch/xtensa/kernel/ptrace.c | 2 +-
> include/asm-generic/syscall.h | 4 ++--
> include/linux/entry-common.h | 25 ++++++++++++-------------
> include/linux/ptrace.h | 13 ++++++-------
> 20 files changed, 40 insertions(+), 44 deletions(-)
>
[...]
> --- a/arch/parisc/kernel/ptrace.c
> +++ b/arch/parisc/kernel/ptrace.c
> @@ -326,7 +326,7 @@ long compat_arch_ptrace(struct task_stru
> long do_syscall_trace_enter(struct pt_regs *regs)
> {
> if (test_thread_flag(TIF_SYSCALL_TRACE)) {
> - int rc = ptrace_report_syscall_entry(regs);
> + bool permit = ptrace_report_syscall_permit_entry(regs);
>
> /*
> * As tracesys_next does not set %r28 to -ENOSYS
> @@ -334,12 +334,10 @@ long do_syscall_trace_enter(struct pt_re
> */
> regs->gr[28] = -ENOSYS;
>
> - if (rc) {
> + if (!permit) {
> /*
> - * A nonzero return code from
> - * ptrace_report_syscall_entry() tells us
> - * to prevent the syscall execution. Skip
> - * the syscall call and the syscall restart handling.
> + * Skip the syscall call and the syscall restart
> + * handling.
Hey Thomas,
This comment `syscall call` sounds a bit weird.
Apart from this, Everything looks good.
Regards,
Mukesh
Reviewed-by: Mukesh Kumar Chaurasiya (IBM) <mkchauras@xxxxxxxxx>