summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/syscalls/linux/vfs2
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2020-05-06 23:11:01 +0000
committergVisor bot <gvisor-bot@google.com>2020-05-06 23:11:01 +0000
commitfec72f460c86236f4b84fbbd550da1c76dbe9bf1 (patch)
treead3cd28bb0a253028ad64398295f06e563dfc9c5 /pkg/sentry/syscalls/linux/vfs2
parent21cc7785b9ac904eed09b4cd905302374add4177 (diff)
parent7cd54c1f1437dccdf1840e8f893de06f9d1e70e6 (diff)
Merge release-20200422.0-39-g7cd54c1 (automated)
Diffstat (limited to 'pkg/sentry/syscalls/linux/vfs2')
-rwxr-xr-xpkg/sentry/syscalls/linux/vfs2/timerfd.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/pkg/sentry/syscalls/linux/vfs2/timerfd.go b/pkg/sentry/syscalls/linux/vfs2/timerfd.go
index 7938a5249..839a07db1 100755
--- a/pkg/sentry/syscalls/linux/vfs2/timerfd.go
+++ b/pkg/sentry/syscalls/linux/vfs2/timerfd.go
@@ -46,7 +46,10 @@ func TimerfdCreate(t *kernel.Task, args arch.SyscallArguments) (uintptr, *kernel
default:
return 0, nil, syserror.EINVAL
}
- file, err := t.Kernel().VFS().NewTimerFD(clock, fileFlags)
+ // Timerfds aren't writable per se (their implementation of Write just
+ // returns EINVAL), but they are "opened for writing", which is necessary
+ // to actually reach said implementation of Write.
+ file, err := t.Kernel().VFS().NewTimerFD(clock, linux.O_RDWR|fileFlags)
if err != nil {
return 0, nil, err
}