mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
tcpip/link/veth: don't send any packets if another end has been closed
Reported-by: syzbot+077cb394a25e5bfa4ed9@syzkaller.appspotmail.com PiperOrigin-RevId: 650316007
This commit is contained in:
@@ -197,6 +197,13 @@ func (e *Endpoint) SetLinkAddress(addr tcpip.LinkAddress) {
|
||||
// WritePackets stores outbound packets into the channel.
|
||||
// Multiple concurrent calls are permitted.
|
||||
func (e *Endpoint) WritePackets(pkts stack.PacketBufferList) (int, tcpip.Error) {
|
||||
e.veth.mu.RLock()
|
||||
defer e.veth.mu.RUnlock()
|
||||
|
||||
if e.veth.closed {
|
||||
return 0, nil
|
||||
}
|
||||
|
||||
n := 0
|
||||
for _, pkt := range pkts.AsSlice() {
|
||||
// In order to properly loop back to the inbound side we must create a
|
||||
|
||||
Reference in New Issue
Block a user