common_perm_create(9)
π common_perm_create β the manual, but make it make sense
okay so bestie, welcome to common_perm_create(9) π this one lives in the Kernel API Manual and it's literally the common permission wrapper for operations doing create. that's the whole vibe. you're checking perms before something gets made. slay.
β¨ NAME β¨
common_perm_create β the common permission wrapper for operations doing create π
π¦ SYNOPSIS π¦
int common_perm_create (const char *op , const struct path *dir , struct
dentry *dentry , u32 mask , umode_t mode );
copy it exactly like that, no cap, the line break is part of the original and we respect the original π
πΈ ARGUMENTS πΈ
opβ the operation that's being checked. like, which thing are we doing rn πdirβ the directory thatdentryis gonna get created in. and bestie, it's (NOT NULL) β do not come in here with a null, that's not the energy πdentryβ the dentry you're creating. also (NOT NULL). same rule, no nulls allowed, periodt β¨maskβ the request permission mask πmodeβ the mode of the file being created π
π₯ RETURN π₯
returns 0, else an error code if there's an error or permission was denied π that's it, that's the contract.
lowkey important: 0 means we're good. anything else means error or permission denied β the doc does not separate those two for you, so don't go assuming.
π SEE ALSO π
Kernel file ./security/apparmor/lsm.c β that's the source of truth, go look π«Ά
common_perm(9)common_perm_cond(9)common_perm_dir_dentry(9)common_perm_rm(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 eighteen references, i counted, we're not skipping a single one, iykyk π
sign-off time π§ this absolute icon of a page comes from ./security/apparmor and it's dated October 2026 β and yes the manual name really is Kernel API Manual, we just folded it in up top instead of doing the boring header line thing π
go create something (with permission) bestie, mwah πβ
π¦ 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