commit_creds(9)
π commit_creds β the Kernel API Manual, bestie edition
okay so you found commit_creds(9) in the Kernel API Manual and you're like "what does this even do" β don't worry, I got you β¨
π NAME π
commit_creds β install new credentials upon the current task. like, it's literally the glow-up function for a task's creds π
πΈ SYNOPSIS πΈ
int commit_creds (struct cred *new );
π¦ ARGUMENTS π¦
newβ the credentials to be assigned. the fresh fit, if you will π
β¨ DESCRIPTION β¨
So what it does: it installs a new set of credentials onto the current task, using RCU to replace the old set. Both the objective and the subjective credential pointers get updated β yes, both, it's giving full-coverage π
β οΈ heads up bestie: this function may not be called if the subjective credentials are in an overridden state. that's a hard no, no cap.
Also important, and I need you to hear me on this: this function eats the caller's reference to the new credentials. like it consumes the reference. gone. devoured. π so don't go touching that reference after, mwah.
And the best part? It always returns 0. always. icon behaviour fr fr. which is exactly why it can be tail-called at the end of β say β sys_setgid. slay π«Ά
π SEE ALSO π
Kernel file ./kernel/cred.c β go read it, iykyk π§
__put_cred(9)get_task_cred(9)prepare_creds(9)abort_creds(9)cred_fscmp(9)prepare_kernel_cred(9)set_security_override(9)set_create_files_as(9)
okay that's the whole vibe π this little love letter comes straight from ./kernel, dated October 2026, and it's filed under commit_creds(9) β periodt πβ
π¦ 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