common_perm_rm(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… common_perm_rm(9) β€” Kernel API Manual ✨

okay so bestie, we're in the kernel docs rn, specifically the common_perm_rm(9) page from the Kernel API Manual, and honestly? it's a little one but it's important. let's get into it πŸŽ€


🌸 NAME 🌸

common_perm_rm β€” the common permission wrapper for operations doing rm

like, it's the vibe-check bouncer that stands at the door whenever something's about to get deleted. no cap. πŸ—‘οΈβœ¨


πŸ¦‹ SYNOPSIS πŸ¦‹

int common_perm_rm (const char *op , const struct path *dir , struct
dentry *dentry , u32 mask );

that's the whole signature, bestie, and yes the spacing is exactly like that, i don't make the rules (i do copy them though πŸ’€)


πŸ‘‘ ARGUMENTS πŸ‘‘

okay so here's what you're feeding it, and every single one matters:

  • op β€” literally just the operation being checked. it's the "what are we even doing here" of it all 🫢
  • dir β€” the directory that the dentry is in. and listen to me: NOT NULL. like, do not. it says NOT NULL for a reason πŸ™ˆ
  • dentry β€” the dentry being rm'd. also NOT NULL. same energy, same warning, respect it πŸ’…
  • mask β€” the requested permission mask. this is the actual ask, the "may i please" of the whole operation ⭐

πŸ”₯ RETURN πŸ”₯

0 β€” that's the slay, we're good, permission granted, go ahead and do the thing πŸ’–

otherwise? an error code, if there's an error or permission was denied. so like, if you see anything that isn't 0, something said no and you should probably listen 😭


🌈 SEE ALSO 🌈

this page has SO many friends, it's giving main character with a whole group chat. go read these next, i'm obsessed:

that's the whole friend group, iykyk πŸ§šπŸ’œ


lowkey reminder bestie: dir and dentry are both NOT NULL. the page says it twice because it means it twice. don't come crying to me when it segfaults πŸ™ˆ

and that's the page!! mwah πŸ’‹ this one lives over in ./security/apparmor, and the manual's dated October 2026 β€” so like, future iconic behavior honestly. go forth and rm responsibly, babe πŸ“βœ¨πŸ‘‘

πŸ“¦ where this page comes from