mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Fix race during fdbased endpoint teardown.
If the fdbased processor is handling packets and the endpoint dispatcher concurrently is set to nil we can crash the sandbox. PiperOrigin-RevId: 634007307
This commit is contained in:
committed by
gVisor bot
parent
e367e0b134
commit
6a7e4c2102
@@ -62,6 +62,12 @@ func (p *processor) deliverPackets() {
|
||||
p.e.mu.RLock()
|
||||
p.gro.Dispatcher = p.e.dispatcher
|
||||
p.e.mu.RUnlock()
|
||||
if p.gro.Dispatcher == nil {
|
||||
p.mu.Lock()
|
||||
p.pkts.Reset()
|
||||
p.mu.Unlock()
|
||||
return
|
||||
}
|
||||
|
||||
p.mu.Lock()
|
||||
for p.pkts.Len() > 0 {
|
||||
|
||||
Reference in New Issue
Block a user