From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55614) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bVBKz-0004dN-RI for qemu-devel@nongnu.org; Thu, 04 Aug 2016 01:36:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bVBKv-0004Cz-KL for qemu-devel@nongnu.org; Thu, 04 Aug 2016 01:36:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49810) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bVBKv-0004Cv-EL for qemu-devel@nongnu.org; Thu, 04 Aug 2016 01:36:53 -0400 References: <1470137878-29405-1-git-send-email-ppandit@redhat.com> From: Jason Wang Message-ID: <21db36ba-725b-db99-2919-16866a53d4d7@redhat.com> Date: Thu, 4 Aug 2016 13:36:44 +0800 MIME-Version: 1.0 In-Reply-To: <1470137878-29405-1-git-send-email-ppandit@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] net: vmxnet: check fragment length during fragmentation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: P J P , Qemu Developers Cc: Li Qiang , Prasad J Pandit On 2016=E5=B9=B408=E6=9C=8802=E6=97=A5 19:37, P J P wrote: > From: Prasad J Pandit > > VMware VMXNET* NIC emulator supports packet fragmentation. > While fragmenting a packet, it checks for more fragments based > on packet length and current fragment length. It is susceptible > to an infinite loop, if the current fragment length is zero. > Add check to avoid it. > > Reported-by: Li Qiang > Signed-off-by: Prasad J Pandit > --- > hw/net/vmxnet_tx_pkt.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/hw/net/vmxnet_tx_pkt.c b/hw/net/vmxnet_tx_pkt.c > index 91e1e08..f4d0f5f 100644 > --- a/hw/net/vmxnet_tx_pkt.c > +++ b/hw/net/vmxnet_tx_pkt.c > @@ -544,7 +544,7 @@ static bool vmxnet_tx_pkt_do_sw_fragmentation(struc= t VmxnetTxPkt *pkt, > =20 > fragment_offset +=3D fragment_len; > =20 > - } while (more_frags); > + } while (fragment_len && more_frags); > =20 > return true; > } The patch doesn't apply cleanly on HEAD, we now move this logic to=20 hw/net/net_tx_pkt.c. Please resend on top of HEAD and cc Dmitry Fleytman=20 . Thanks