sockets: ignore io.EOF from view.ReadAt

Reported-by: syzbot+5466463b7604c2902875@syzkaller.appspotmail.com
PiperOrigin-RevId: 337451896
This commit is contained in:
Andrei Vagin
2020-10-15 23:15:48 -07:00
committed by gVisor bot
parent fc40ead685
commit c002fc36f9
6 changed files with 126 additions and 0 deletions
+5
View File
@@ -587,6 +587,11 @@ func (i *ioSequencePayload) Payload(size int) ([]byte, *tcpip.Error) {
}
v := buffer.NewView(size)
if _, err := i.src.CopyIn(i.ctx, v); err != nil {
// EOF can be returned only if src is a file and this means it
// is in a splice syscall and the error has to be ignored.
if err == io.EOF {
return v, nil
}
return nil, tcpip.ErrBadAddress
}
return v, nil