diff options
author | Kevin Krakauer <krakauer@google.com> | 2018-08-14 16:21:38 -0700 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2018-08-14 16:22:56 -0700 |
commit | d4939f6dc22e5607cf2ff8d2a9eb1178e47b0a22 (patch) | |
tree | c608c0bb4738d3626d7e71db0e32d4cb0bd781fe /pkg/sentry/fs/tty/slave.go | |
parent | 12a4912aedc834fc8f404dc1ffeaa37088dd2d6b (diff) |
TTY: Fix data race where calls into tty.queue's waiter were not synchronized.
Now, there's a waiter for each end (master and slave) of the TTY, and each
waiter.Entry is only enqueued in one of the waiters.
PiperOrigin-RevId: 208734483
Change-Id: I06996148f123075f8dd48cde5a553e2be74c6dce
Diffstat (limited to 'pkg/sentry/fs/tty/slave.go')
-rw-r--r-- | pkg/sentry/fs/tty/slave.go | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/pkg/sentry/fs/tty/slave.go b/pkg/sentry/fs/tty/slave.go index 1c562b172..ab92ced7e 100644 --- a/pkg/sentry/fs/tty/slave.go +++ b/pkg/sentry/fs/tty/slave.go @@ -109,14 +109,12 @@ func (sf *slaveFileOperations) Release() { // EventRegister implements waiter.Waitable.EventRegister. func (sf *slaveFileOperations) EventRegister(e *waiter.Entry, mask waiter.EventMask) { - sf.si.t.ld.outQueue.EventRegister(e, mask) - sf.si.t.ld.inQueue.EventRegister(e, mask) + sf.si.t.ld.slaveWaiter.EventRegister(e, mask) } // EventUnregister implements waiter.Waitable.EventUnregister. func (sf *slaveFileOperations) EventUnregister(e *waiter.Entry) { - sf.si.t.ld.outQueue.EventUnregister(e) - sf.si.t.ld.inQueue.EventUnregister(e) + sf.si.t.ld.slaveWaiter.EventUnregister(e) } // Readiness implements waiter.Waitable.Readiness. |