ptrace_repor...permit_entry(9)
π 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 anENOSYSerror return. it should also preserve enough information so thatsyscall_rollbackcan work (seeasm-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:
ptrace_may_access(9)ptrace_parent(9)ptrace_event_enabled(9)ptrace_event(9)ptrace_event_pid(9)ptrace_init_task(9)ptrace_release_task(9)arch_has_single_step(9)user_enable_single_step(9)user_disable_single_step(9)arch_has_block_step(9)user_enable_block_step(9)arch_ptrace_stop_needed(9)arch_ptrace_stop(9)ptrace_report_syscall_exit(9)
π«Ά 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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms