From f4f6ce337aa8ceb46a5a8f783efb770c9a8a2858 Mon Sep 17 00:00:00 2001 From: Rahat Mahmood Date: Mon, 12 Apr 2021 15:10:19 -0700 Subject: Don't grab TaskSet mu recursively when reading task state. Reported-by: syzbot+a6ef0f95a2c9e7da26f3@syzkaller.appspotmail.com Reported-by: syzbot+2eaf8a9f115edec468fe@syzkaller.appspotmail.com PiperOrigin-RevId: 368093861 --- pkg/sentry/kernel/kernel.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/sentry/kernel/kernel.go b/pkg/sentry/kernel/kernel.go index 9a4fd64cb..e6e9da898 100644 --- a/pkg/sentry/kernel/kernel.go +++ b/pkg/sentry/kernel/kernel.go @@ -1854,7 +1854,7 @@ func (k *Kernel) Release() { func (k *Kernel) PopulateNewCgroupHierarchy(root Cgroup) { k.tasks.mu.RLock() k.tasks.forEachTaskLocked(func(t *Task) { - if t.ExitState() != TaskExitNone { + if t.exitState != TaskExitNone { return } t.mu.Lock() @@ -1870,7 +1870,7 @@ func (k *Kernel) PopulateNewCgroupHierarchy(root Cgroup) { func (k *Kernel) ReleaseCgroupHierarchy(hid uint32) { k.tasks.mu.RLock() k.tasks.forEachTaskLocked(func(t *Task) { - if t.ExitState() != TaskExitNone { + if t.exitState != TaskExitNone { return } t.mu.Lock() -- cgit v1.2.3