mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Fix panic caused by invalid address for Bind in packet sockets.
PiperOrigin-RevId: 298476533
This commit is contained in:
committed by
gVisor bot
parent
d80b6a6e49
commit
43abb24657
@@ -712,6 +712,10 @@ func (s *SocketOperations) Connect(t *kernel.Task, sockaddr []byte, blocking boo
|
||||
// Bind implements the linux syscall bind(2) for sockets backed by
|
||||
// tcpip.Endpoint.
|
||||
func (s *SocketOperations) Bind(t *kernel.Task, sockaddr []byte) *syserr.Error {
|
||||
if len(sockaddr) < 2 {
|
||||
return syserr.ErrInvalidArgument
|
||||
}
|
||||
|
||||
family := usermem.ByteOrder.Uint16(sockaddr)
|
||||
var addr tcpip.FullAddress
|
||||
|
||||
|
||||
Reference in New Issue
Block a user