diff options
author | Fabricio Voznika <fvoznika@google.com> | 2018-05-22 16:35:58 -0700 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2018-05-22 16:36:40 -0700 |
commit | 51c95c270be3e0c3867c1bc93cc454b32b276721 (patch) | |
tree | 56e5db5c4546e7fd9db0ba4753d3ba813eadc34e | |
parent | 257ab8de93312295d475638498c57e4de77a4b02 (diff) |
Remove offset check to match with Linux implementation.
PiperOrigin-RevId: 197644246
Change-Id: I63eb0a58889e69fbc4af2af8232f6fa1c399d43f
-rw-r--r-- | pkg/sentry/syscalls/linux/sys_file.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/sentry/syscalls/linux/sys_file.go b/pkg/sentry/syscalls/linux/sys_file.go index 94a876332..a2db9d4c9 100644 --- a/pkg/sentry/syscalls/linux/sys_file.go +++ b/pkg/sentry/syscalls/linux/sys_file.go @@ -870,11 +870,11 @@ const ( // This implementation currently ignores the provided advice. func Fadvise64(t *kernel.Task, args arch.SyscallArguments) (uintptr, *kernel.SyscallControl, error) { fd := kdefs.FD(args[0].Int()) - offset := args[1].Int64() length := args[2].Int64() advice := args[3].Int() - if offset < 0 || length < 0 { + // Note: offset is allowed to be negative. + if length < 0 { return 0, nil, syserror.EINVAL } |