From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60754) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXXdw-0006Qr-9S for qemu-devel@nongnu.org; Thu, 03 Sep 2015 12:45:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZXXdr-0006c5-T3 for qemu-devel@nongnu.org; Thu, 03 Sep 2015 12:45:44 -0400 Received: from mail-wi0-x235.google.com ([2a00:1450:400c:c05::235]:34774) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXXdr-0006bx-LY for qemu-devel@nongnu.org; Thu, 03 Sep 2015 12:45:39 -0400 Received: by wicfx3 with SMTP id fx3so26244541wic.1 for ; Thu, 03 Sep 2015 09:45:39 -0700 (PDT) Date: Thu, 3 Sep 2015 17:45:34 +0100 From: Stefan Hajnoczi Message-ID: <20150903164533.GD18405@stefanha-thinkpad.redhat.com> References: <1439891155-16011-1-git-send-email-shmulik.ladkani@ravellosystems.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1439891155-16011-1-git-send-email-shmulik.ladkani@ravellosystems.com> Subject: Re: [Qemu-devel] [PATCH] net/vmxnet3: Refine l2 header validation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Shmulik Ladkani Cc: Dmitry Fleytman , idan.brown@ravellosystems.com, qemu-devel@nongnu.org, Dana Rubin On Tue, Aug 18, 2015 at 12:45:55PM +0300, Shmulik Ladkani wrote: > From: Dana Rubin > > 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 > Signed-off-by: Shmulik Ladkani > --- > 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