test_kuid_r...with_mapping(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ test_kuid_root_in_ns_with_mapping β€” Kernel API Manual πŸŽ€

Okay bestie, let's get into this Kernel API Manual page. The manual name is Kernel API Manual, and the header title is test_kuid_r...with_mapping(9) β€” yes, that's the shortened header vibe. The actual function is test_kuid_root_in_ns_with_mapping. πŸ’…

🌸 NAME 🌸

test_kuid_root_in_ns_with_mapping β€” Test kuid_root_in_ns with a namespace where uid 0 maps to a different kuid. ✨

✨ SYNOPSIS ✨

void test_kuid_root_in_ns_with_mapping (struct kunit *test );

🫢 ARGUMENTS 🫢

  • test β€” KUnit test context. 🧚

πŸ’– DESCRIPTION πŸ’–

So this test creates a user namespace where uid 0 maps to kuid 1000 in the parent namespace. Then it verifies that kuid_root_in_ns correctly identifies kuid 1000 as owning the namespace. Slay. πŸ‘‘

πŸ‘‘ NOTE πŸ‘‘

Heads up, bestie: kuid_root_in_ns walks up the namespace hierarchy, so it checks the current namespace first, then parent, then parent's parent, etc. So:

  • kuid 1000 owns test_ns because from_kuid(test_ns, 1000) == 0
  • kuid 0 also owns test_ns because from_kuid(init_user_ns, 0) == 0 (checked in parent)

This tests the actual functionality as requested: creating namespaces with different values for the namespace's uid 0. No cap, fr fr. πŸ¦‹

🌈 SEE ALSO 🌈


Cute little sign-off: this page is from the Kernel API Manual, source/version ./security, dated October 2026, and the header name is test_kuid_r...with_mapping(9). Byeee, ily, go read those tests. πŸ’–πŸŽ€

πŸ“¦ where this page comes from