diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-08-28 18:31:27 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-08-28 18:31:27 +0000 |
commit | bbc6f1e84bc71072d8a07187cf6422a488c8c534 (patch) | |
tree | dd01dff70b83d1e74d01e3b33acb7d9a0012468a /pkg/sentry | |
parent | 13af2e0237db4e6d1752a6cbfbc0d6fff17cf920 (diff) | |
parent | 8b9cb36d1c74f71da5bc70b73330291f1df298ad (diff) |
Merge release-20200818.0-82-g8b9cb36d1 (automated)
Diffstat (limited to 'pkg/sentry')
-rw-r--r-- | pkg/sentry/platform/ring0/defs_impl_arm64.go | 4 | ||||
-rw-r--r-- | pkg/sentry/syscalls/linux/vfs2/splice.go | 7 |
2 files changed, 8 insertions, 3 deletions
diff --git a/pkg/sentry/platform/ring0/defs_impl_arm64.go b/pkg/sentry/platform/ring0/defs_impl_arm64.go index 424b66f76..eba2eac30 100644 --- a/pkg/sentry/platform/ring0/defs_impl_arm64.go +++ b/pkg/sentry/platform/ring0/defs_impl_arm64.go @@ -3,11 +3,11 @@ package ring0 import ( "gvisor.dev/gvisor/pkg/sentry/arch" "gvisor.dev/gvisor/pkg/sentry/platform/ring0/pagetables" + "io" + "reflect" "fmt" "gvisor.dev/gvisor/pkg/usermem" - "io" - "reflect" ) // Useful bits. diff --git a/pkg/sentry/syscalls/linux/vfs2/splice.go b/pkg/sentry/syscalls/linux/vfs2/splice.go index 192411393..68ce94778 100644 --- a/pkg/sentry/syscalls/linux/vfs2/splice.go +++ b/pkg/sentry/syscalls/linux/vfs2/splice.go @@ -141,9 +141,14 @@ func Splice(t *kernel.Task, args arch.SyscallArguments) (uintptr, *kernel.Syscal inOffset += n } default: - panic("not possible") + panic("at least one end of splice must be a pipe") } + if n == 0 && err == io.EOF { + // We reached the end of the file. Eat the error and exit the loop. + err = nil + break + } if n != 0 || err != syserror.ErrWouldBlock || nonBlock { break } |