From b0f2c3e7646df603156f1b8e8b3382f33353eb04 Mon Sep 17 00:00:00 2001 From: Jamie Liu Date: Fri, 13 Mar 2020 16:08:06 -0700 Subject: Fix infinite loop in semaphore.sem.wakeWaiters(). PiperOrigin-RevId: 300845134 --- pkg/sentry/kernel/semaphore/semaphore.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/sentry/kernel/semaphore/semaphore.go b/pkg/sentry/kernel/semaphore/semaphore.go index 1000f3287..c00fa1138 100644 --- a/pkg/sentry/kernel/semaphore/semaphore.go +++ b/pkg/sentry/kernel/semaphore/semaphore.go @@ -554,6 +554,7 @@ func (s *sem) wakeWaiters() { for w := s.waiters.Front(); w != nil; { if s.value < w.value { // Still blocked, skip it. + w = w.Next() continue } w.ch <- struct{}{} -- cgit v1.2.3