commit_creds(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 🧚


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