summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/kernel
diff options
context:
space:
mode:
authorNicolas Lacasse <nlacasse@google.com>2021-02-19 17:36:44 -0800
committergVisor bot <gvisor-bot@google.com>2021-02-19 17:38:51 -0800
commit93fc09248a2fa8b840d8ce47800414980d74bdb0 (patch)
tree6006fc6b336315a4ae272782b8afb5c1130a9b2b /pkg/sentry/kernel
parent7544eeb242d0aba2da054a1663e043feaedb9618 (diff)
Don't hold baseEndpoint.mu while calling EventUpdate().
This removes a three-lock deadlock between fdnotifier.notifier.mu, epoll.EventPoll.listsMu, and baseEndpoint.mu. A lock order comment was added to epoll/epoll.go. Also fix unsafe access of baseEndpoint.connected/receiver. PiperOrigin-RevId: 358515191
Diffstat (limited to 'pkg/sentry/kernel')
-rw-r--r--pkg/sentry/kernel/epoll/epoll.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/pkg/sentry/kernel/epoll/epoll.go b/pkg/sentry/kernel/epoll/epoll.go
index 61aeca044..407b6e917 100644
--- a/pkg/sentry/kernel/epoll/epoll.go
+++ b/pkg/sentry/kernel/epoll/epoll.go
@@ -14,6 +14,12 @@
// Package epoll provides an implementation of Linux's IO event notification
// facility. See epoll(7) for more details.
+//
+// Lock order:
+// EventPoll.mu
+// fdnotifier.notifier.mu
+// EventPoll.listsMu
+// unix.baseEndpoint.Mutex
package epoll
import (