Received: from eggs.gnu.org ([140.186.70.92]:48421) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R6eKS-0004vN-SU for qemu-devel@nongnu.org; Thu, 22 Sep 2011 04:08:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R6eKR-0007oH-NY for qemu-devel@nongnu.org; Thu, 22 Sep 2011 04:08:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54022) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R6eKR-0007o4-G0 for qemu-devel@nongnu.org; Thu, 22 Sep 2011 04:08:19 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p8M88Ihl006815 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 22 Sep 2011 04:08:18 -0400 From: Markus Armbruster References: <1316633111-32404-1-git-send-email-ddutile@redhat.com> Date: Thu, 22 Sep 2011 10:08:16 +0200 In-Reply-To: <1316633111-32404-1-git-send-email-ddutile@redhat.com> (Donald Dutile's message of "Wed, 21 Sep 2011 15:25:11 -0400") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [Qemu-devel] [PATCH] pci-devfn: check that device/slot number is within range List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Donald Dutile Cc: qemu-devel@nongnu.org Donald Dutile writes: > Need to check that guest slot/device number is not > 31 or walk off > the devfn table when checking if a devfn is available or not in a guest. Here in do_pci_register_device(): } else if (bus->devices[devfn]) { error_report("PCI: devfn %d not available for %s, in use by %s", devfn, name, bus->devices[devfn]->name); return NULL; } > before this fix, passing in an addr=abc or addr=34, > can crash qemu, sometimes fail gracefully if data past end > of devfn table fails the availability test. > > with this fix, get clean error: > Property 'pci-assign.addr' doesn't take value '34' > > also tested when no addr= param passed for guest (pcicfg) address, > and that worked as well. > > Signed-off-by: Don Dutile Reviewed-by: Markus Armbruster