cap_inode_killpriv(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… cap_inode_killpriv(9)

okay so bestie, welcome to the Kernel API Manual β€” this one lives in section 9, and honestly it's giving "small function, big responsibility" energy. Let's get into it 🫢


✨ NAME ✨

cap_inode_killpriv β€” Erase the security markings on an inode

like, the whole personality of this function is "un-mark the inode". that's it. that's the vibe. 🧹


🌸 SYNOPSIS 🌸

int cap_inode_killpriv (struct mnt_idmap *idmap , struct dentry *dentry );

returns an int, takes two args, no cap. we love a simple signature fr fr πŸ’–


πŸŽ€ ARGUMENTS πŸŽ€

  • idmap β€” the idmap of the mount the inode was found from. yes it matters, no you can't just skip it (see DESCRIPTION, i'm being so serious 😭)
  • dentry β€” the inode/dentry to alter. this is the thing getting its vibe checked.

πŸ’… DESCRIPTION πŸ’…

Erase the privilege-enhancing security markings on an inode. that's the mission. that's the whole quest. πŸ—‘οΈβœ¨

okay so here's the part where you have to actually pay attention, bestie:

if the inode has been found through an idmapped mount, the idmap of the vfsmount must be passed through idmap. not optional. not "eh, close enough". the function will then take care to map the inode according to idmap before checking permissions β€” so the permission check sees the mapped version, not the raw one. mapping first, checking second. that order is the whole point πŸ‘‘

on non-idmapped mounts, or if permission checking is to be performed on the raw inode, simply pass nop_mnt_idmap. that's your escape hatch. that's the one you want. πŸ•ŠοΈ

ngl, mixing these up is the classic mistake β€” if you're on an idmapped mount and you pass nop_mnt_idmap, you're not doing the mapping thing at all. so like… don't. πŸ’€

🌈 RETURN 🌈

  • 0 if successful ✨
  • -ve on error 😭 (negative value, as always β€” kernel tradition, we respect it)

πŸ¦‹ SEE ALSO πŸ¦‹

Kernel file ./security/commoncap.c β€” and literally the whole friend group:

i mean look at that roster. chef's kiss. go read them, they ate πŸ”₯


okay that's the whole page!! source is ./security, and it's dated October 2026 β€” so like, future-dated manpage, main character energy honestly πŸ‘‘βœ¨ mwah, bye bestie, go erase some markings πŸ’œπŸŽ€

πŸ“¦ where this page comes from