On Tue, Aug 18, 2015 at 12:45:55PM +0300, Shmulik Ladkani wrote: > From: Dana Rubin <dana.ru...@ravellosystems.com> > > Validation of l2 header length assumed minimal packet size as > eth_header + 2 * vlan_header regardless of the actual protocol. > > This caused crash for valid non-IP packets shorter than 22 bytes, as > 'tx_pkt->packet_type' hasn't been assigned for such packets, and > 'vmxnet3_on_tx_done_update_stats()' expects it to be properly set. > > Refine header length validation in 'vmxnet_tx_pkt_parse_headers'. > Check its return value during packet processing flow. > > As a side effect, in case IPv4 and IPv6 header validation failure, > corrupt packets will be dropped. > > Signed-off-by: Dana Rubin <dana.ru...@ravellosystems.com> > Signed-off-by: Shmulik Ladkani <shmulik.ladk...@ravellosystems.com> > --- > hw/net/vmxnet3.c | 4 +--- > hw/net/vmxnet_tx_pkt.c | 19 ++++++++++++++++--- > 2 files changed, 17 insertions(+), 6 deletions(-)
Thanks, applied to my net tree: https://github.com/stefanha/qemu/commits/net Stefan