from_kuid_munged(9)
π from_kuid_munged β Kernel API Manual β¨
okay so real talk, today we're doing a page from the Kernel API Manual and honestly? she's iconic. her name is from_kuid_munged(9) and she does exactly one thing but she does it flawlessly. let's get into it π«Ά
πΈ NAME πΈ
from_kuid_munged β create a uid from a kuid user-namespace pair π
β¨ SYNOPSIS β¨
uid_t from_kuid_munged (struct user_namespace *targ , kuid_t kuid );
literally the whole signature, no notes, copy it exactly bestie π
π ARGUMENTS π
targβ the user namespace we want auidin. like, where do you want this uid to live? πkuidβ the kernel internal uid to start with. this is the raw one, the starting point, the before picture π
π¦ DESCRIPTION π¦
So what she does: map kuid into the user namespace specified by targ, and return the resulting uid. That's it. That's the whole vibe. π
Also important, and I cannot stress this enough: there is always a mapping into the initial user_namespace. like, always always. no cap. β
Now here's the part that makes her the main character β unlike from_kuid, from_kuid_munged never fails and always returns a valid uid. The way that she just doesn't miss?? ππ₯ That's exactly why she's appropriate for use in syscalls like stat and getuid, where failing the system call and failing to provide a valid uid are not options. Like, in those situations you genuinely cannot be out here returning nothing. she said "I'll handle it" and she handled it. π
And if kuid has no mapping in targ? she returns overflowuid. not a crash, not an error, just overflowuid. that's the fallback, that's the safety net, that's her being a responsible queen. π§
π SEE ALSO π
Kernel file ./kernel/user_namespace.c β go read her home π
make_kuid(9)from_kuid(9)make_kgid(9)from_kgid(9)from_kgid_munged(9)make_kprojid(9)from_kprojid(9)from_kprojid_munged(9)verify_root_map(9)
the whole friend group fr fr, go say hi to all of them π¦β¨
okay that's the whole page!! tysm for reading, mwah π
this lil gem lives in ./kernel, dated October 2026 β and that's the footer, so like... we're done here. bye bestie, slay, drink water π
π
π¦ 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