mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
netstack: revert SND.NXT when purging the write queue
There are only 3 places we remove from the write queue. The other two are fairly self-contained and don't look suspicious. They are: - tcp.sender.maybeSendSegment - removes iff the segments are merged - tcp.sender.handleRcvdSegment - removes iff the whole segment is covered by an incoming ACK Given that the panic occurs when the write queue is empty and SND.NXT != SND.UNA, the bug likely occurs when either the writeList removes a segment or SND.NXT increments. PiperOrigin-RevId: 699283514
This commit is contained in:
committed by
gVisor bot
parent
9e0e42b665
commit
ca345ca5af
@@ -1013,16 +1013,13 @@ func (e *Endpoint) purgeWriteQueue() {
|
||||
e.sndQueueInfo.sndQueueMu.Lock()
|
||||
defer e.sndQueueInfo.sndQueueMu.Unlock()
|
||||
e.snd.updateWriteNext(nil)
|
||||
for {
|
||||
s := e.snd.writeList.Front()
|
||||
if s == nil {
|
||||
break
|
||||
}
|
||||
for s := e.snd.writeList.Front(); s != nil; s = e.snd.writeList.Front() {
|
||||
e.snd.writeList.Remove(s)
|
||||
s.DecRef()
|
||||
}
|
||||
e.sndQueueInfo.SndBufUsed = 0
|
||||
e.sndQueueInfo.SndClosed = true
|
||||
e.snd.SndNxt = e.snd.SndUna
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user