yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
9ae3a8
From e6dafe932ca93e980ae277ad34926385dd78b75f Mon Sep 17 00:00:00 2001
9ae3a8
From: Kevin Wolf <kwolf@redhat.com>
9ae3a8
Date: Tue, 25 Mar 2014 14:23:35 +0100
9ae3a8
Subject: [PATCH 28/49] qcow2: Avoid integer overflow in get_refcount (CVE-2014-0143)
9ae3a8
9ae3a8
RH-Author: Kevin Wolf <kwolf@redhat.com>
9ae3a8
Message-id: <1395753835-7591-29-git-send-email-kwolf@redhat.com>
9ae3a8
Patchwork-id: n/a
9ae3a8
O-Subject: [virt-devel] [EMBARGOED RHEL-7.0 qemu-kvm PATCH 28/48] qcow2: Avoid integer overflow in get_refcount (CVE-2014-0143)
9ae3a8
Bugzilla: 1079320
9ae3a8
RH-Acked-by: Jeff Cody <jcody@redhat.com>
9ae3a8
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
9ae3a8
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
9ae3a8
9ae3a8
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1079320
9ae3a8
Upstream status: Embargoed
9ae3a8
9ae3a8
This ensures that the checks catch all invalid cluster indexes
9ae3a8
instead of returning the refcount of a wrong cluster.
9ae3a8
9ae3a8
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
9ae3a8
---
9ae3a8
 block/qcow2-refcount.c |    2 +-
9ae3a8
 1 files changed, 1 insertions(+), 1 deletions(-)
9ae3a8
9ae3a8
diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c
9ae3a8
index 54bcbd1..c08fb08 100644
9ae3a8
--- a/block/qcow2-refcount.c
9ae3a8
+++ b/block/qcow2-refcount.c
9ae3a8
@@ -89,7 +89,7 @@ static int load_refcount_block(BlockDriverState *bs,
9ae3a8
 static int get_refcount(BlockDriverState *bs, int64_t cluster_index)
9ae3a8
 {
9ae3a8
     BDRVQcowState *s = bs->opaque;
9ae3a8
-    int refcount_table_index, block_index;
9ae3a8
+    uint64_t refcount_table_index, block_index;
9ae3a8
     int64_t refcount_block_offset;
9ae3a8
     int ret;
9ae3a8
     uint16_t *refcount_block;
9ae3a8
-- 
9ae3a8
1.7.1
9ae3a8