diff options
author | Jamie Liu <jamieliu@google.com> | 2020-05-06 16:06:49 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-05-06 16:08:12 -0700 |
commit | 7cd54c1f1437dccdf1840e8f893de06f9d1e70e6 (patch) | |
tree | 98b85b2842dd2f8c0b03117a8699a1c6bb1cf6eb /pkg/sentry/syscalls/linux/vfs2 | |
parent | 485ca36adf18fbb587df9f34a2deea730882fb36 (diff) |
Remove vfs.FileDescriptionOptions.InvalidWrite.
Compare:
https://elixir.bootlin.com/linux/v5.6/source/fs/timerfd.c#L431
PiperOrigin-RevId: 310246908
Diffstat (limited to 'pkg/sentry/syscalls/linux/vfs2')
-rw-r--r-- | pkg/sentry/syscalls/linux/vfs2/timerfd.go | 5 |
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 100644 --- 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 } |