summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fsimpl/gofer/directory.go
diff options
context:
space:
mode:
authorJamie Liu <jamieliu@google.com>2020-11-06 23:20:08 -0800
committergVisor bot <gvisor-bot@google.com>2020-11-06 23:22:20 -0800
commit78cce3a46b953cab00731f8afacf7e9e7f4dc751 (patch)
tree2c700de76aad84671d2050ccf657895e70e56f16 /pkg/sentry/fsimpl/gofer/directory.go
parent917b6094e7125dd5457b863f3e856880893d5599 (diff)
Allow VFS2 gofer.dentries to have separate read and write FDs.
This is necessary to allow writes to files opened with O_WRONLY to go through host FDs. PiperOrigin-RevId: 341174509
Diffstat (limited to 'pkg/sentry/fsimpl/gofer/directory.go')
-rw-r--r--pkg/sentry/fsimpl/gofer/directory.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/pkg/sentry/fsimpl/gofer/directory.go b/pkg/sentry/fsimpl/gofer/directory.go
index ce1b2a390..3b5927702 100644
--- a/pkg/sentry/fsimpl/gofer/directory.go
+++ b/pkg/sentry/fsimpl/gofer/directory.go
@@ -98,7 +98,9 @@ func (d *dentry) createSyntheticChildLocked(opts *createSyntheticOpts) {
uid: uint32(opts.kuid),
gid: uint32(opts.kgid),
blockSize: usermem.PageSize, // arbitrary
- hostFD: -1,
+ readFD: -1,
+ writeFD: -1,
+ mmapFD: -1,
nlink: uint32(2),
}
refsvfs2.Register(child)