From 51c95c270be3e0c3867c1bc93cc454b32b276721 Mon Sep 17 00:00:00 2001 From: Fabricio Voznika Date: Tue, 22 May 2018 16:35:58 -0700 Subject: Remove offset check to match with Linux implementation. PiperOrigin-RevId: 197644246 Change-Id: I63eb0a58889e69fbc4af2af8232f6fa1c399d43f --- pkg/sentry/syscalls/linux/sys_file.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pkg/sentry/syscalls') 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 } -- cgit v1.2.3