From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38968) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZEYf1-0006V7-1O for qemu-devel@nongnu.org; Mon, 13 Jul 2015 04:00:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZEYex-00046b-Ru for qemu-devel@nongnu.org; Mon, 13 Jul 2015 04:00:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52641) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZEYex-00046R-Mx for qemu-devel@nongnu.org; Mon, 13 Jul 2015 04:00:19 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 37E1BA10BD for ; Mon, 13 Jul 2015 08:00:19 +0000 (UTC) Date: Mon, 13 Jul 2015 11:00:16 +0300 From: "Michael S. Tsirkin" Message-ID: <20150713105804-mutt-send-email-mst@redhat.com> References: <1436766411-29144-1-git-send-email-jasowang@redhat.com> <20150713102533-mutt-send-email-mst@redhat.com> <1436774023.26533.5.camel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1436774023.26533.5.camel@redhat.com> Subject: Re: [Qemu-devel] [PATCH 1/5] virtio-pci: ignore unaligned read/write in virtio_address_space_read()/write() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: Jason Wang , qemu-devel@nongnu.org On Mon, Jul 13, 2015 at 09:53:43AM +0200, Gerd Hoffmann wrote: > On Mo, 2015-07-13 at 10:36 +0300, Michael S. Tsirkin wrote: > > On Mon, Jul 13, 2015 at 01:46:47PM +0800, Jason Wang wrote: > > > We abort on unaligned read/write in > > > virtio_address_space_read()/write() but since len in under control of > > > guest so qemu will simply crash when booting a modern guest (guest is > > > try to read when len is zero). > > > read. > > > > How can len be 0? Isn't this a guest bug? Or is this > > a theoretical issue? > > Something dumping pci config space? > With pci access capability not being used before and therefore zeroed? > Then hitting the "data" field will trigger a zero-length read. I suspect so, yes. All this worries me: what if length was not 0 because the capability was previously used e.g. by bios? > That assert actually triggers when booting a recent linux kernel with > disable-modern=off > > cheers, > Gerd > Which linux version? Doesn't seem to trigger for me ... -- MST