common_perm_rm(9)
π 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:
- Kernel file
./security/apparmor/lsm.c common_perm(9)common_perm_cond(9)common_perm_dir_dentry(9)common_perm_create(9)apparmor_uring_override_creds(9)apparmor_uring_sqpoll(9)apparmor_bprm_committing_creds(9)apparmor_bprm_committed_creds(9)apparmor_sk_clone_security(9)apparmor_unix_stream_connect(9)apparmor_unix_may_send(9)apparmor_socket_post_create(9)apparmor_socket_bind(9)apparmor_socket_getpeersec_stream(9)apparmor_socket_getpeersec_dgram(9)apparmor_sock_graft(9)apparmor_socket_sock_rcv_skb(9)set_init_ctx(9)
that's the whole friend group, iykyk π§π
lowkey reminder bestie:diranddentryare 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
- 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