summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/kernel
diff options
context:
space:
mode:
authorDean Deng <deandeng@google.com>2020-09-22 22:29:28 -0700
committergVisor bot <gvisor-bot@google.com>2020-09-22 22:31:24 -0700
commitb54dbdfdc6b6cbdb6f45cd2abd9efb1f2f821a20 (patch)
tree014229007e0096debc8bf77f9f6632de2f6270d6 /pkg/sentry/kernel
parentc0f21bb19a0ff0fd4bc3bd1f0bed9171e43faf68 (diff)
Handle EOF properly in splice/sendfile.
Use HandleIOErrorVFS2 instead of custom error handling. PiperOrigin-RevId: 333227581
Diffstat (limited to 'pkg/sentry/kernel')
-rw-r--r--pkg/sentry/kernel/pipe/pipe.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/pkg/sentry/kernel/pipe/pipe.go b/pkg/sentry/kernel/pipe/pipe.go
index c410c96aa..67beb0ad6 100644
--- a/pkg/sentry/kernel/pipe/pipe.go
+++ b/pkg/sentry/kernel/pipe/pipe.go
@@ -17,6 +17,7 @@ package pipe
import (
"fmt"
+ "io"
"sync/atomic"
"syscall"
@@ -215,7 +216,7 @@ func (p *Pipe) readLocked(ctx context.Context, ops readOps) (int64, error) {
if p.view.Size() == 0 {
if !p.HasWriters() {
// There are no writers, return EOF.
- return 0, nil
+ return 0, io.EOF
}
return 0, syserror.ErrWouldBlock
}