summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry
diff options
context:
space:
mode:
authorJamie Liu <jamieliu@google.com>2020-03-13 16:08:06 -0700
committergVisor bot <gvisor-bot@google.com>2020-03-13 16:09:18 -0700
commitb0f2c3e7646df603156f1b8e8b3382f33353eb04 (patch)
tree6288491479b6816d00233f07a90a76a2ae225e43 /pkg/sentry
parentd8cf54f20f2dd7348d06796f29a42991086c3f81 (diff)
Fix infinite loop in semaphore.sem.wakeWaiters().
PiperOrigin-RevId: 300845134
Diffstat (limited to 'pkg/sentry')
-rw-r--r--pkg/sentry/kernel/semaphore/semaphore.go1
1 files changed, 1 insertions, 0 deletions
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{}{}