ptrace_may_access(9)
π
ptrace_may_access β Kernel API Manual energy π
okay so bestie, welcome to ptrace_may_access(9). This is the Kernel API Manual moment where we check whether the caller is even permitted to access a target task. Itβs giving permissions vibe check, and honestly? iconic. π«Ά
πΈ NAME πΈ
ptrace_may_access β check whether the caller is permitted to access a target task.
π SYNOPSIS π
bool ptrace_may_access (struct task_struct *task , unsigned int mode );
π¦ ARGUMENTS π¦
taskβ the target task. The one getting the access check. πmodeβ selects the type of access and the caller credentials. Itβs the little settings bag for this whole operation. β¨
π₯ DESCRIPTION π₯
Returns true on success, false on denial. Thatβs the whole result arc, no cap.
One of the flags PTRACE_MODE_FSCREDS and PTRACE_MODE_REALCREDS must be set in mode to specify whether the access was requested through a filesystem syscall (should use effective capabilities and fsuid of the caller) or through an explicit syscall such as process_vm_writev or ptrace (and should use the real credentials). So yeah, mode has to carry one of those flags β itβs not optional, bestie. π
π SEE ALSO π
Kernel file: ./include/linux/ptrace.h
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_permit_entry(9)ptrace_report_syscall_exit(9)
source/version: ./include/linux β¨ date: October 2026 β¨ page title: ptrace_may_access(9) β bye bestie, go check those permissions responsibly ππ¦
π¦ 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