cap_capset(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

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

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