test_kuid_r...with_mapping(9)
π 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 1000ownstest_nsbecausefrom_kuid(test_ns, 1000) == 0kuid 0also ownstest_nsbecausefrom_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 π
- Kernel file
./security/commoncap_test.c test_vfsuid_root_in_currentns_init_ns(9)test_vfsuid_root_in_currentns_invalid(9)test_vfsuid_root_in_currentns_nonzero(9)test_kuid_root_in_ns_init_ns_uid0(9)test_kuid_root_in_ns_init_ns_nonzero(9)create_test_user_ns_with_mapping(9)test_kuid_root_in_ns_with_different_mappings(9)
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
- 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