cap_inode_killpriv(9)
π 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 π
0if successful β¨-veon error π (negative value, as always β kernel tradition, we respect it)
π¦ SEE ALSO π¦
Kernel file ./security/commoncap.c β and literally 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)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)
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
- 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