cap_capset(9)
π cap_capset β like, the kernel API manual, bestie β¨
okay so we're in cap_capset(9) territory, which is the kernel API manual, and honestly? this one is short but it ate. it's all about validating and applying proposed changes to current's capabilities. let's get into it π«Ά
πΈ NAME πΈ
cap_capset β validate and apply proposed changes to current's capabilities β¨
π SYNOPSIS π
int cap_capset (struct cred *new , const struct cred *old , const
kernel_cap_t *effective , const kernel_cap_t *inheritable , const
kernel_cap_t *permitted );
like, that's the whole signature, no cap. five arguments, one int coming back at you π
π ARGUMENTS π
newβ the proposed new credentials; alterations should be made here. this is the main character, the glow-up happens in this struct πoldβ the current task's current credentials. the before pic, basically πΈeffectiveβ a pointer to the proposed new effective capabilities set β¨inheritableβ a pointer to the proposed new inheritable capabilities set π§permittedβ a pointer to the proposed new permitted capabilities set π
π¦ DESCRIPTION π¦
okay so what does this function actually do? it validates and applies a proposed mass change to the current process's capability sets. mass change, bestie β we're not tweaking one flag, we're doing a whole wardrobe swap πβ¨
the changes are made to the proposed new credentials, and β assuming no error β will be committed by the caller of LSM. no error, no problem; error, and, well, it's giving "not today" π
ngl, the "assuming no error" part is doing a lot of heavy lifting there. if there is an error, the commit doesn't happen β that's the deal π«Ά
π₯ SEE ALSO π₯
the kernel file is at ./security/commoncap.c, and here's the whole friend group, fr fr:
cap_capable_helper(9)cap_capable(9)cap_settime(9)cap_ptrace_access_check(9)cap_ptrace_traceme(9)cap_capget(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_task_prctl(9)cap_vm_enough_memory(9)cap_mmap_addr(9)
like, that's the entire squad. collect them all πβ
π the cute sign-off π
this iconic little page comes from ./security β that's the source, bestie β and it's dated October 2026, version cap_capset(9). so like, future vibes but make it kernel πβ¨
go forth and validate those capabilities, queen. periodt π π
π¦ 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