ptrace_repor...permit_entry(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… ptrace_report_syscall_permit_entry β€” Kernel API Manual energy ✨

okay so bestie, we're in the Kernel API Manual today and this function is literally the bouncer at the door of syscall town πŸšͺ✨


πŸŽ€ NAME πŸŽ€

ptrace_report_syscall_permit_entry β€” the task is about to attempt a system call, and we're all up in its business before it happens πŸ‘€


πŸ¦‹ SYNOPSIS πŸ¦‹

bool ptrace_report_syscall_permit_entry (struct pt_regs *regs );

🌸 ARGUMENTS 🌸

  • regs β€” the user register state of the current task. like, the whole vibe of what this task is doing rn πŸ’…

⭐ DESCRIPTION ⭐

so here's the tea β˜• this one gets called if SYSCALL_WORK_SYSCALL_TRACE or SYSCALL_WORK_SYSCALL_EMU have been set, at the exact moment the current task has just entered the kernel for a system call. full user register state is available right here, no cap πŸ™Œ

and like β€” changing the values in regs can literally affect the system call number and the arguments that are about to be tried. main character behaviour fr. also it is safe to block here, which prevents the system call from beginning. iconic πŸ›‘

returns True normally, or False if the calling architecture code should abort the system call. and if it returns False, that must prevent normal entry so that no system call is made. periodt.

⚠️ okay heads up bestie: if the task ever returns to user mode after this, its register state is unspecified β€” but it should be something harmless like an ENOSYS error return. it should also preserve enough information so that syscall_rollback can work (see asm-generic/syscall.h). don't skip that part, it's giving important πŸ”₯

called without locks, just after entering kernel mode 🧚


πŸ‘‘ SEE ALSO πŸ‘‘

kernel file ./include/linux/ptrace.h and also all of these besties:


🫢 mwah, that's the whole page! this lil beauty lives over in ./include/linux and it's dated October 2026 β€” go off, kernel docs, we love to see it πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from