diff --git a/pkg/sentry/syscalls/linux/vfs2/splice.go b/pkg/sentry/syscalls/linux/vfs2/splice.go index aee74c0e1..658ecd2d3 100644 --- a/pkg/sentry/syscalls/linux/vfs2/splice.go +++ b/pkg/sentry/syscalls/linux/vfs2/splice.go @@ -380,7 +380,11 @@ func Sendfile(t *kernel.Task, args arch.SyscallArguments) (uintptr, *kernel.Sysc } } else { // Read inFile to buffer, then write the contents to outFile. - buf := make([]byte, count) + bufSize := count + if count > pipe.DefaultPipeSize { + bufSize = count + } + buf := make([]byte, bufSize) for { var readN int64 if offset != -1 {