From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=52196 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oxm1L-0000WK-78 for qemu-devel@nongnu.org; Mon, 20 Sep 2010 15:27:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Oxm1J-0007ds-Kc for qemu-devel@nongnu.org; Mon, 20 Sep 2010 15:27:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:7309) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Oxm1J-0007dm-Dp for qemu-devel@nongnu.org; Mon, 20 Sep 2010 15:27:21 -0400 Date: Mon, 20 Sep 2010 21:21:22 +0200 From: "Michael S. Tsirkin" Message-ID: <20100920192122.GI30611@redhat.com> References: <20100920180840.GA31179@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] Re: [PULL] vhost,e1000 fixes List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: qemu-devel@nongnu.org On Mon, Sep 20, 2010 at 06:23:55PM +0000, Blue Swirl wrote: > On Mon, Sep 20, 2010 at 6:08 PM, Michael S. Tsirkin wr= ote: > > This fixes a bug in vhost error handling > > (also triggers build warning with vhost enabled) > > and fixes e1000 handling of short frames. > > > > Discussion on best ways to fix the e1000 issue > > is still ongoing but the =A0bug is severe enough > > for some guests and the fix is safe enough > > that I feel we should have it fixed ASAP > > and look for that perfect approach later. > > > > Both fixes are 0.13 material IMO. > > > > The following changes since commit 952afb719f3c965bae12b5bd5f0f0f7ed0= 251cb8: > > > > =A0mingw: use ASLR, no-SEH and DEP if available (2010-09-19 08:36:34 = +0000) > > > > are available in the git repository at: > > =A0git://git.kernel.org/pub/scm/linux/kernel/git/mst/qemu.git for_ant= hony > > > > Michael S. Tsirkin (1): > > =A0 =A0 =A0vhost: fix infinite loop on error path >=20 > I don't think your fix is correct either, it will call the ioctl() > with file.index =3D=3D -1. This is my patch: - while (--file.index >=3D 0) { + while (file.index-- > 0) { int r =3D ioctl(net->dev.control, VHOST_NET_SET_BACKEND, &file); assert(r >=3D 0); } For ioctl to get called with -1, index needs to be 0 before the decrement, and while won't be entered ... what am I missing? > How about int i; for (i =3D file.index; i >=3D 0; > i--) { file.index =3D i;... ?