mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Acquire rlock when reading link address from the bridge.
It happens along with the other issue when the veth device buffer is full, then the task is stuck and still have the bridge's lock (RLock) via DeliverNetworkPacket. When the second task reads the bridge's MAC address, it waits forever for the first task to release the rlock. Using RLock can allow the concurrent access to the MAC address, it dones't have to be blocked until the messages are sent. Reported-by: syzbot+1d6d1d8f47eae4e308dc@syzkaller.appspotmail.com PiperOrigin-RevId: 704163976
This commit is contained in:
@@ -223,8 +223,8 @@ func (b *BridgeEndpoint) MaxHeaderLength() uint16 {
|
||||
|
||||
// LinkAddress implements stack.LinkEndpoint.LinkAddress.
|
||||
func (b *BridgeEndpoint) LinkAddress() tcpip.LinkAddress {
|
||||
b.mu.Lock()
|
||||
defer b.mu.Unlock()
|
||||
b.mu.RLock()
|
||||
defer b.mu.RUnlock()
|
||||
return b.addr
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user