From d4939f6dc22e5607cf2ff8d2a9eb1178e47b0a22 Mon Sep 17 00:00:00 2001 From: Kevin Krakauer Date: Tue, 14 Aug 2018 16:21:38 -0700 Subject: 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 --- pkg/sentry/fs/tty/slave.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'pkg/sentry/fs/tty/slave.go') 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. -- cgit v1.2.3