diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-10-16 06:23:42 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-10-16 06:23:42 +0000 |
commit | 05c588e8167a660524df096ae8cb0661c559c9c4 (patch) | |
tree | 0a08ef76f8f14472903ed2d36a21e71720d40d10 /pkg/sentry/socket/netlink | |
parent | b6f9e0999586d237e3957e129c2105507f818aad (diff) | |
parent | c002fc36f9bbf0fe3ed8b7712c72376f8f8190c1 (diff) |
Merge release-20201005.0-87-gc002fc36f (automated)
Diffstat (limited to 'pkg/sentry/socket/netlink')
-rw-r--r-- | pkg/sentry/socket/netlink/socket.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/pkg/sentry/socket/netlink/socket.go b/pkg/sentry/socket/netlink/socket.go index 5ddcd4be5..3baad098b 100644 --- a/pkg/sentry/socket/netlink/socket.go +++ b/pkg/sentry/socket/netlink/socket.go @@ -16,6 +16,7 @@ package netlink import ( + "io" "math" "gvisor.dev/gvisor/pkg/abi/linux" @@ -748,6 +749,12 @@ func (s *socketOpsCommon) sendMsg(ctx context.Context, src usermem.IOSequence, t buf := make([]byte, src.NumBytes()) n, err := src.CopyIn(ctx, buf) + // io.EOF can be only returned if src is a file, this means that + // sendMsg is called from splice and the error has to be ignored in + // this case. + if err == io.EOF { + err = nil + } if err != nil { // Don't partially consume messages. return 0, syserr.FromError(err) |