Add ECONNABORTED to the partial result error list.

Allow application to receive partial result due to ECONNABORTED. Similar to
how ECONNRESET and ETIMEDOUT are handled.

Reported-by: syzbot+a0029790ed0bda86356e@syzkaller.appspotmail.com
PiperOrigin-RevId: 430328305
This commit is contained in:
Ayush Ranjan
2022-02-22 17:08:20 -08:00
committed by gVisor bot
parent 6f5e9e7b74
commit 395c38be75
+5 -2
View File
@@ -156,9 +156,12 @@ func handleIOErrorImpl(ctx context.Context, partialResult bool, errOrig, intr er
return true, nil
case linuxerr.Equals(linuxerr.ECONNRESET, translatedErr):
fallthrough
case linuxerr.Equals(linuxerr.ECONNABORTED, translatedErr):
fallthrough
case linuxerr.Equals(linuxerr.ETIMEDOUT, translatedErr):
// For TCP sendfile connections, we may have a reset or timeout. But we
// should just return n as the result.
// For TCP sendfile connections, we may have a reset, abort or timeout. But
// we should just return the partial result. The next call will return the
// error without a partial IO operation.
return true, nil
case linuxerr.Equals(linuxerr.EWOULDBLOCK, translatedErr):
// Syscall would block, but completed a partial read/write.