cap_task_prctl(9)
π 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 π
0or a positive value (+ve) on success β slay π«Ά-ENOSYSif 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-ENOSYSgets returned, thensys_prctland 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
- 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