core: delegate mountns implicitly when any of pidns/cgns/netns is in use
This commit is contained in:
+11
-1
@@ -4275,7 +4275,17 @@ static bool exec_namespace_is_delegated(
|
||||
if (context->delegate_namespaces == NAMESPACE_FLAGS_INITIAL)
|
||||
return params->runtime_scope == RUNTIME_SCOPE_USER;
|
||||
|
||||
return FLAGS_SET(context->delegate_namespaces, namespace);
|
||||
if (FLAGS_SET(context->delegate_namespaces, namespace))
|
||||
return true;
|
||||
|
||||
/* Various namespaces imply mountns for private procfs/sysfs/cgroupfs instances, which means when
|
||||
* those are delegated mountns must be deferred too.
|
||||
*
|
||||
* The list should stay in sync with exec_needs_mount_namespace(). */
|
||||
if (namespace == CLONE_NEWNS)
|
||||
return context->delegate_namespaces & (CLONE_NEWPID|CLONE_NEWCGROUP|CLONE_NEWNET);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static int setup_delegated_namespaces(
|
||||
|
||||
Reference in New Issue
Block a user