summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fs
diff options
context:
space:
mode:
authorAdin Scannell <ascannell@google.com>2020-02-11 11:37:12 -0800
committergVisor bot <gvisor-bot@google.com>2020-02-11 11:38:08 -0800
commit115898e368e4afe5418a7290d9545fafc7f6f25e (patch)
tree0ab934bbf1753fec1b337db71d882d23a975e5bb /pkg/sentry/fs
parent762e4761cc4edd92108f6836ad1933c7158b8be8 (diff)
Prevent DATA RACE in UnstableAttr.
The slaveInodeOperations is currently copying the object when truncate is called (which is a no-op). This may result in a (unconsequential) data race when being modified concurrently. PiperOrigin-RevId: 294484276
Diffstat (limited to 'pkg/sentry/fs')
-rw-r--r--pkg/sentry/fs/tty/slave.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/pkg/sentry/fs/tty/slave.go b/pkg/sentry/fs/tty/slave.go
index db55cdc48..6a2dbc576 100644
--- a/pkg/sentry/fs/tty/slave.go
+++ b/pkg/sentry/fs/tty/slave.go
@@ -73,7 +73,7 @@ func (si *slaveInodeOperations) Release(ctx context.Context) {
}
// Truncate implements fs.InodeOperations.Truncate.
-func (slaveInodeOperations) Truncate(context.Context, *fs.Inode, int64) error {
+func (*slaveInodeOperations) Truncate(context.Context, *fs.Inode, int64) error {
return nil
}