Received: from eggs.gnu.org ([2001:4830:134:3::10]:38509) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bVaiN-0002EM-Im for qemu-devel@nongnu.org; Fri, 05 Aug 2016 04:42:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bVaiJ-0006Ts-Sq for qemu-devel@nongnu.org; Fri, 05 Aug 2016 04:42:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60006) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bVaiJ-0006Tm-N2 for qemu-devel@nongnu.org; Fri, 05 Aug 2016 04:42:43 -0400 References: <1470295814-28113-1-git-send-email-ppandit@redhat.com> From: Jason Wang Message-ID: <1456f293-257a-51c8-6708-09c795689d87@redhat.com> Date: Fri, 5 Aug 2016 16:42:36 +0800 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2] net: check fragment length during fragmentation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Dmitry Fleytman , P J P Cc: Qemu developers , Li Qiang , Prasad J Pandit On 2016=E5=B9=B408=E6=9C=8804=E6=97=A5 18:57, Dmitry Fleytman wrote: > Reviewed-by: Dmitry Fleytman > > > On Thu, Aug 4, 2016 at 12:30 AM, P J P > wrote: > > From: Prasad J Pandit > > > Network transport abstraction layer supports packet fragmentation. > While fragmenting a packet, it checks for more fragments from > 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/net_tx_pkt.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > Updated as per > -> > https://lists.gnu.org/archive/html/qemu-devel/2016-08/msg00751.html > > diff --git a/hw/net/net_tx_pkt.c b/hw/net/net_tx_pkt.c > index efd43b4..53dfaa2 100644 > --- a/hw/net/net_tx_pkt.c > +++ b/hw/net/net_tx_pkt.c > @@ -590,7 +590,7 @@ static bool > net_tx_pkt_do_sw_fragmentation(struct NetTxPkt *pkt, > > fragment_offset +=3D fragment_len; > > - } while (more_frags); > + } while (fragment_len && more_frags); > > return true; > } > -- > 2.5.5 > > Applied. Thanks