summaryrefslogtreecommitdiffhomepage
path: root/pkg
diff options
context:
space:
mode:
Diffstat (limited to 'pkg')
-rw-r--r--pkg/sentry/syscalls/linux/sys_file.go4
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
}