[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL v2 for-2.0 01/24] qcow2-refcount: Sanitize refcount t
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] [PULL v2 for-2.0 01/24] qcow2-refcount: Sanitize refcount table entry |
Date: |
Thu, 13 Mar 2014 15:10:45 +0100 |
From: Max Reitz <address@hidden>
When reading the refcount table entry in get_refcount(), only bits which
are actually significant for the refcount block offset should be taken
into account.
Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Laszlo Ersek <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
---
block/qcow2-refcount.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c
index 8712d8b..6151148 100644
--- a/block/qcow2-refcount.c
+++ b/block/qcow2-refcount.c
@@ -96,7 +96,8 @@ static int get_refcount(BlockDriverState *bs, int64_t
cluster_index)
refcount_table_index = cluster_index >> (s->cluster_bits - REFCOUNT_SHIFT);
if (refcount_table_index >= s->refcount_table_size)
return 0;
- refcount_block_offset = s->refcount_table[refcount_table_index];
+ refcount_block_offset =
+ s->refcount_table[refcount_table_index] & REFT_OFFSET_MASK;
if (!refcount_block_offset)
return 0;
--
1.8.5.3
- [Qemu-devel] [PULL v2 for-2.0 00/24] Block patches, Stefan Hajnoczi, 2014/03/13
- [Qemu-devel] [PULL v2 for-2.0 01/24] qcow2-refcount: Sanitize refcount table entry,
Stefan Hajnoczi <=
- [Qemu-devel] [PULL v2 for-2.0 02/24] block: Update image size in bdrv_invalidate_cache(), Stefan Hajnoczi, 2014/03/13
- [Qemu-devel] [PULL v2 for-2.0 03/24] qcow2: Check bs->drv in copy_sectors(), Stefan Hajnoczi, 2014/03/13
- [Qemu-devel] [PULL v2 for-2.0 05/24] iotests: Test corruption during COW request, Stefan Hajnoczi, 2014/03/13
- [Qemu-devel] [PULL v2 for-2.0 07/24] object: add object_get_canonical_path_component(), Stefan Hajnoczi, 2014/03/13
- [Qemu-devel] [PULL v2 for-2.0 08/24] rfifolock: add recursive FIFO lock, Stefan Hajnoczi, 2014/03/13
- [Qemu-devel] [PULL v2 for-2.0 09/24] aio: add aio_context_acquire() and aio_context_release(), Stefan Hajnoczi, 2014/03/13
- [Qemu-devel] [PULL v2 for-2.0 06/24] block: Rewrite the snapshot authorization mechanism for block filters., Stefan Hajnoczi, 2014/03/13
- [Qemu-devel] [PULL v2 for-2.0 10/24] iothread: add I/O thread object, Stefan Hajnoczi, 2014/03/13
- [Qemu-devel] [PULL v2 for-2.0 11/24] qdev: make get_pointer() handle temporary strings, Stefan Hajnoczi, 2014/03/13
- [Qemu-devel] [PULL v2 for-2.0 12/24] iothread: add "iothread" qdev property type, Stefan Hajnoczi, 2014/03/13