mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Don't switch to using the packet mmap endpoint for zero length requests.
This matches linux's behavior. Reported-by: syzbot+31f4b63198c23c53c6e2@syzkaller.appspotmail.com Reported-by: syzbot+e19f276e27cccbbecd0e@syzkaller.appspotmail.com PiperOrigin-RevId: 724032784
This commit is contained in:
committed by
gVisor bot
parent
d8518f2991
commit
213917f3ea
@@ -2745,10 +2745,12 @@ func setSockOptPacket(t *kernel.Task, s socket.Socket, ep commonEndpoint, name i
|
||||
pme = &packetmmap.Endpoint{}
|
||||
}
|
||||
opts := ep.GetPacketMMapOpts(&req, true /* isRx */)
|
||||
if err := pme.Init(t, opts); err != nil {
|
||||
return syserr.FromError(err)
|
||||
if opts.Req.TpFrameNr != 0 || opts.Req.TpBlockNr != 0 {
|
||||
if err := pme.Init(t, opts); err != nil {
|
||||
return syserr.FromError(err)
|
||||
}
|
||||
ep.SetPacketMMapEndpoint(pme)
|
||||
}
|
||||
ep.SetPacketMMapEndpoint(pme)
|
||||
} else {
|
||||
return syserr.ErrNotSupported
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user