ptrace_may_access(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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


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