cap_task_prctl(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… cap_task_prctl(9) β€” the Kernel API Manual, bestie edition πŸŽ€

okay so welcome to cap_task_prctl(9) from the Kernel API Manual β€” yes, we're reading kernel docs together, this is our bonding era ✨


🌸 NAME 🌸

cap_task_prctl β€” the function that implements process control stuff for this security module, no cap 🧒


✨ SYNOPSIS ✨

int cap_task_prctl (int option , unsigned long arg2 , unsigned long arg3
, unsigned long arg4 , unsigned long arg5 );

like... look at all those unsigned longs. she's thorough. she's committed. we respect her πŸ’œ


πŸ¦‹ ARGUMENTS πŸ¦‹

  • option β€” the process control function that's being requested, iykyk πŸ‘‘
  • arg2 β€” the argument data for this function πŸ“
  • arg3 β€” the argument data for this function πŸ“
  • arg4 β€” the argument data for this function πŸ“
  • arg5 β€” the argument data for this function πŸ“

(not me listing the same description four times 😭 but that's what the page says and I am nothing if not faithful πŸ’€)


πŸ”₯ DESCRIPTION πŸ”₯

so basically, this lets process control functions (sys_prctl) alter capabilities. that's the main character energy right there πŸ’…

she may also deny access to other functions that aren't otherwise implemented here β€” yes, she can gatekeep, and honestly? she's earned it. periodt.


🌈 RETURN 🌈

  • 0 or a positive value (+ve) on success β€” slay 🫢
  • -ENOSYS if this function is not implemented here β€” the "not me, ask someone else" vibe πŸ™ˆ
  • other negative (-ve) values on error β€” it's giving "something went wrong" πŸ’€
important little aside: if -ENOSYS gets returned, then sys_prctl and other LSM modules will consider performing the function themselves. so it's not a hard no, it's a "you go ahead, girl" πŸ’–

⭐ SEE ALSO ⭐

Kernel file ./security/commoncap.c, plus the whole friend group: cap_capable_helper(9), cap_capable(9), cap_settime(9), cap_ptrace_access_check(9), cap_ptrace_traceme(9), cap_capget(9), cap_capset(9), cap_inode_need_killpriv(9), cap_inode_killpriv(9), kuid_root_in_ns(9), rootid_from_xattr(9), cap_convert_nscap(9), get_vfs_caps_from_disk(9), cap_bprm_creds_from_file(9), cap_inode_setxattr(9), cap_inode_removexattr(9), cap_task_fix_setuid(9), cap_task_setscheduler(9), cap_task_setioprio(9), cap_task_setnice(9), cap_vm_enough_memory(9), cap_mmap_addr(9) β€” that's the entire squad, go say hi πŸ¦‹πŸ’œ


k bye bestie, mwah πŸ’‹

this iconic little page lives in ./security, drop date October 2026, and it's the cap_task_prctl(9) entry β€” go forth and prctl responsibly πŸŽ€βœ¨

πŸ“¦ where this page comes from