mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
unix: allow to bind unix sockets only to AF_UNIX addresses
Reported-by: syzbot+2c0bcfd87fb4e8b7b009@syzkaller.appspotmail.com PiperOrigin-RevId: 285228312
This commit is contained in:
@@ -326,7 +326,7 @@ func AddressAndFamily(sfamily int, addr []byte, strict bool) (tcpip.FullAddress,
|
||||
}
|
||||
|
||||
family := usermem.ByteOrder.Uint16(addr)
|
||||
if family != uint16(sfamily) && (!strict && family != linux.AF_UNSPEC) {
|
||||
if family != uint16(sfamily) && (strict || family != linux.AF_UNSPEC) {
|
||||
return tcpip.FullAddress{}, family, syserr.ErrAddressFamilyNotSupported
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user