diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-10-19 18:56:09 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-10-19 18:56:09 +0000 |
commit | fb9c0839c7d767db61a58065f2251d742814e523 (patch) | |
tree | 911c6a9df3f4f3db923558a51d82618d1a010581 /pkg/sentry | |
parent | c3091371abf1cfb379a4033113f4a11b288029e1 (diff) | |
parent | cd108432a50ec777ce92f9d207154173e3f0b665 (diff) |
Merge release-20201005.0-99-gcd108432a (automated)
Diffstat (limited to 'pkg/sentry')
-rw-r--r-- | pkg/sentry/syscalls/linux/vfs2/splice.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/pkg/sentry/syscalls/linux/vfs2/splice.go b/pkg/sentry/syscalls/linux/vfs2/splice.go index bf5c1171f..035e2a6b0 100644 --- a/pkg/sentry/syscalls/linux/vfs2/splice.go +++ b/pkg/sentry/syscalls/linux/vfs2/splice.go @@ -45,6 +45,9 @@ func Splice(t *kernel.Task, args arch.SyscallArguments) (uintptr, *kernel.Syscal if count > int64(kernel.MAX_RW_COUNT) { count = int64(kernel.MAX_RW_COUNT) } + if count < 0 { + return 0, nil, syserror.EINVAL + } // Check for invalid flags. if flags&^(linux.SPLICE_F_MOVE|linux.SPLICE_F_NONBLOCK|linux.SPLICE_F_MORE|linux.SPLICE_F_GIFT) != 0 { @@ -192,6 +195,9 @@ func Tee(t *kernel.Task, args arch.SyscallArguments) (uintptr, *kernel.SyscallCo if count > int64(kernel.MAX_RW_COUNT) { count = int64(kernel.MAX_RW_COUNT) } + if count < 0 { + return 0, nil, syserror.EINVAL + } // Check for invalid flags. if flags&^(linux.SPLICE_F_MOVE|linux.SPLICE_F_NONBLOCK|linux.SPLICE_F_MORE|linux.SPLICE_F_GIFT) != 0 { |