Don't hold nic.mu when calling n.linkResQueue.cancel.

Reported-by: syzbot+0a308dd93b1cc6f98dcb@syzkaller.appspotmail.com
PiperOrigin-RevId: 495756802
This commit is contained in:
Nicolas Lacasse
2022-12-15 19:30:00 -08:00
committed by gVisor bot
parent 54dafa76c2
commit bc440b67fc
+4 -2
View File
@@ -299,7 +299,6 @@ func (n *nic) enable() tcpip.Error {
// stack.
func (n *nic) remove() tcpip.Error {
n.mu.Lock()
defer n.mu.Unlock()
n.disableLocked()
@@ -307,10 +306,13 @@ func (n *nic) remove() tcpip.Error {
ep.Close()
}
n.mu.Unlock()
// Shutdown GRO.
n.gro.close()
// drain and drop any packets pending link resolution.
// Drain and drop any packets pending link resolution.
// We must not hold n.mu here.
n.linkResQueue.cancel()
// Prevent packets from going down to the link before shutting the link down.