From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54993) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZEZHC-0005MX-VP for qemu-devel@nongnu.org; Mon, 13 Jul 2015 04:39:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZEZH9-0002rs-JP for qemu-devel@nongnu.org; Mon, 13 Jul 2015 04:39:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41204) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZEZH9-0002rj-E0 for qemu-devel@nongnu.org; Mon, 13 Jul 2015 04:39:47 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 1765C19F250 for ; Mon, 13 Jul 2015 08:39:47 +0000 (UTC) Message-ID: <1436776784.26533.15.camel@redhat.com> From: Gerd Hoffmann Date: Mon, 13 Jul 2015 10:39:44 +0200 In-Reply-To: <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> <20150713105804-mutt-send-email-mst@redhat.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit 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: "Michael S. Tsirkin" Cc: Jason Wang , qemu-devel@nongnu.org On Mo, 2015-07-13 at 11:00 +0300, Michael S. Tsirkin wrote: > 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 ... Fedora 22 guest with latest distro kernel (4.0.7) cheers, Gerd