From patchwork Wed Jan 29 16:06:33 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 315102 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 5CCA62C00BF for ; Thu, 30 Jan 2014 03:07:13 +1100 (EST) Received: from localhost ([::1]:43538 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W8XfS-0001Y2-Ge for incoming@patchwork.ozlabs.org; Wed, 29 Jan 2014 11:07:10 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33598) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W8Xf5-000187-VY for qemu-devel@nongnu.org; Wed, 29 Jan 2014 11:06:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W8Xf0-00057m-1H for qemu-devel@nongnu.org; Wed, 29 Jan 2014 11:06:47 -0500 Received: from mx1.redhat.com ([209.132.183.28]:11138) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W8Xez-00053d-Q4 for qemu-devel@nongnu.org; Wed, 29 Jan 2014 11:06:41 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s0TG6eps010161 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 29 Jan 2014 11:06:40 -0500 Received: from nilsson.home.kraxel.org (vpn1-4-39.ams2.redhat.com [10.36.4.39]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id s0TG6dtJ011795; Wed, 29 Jan 2014 11:06:39 -0500 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id DDAF180756; Wed, 29 Jan 2014 17:06:38 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Wed, 29 Jan 2014 17:06:33 +0100 Message-Id: <1391011593-21947-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: armbru@redhat.com, Gerd Hoffmann Subject: [Qemu-devel] [PATCH] xhci: fix overflow in usb_xhci_post_load X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Found by Coverity. Reported-by: Markus Armbruster Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-xhci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c index bafe085..44964f4 100644 --- a/hw/usb/hcd-xhci.c +++ b/hw/usb/hcd-xhci.c @@ -3636,7 +3636,7 @@ static int usb_xhci_post_load(void *opaque, int version_id) slot->uport = xhci_lookup_uport(xhci, slot_ctx); assert(slot->uport && slot->uport->dev); - for (epid = 1; epid <= 32; epid++) { + for (epid = 1; epid <= 31; epid++) { pctx = slot->ctx + 32 * epid; xhci_dma_read_u32s(xhci, pctx, ep_ctx, sizeof(ep_ctx)); state = ep_ctx[0] & EP_STATE_MASK;