From d48bf06e18c22f8304f6066b60fa560452dbd71f Mon Sep 17 00:00:00 2001 From: Mark Yen Date: Tue, 3 Oct 2023 16:58:10 -0700 Subject: [PATCH] Don't support cgroupns on cgroups v1 Fixes #4108 Signed-off-by: Mark Yen --- executor/oci/spec_linux.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/executor/oci/spec_linux.go b/executor/oci/spec_linux.go index cd9912b90..50121f790 100644 --- a/executor/oci/spec_linux.go +++ b/executor/oci/spec_linux.go @@ -150,9 +150,13 @@ func getTracingSocket() string { func cgroupNamespaceSupported() bool { cgroupNSOnce.Do(func() { - if _, err := os.Stat("/proc/self/ns/cgroup"); !os.IsNotExist(err) { - supportsCgroupNS = true + if _, err := os.Stat("/proc/self/ns/cgroup"); os.IsNotExist(err) { + return } + if _, err := os.Stat("/sys/fs/cgroup/cgroup.subtree_control"); os.IsNotExist(err) { + return + } + supportsCgroupNS = true }) return supportsCgroupNS }