From c174470a2d7ae3940c07aa803923299a228c94d4 Mon Sep 17 00:00:00 2001 From: Rahat Mahmood Date: Thu, 6 Oct 2022 13:01:57 -0700 Subject: [PATCH] Clarify that auth.NewRootUserNamespace creates a distinct ns on each call. PiperOrigin-RevId: 479392054 --- pkg/sentry/kernel/auth/user_namespace.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/sentry/kernel/auth/user_namespace.go b/pkg/sentry/kernel/auth/user_namespace.go index 1f9151657..3f2557606 100644 --- a/pkg/sentry/kernel/auth/user_namespace.go +++ b/pkg/sentry/kernel/auth/user_namespace.go @@ -52,7 +52,10 @@ type UserNamespace struct { } // NewRootUserNamespace returns a UserNamespace that is appropriate for a -// system's root user namespace. +// system's root user namespace. Note that namespaces returned by separate calls +// to this function are *distinct* namespaces. Once a root namespace is created +// by this function, the returned value must be reused to refer to the same +// namespace. func NewRootUserNamespace() *UserNamespace { var ns UserNamespace // """