summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/kernel
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2020-01-27 16:35:38 -0800
committergVisor bot <gvisor-bot@google.com>2020-01-27 16:35:38 -0800
commitdb68c85ab707b992c27d66b095165a33a621dc2d (patch)
treea32dbfb823fd0263dc4a72259d17c4c387a4b05c /pkg/sentry/kernel
parent253c9e666cf7d52352da97d764818e510f1387c0 (diff)
parent376a777c55680f8139313d87bd460248fd251941 (diff)
Merge pull request #1561 from zhangningdlut:chris_tty
PiperOrigin-RevId: 291821850
Diffstat (limited to 'pkg/sentry/kernel')
-rw-r--r--pkg/sentry/kernel/tty.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/pkg/sentry/kernel/tty.go b/pkg/sentry/kernel/tty.go
index 464d2306a..d0e0810e8 100644
--- a/pkg/sentry/kernel/tty.go
+++ b/pkg/sentry/kernel/tty.go
@@ -33,6 +33,8 @@ type TTY struct {
// TTY returns the thread group's controlling terminal. If nil, there is no
// controlling terminal.
func (tg *ThreadGroup) TTY() *TTY {
+ tg.pidns.owner.mu.RLock()
+ defer tg.pidns.owner.mu.RUnlock()
tg.signalHandlers.mu.Lock()
defer tg.signalHandlers.mu.Unlock()
return tg.tty