Vmxnet3 device emulator when parsing packet headers does not check
for IP header length. It could lead to a OOB access when reading
further packet data. Add check to avoid it.
Reported-by: Li Qiang <liqiang6-s@360.cn>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
Reviewed-by: Dmitry Fleytman <dmitry@daynix.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
}
l3_hdr->iov_len = IP_HDR_GET_LEN(l3_hdr->iov_base);
+ if(l3_hdr->iov_len < sizeof(struct ip_header))
+ {
+ l3_hdr->iov_len = 0;
+ return false;
+ }
pkt->l4proto = ((struct ip_header *) l3_hdr->iov_base)->ip_p;
/* copy optional IPv4 header data */