diff options
author | Andrei Vagin <avagin@google.com> | 2020-11-18 18:35:14 -0800 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-11-18 18:37:31 -0800 |
commit | 764504c38fb589738f42a852c9288725dcf0f9f9 (patch) | |
tree | c66fa05244ee6e71a0b50ee494f9fabe41c44a7c /runsc/cgroup/cgroup_test.go | |
parent | 3a16b829c511757701d4370b8b38d162acb8ba9c (diff) |
runsc: check whether cgroup exists or not for each controller
We have seen a case when a memory cgroup exists but a perf_event one doesn't.
Reported-by: syzbot+f31468b61d1a27e629dc@syzkaller.appspotmail.com
Reported-by: syzbot+1f163ec0321768f1497e@syzkaller.appspotmail.com
PiperOrigin-RevId: 343200070
Diffstat (limited to 'runsc/cgroup/cgroup_test.go')
-rw-r--r-- | runsc/cgroup/cgroup_test.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/runsc/cgroup/cgroup_test.go b/runsc/cgroup/cgroup_test.go index 9794517a7..931144cf9 100644 --- a/runsc/cgroup/cgroup_test.go +++ b/runsc/cgroup/cgroup_test.go @@ -29,7 +29,10 @@ func TestUninstallEnoent(t *testing.T) { c := Cgroup{ // set a non-existent name Name: "runsc-test-uninstall-656e6f656e740a", - Own: true, + } + c.Own = make(map[string]bool) + for key := range controllers { + c.Own[key] = true } if err := c.Uninstall(); err != nil { t.Errorf("Uninstall() failed: %v", err) |