Do not process ACKs when endpoint is in error state.

PiperOrigin-RevId: 734333026
This commit is contained in:
Nayana Bidari
2025-03-06 16:37:04 -08:00
committed by gVisor bot
parent e699298d58
commit d01514263b
+5 -1
View File
@@ -1317,8 +1317,12 @@ func (e *Endpoint) handleSegmentLocked(s *segment) (cont bool, err tcpip.Error)
// Now check if the received segment has caused us to transition
// to a CLOSED state, if yes then terminate processing and do
// not invoke the sender.
// It is also possible that the sender has sent a RST before
// which got lost and didn't reach the other side. At that time,
// we can still receive ACKs after the sender has purged the
// write list. Do not process such ACKs and return immediately.
state := e.EndpointState()
if state == StateClose {
if state == StateClose || state == StateError {
// When we get into StateClose while processing from the queue,
// return immediately and let the TCP processors handle it.
return false, nil