From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50270) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYXR3-00041X-1R for qemu-devel@nongnu.org; Thu, 19 Mar 2015 06:12:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YYXQy-0003Ls-To for qemu-devel@nongnu.org; Thu, 19 Mar 2015 06:12:16 -0400 Date: Thu, 19 Mar 2015 11:12:09 +0100 From: "Michael S. Tsirkin" Message-ID: <20150319111013-mutt-send-email-mst@redhat.com> References: <1426748752-13385-1-git-send-email-jasowang@redhat.com> <1426748752-13385-2-git-send-email-jasowang@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1426748752-13385-2-git-send-email-jasowang@redhat.com> Subject: Re: [Qemu-devel] [PATCH for 2.3 2/2] virtio-net: fix the upper bound when trying to delete queues List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jason Wang Cc: qemu-devel@nongnu.org, qemu-stable On Thu, Mar 19, 2015 at 03:05:52PM +0800, Jason Wang wrote: > Virtqueue were indexed from zero, so don't delete virtqueue whose > index is n->max_queues * 2 + 1. But what's the current behaviour? Can it lead to aborts? virtio_del_queue does: if (n < 0 || n >= VIRTIO_PCI_QUEUE_MAX) { abort(); } > Cc: Michael S. Tsirkin > Cc: qemu-stable > Signed-off-by: Jason Wang > --- > hw/net/virtio-net.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c > index 59f76bc..b6fac9c 100644 > --- a/hw/net/virtio-net.c > +++ b/hw/net/virtio-net.c > @@ -1309,7 +1309,7 @@ static void virtio_net_set_multiqueue(VirtIONet *n, int multiqueue) > > n->multiqueue = multiqueue; > > - for (i = 2; i <= n->max_queues * 2 + 1; i++) { > + for (i = 2; i < n->max_queues * 2 + 1; i++) { > virtio_del_queue(vdev, i); > } > > -- > 2.1.0