qemu-e2k/block
Chunqiang Tang e0d9c6f937 QCOW2: bug fix - read base image beyond its size
This patch fixes the following bug in QCOW2. For a QCOW2 image that is larger
than its base image, when handling a read request straddling over the end of the
base image, the QCOW2 driver attempts to read beyond the end of the base image
and the request would fail.

This bug was found by Fast Virtual Disk (FVD)'s fully automated testing tool.
The following test triggered the bug.

dd if=/dev/zero of=/var/ramdisk/truth.raw count=0 bs=1 seek=1098561536
dd if=/dev/zero of=/var/ramdisk/zero-500M.raw count=0 bs=1 seek=593099264
./qemu-img create -f qcow2 -ocluster_size=65536,backing_fmt=blksim -b /var/ramdisk/zero-500M.raw /var/ramdisk/test.qcow2 1098561536
./qemu-io --auto --seed=30477694 --truth=/var/ramdisk/truth.raw --format=qcow2 --test=blksim:/var/ramdisk/test.qcow2 --verify_write=true --compare_before=false --compare_after=true --round=100000 --parallel=100 --io_size=10485760 --fail_prob=0 --cancel_prob=0 --instant_qemubh=true

Signed-off-by: Chunqiang Tang <ctang@us.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-02-10 13:23:44 +01:00
..
blkdebug.c block: Allow bdrv_flush to return errors 2010-11-04 12:52:16 +01:00
blkverify.c block: avoid a warning on 64 bit hosts with long as int64_t 2010-11-04 13:54:37 +01:00
bochs.c bochs: use qemu block API 2010-05-17 10:20:05 +02:00
cloop.c cloop: use qemu block API 2010-05-17 10:20:04 +02:00
cow.c block: Allow bdrv_flush to return errors 2010-11-04 12:52:16 +01:00
curl.c Fix %lld or %llx printf format use 2010-05-22 08:02:12 +00:00
dmg.c dmg: use qemu block API 2010-05-17 10:20:05 +02:00
nbd.c nbd: correctly manage default port 2010-09-21 15:39:42 +02:00
parallels.c parallels: use qemu block API 2010-05-17 10:20:05 +02:00
qcow.c block: Remove unused s->hd in various drivers 2010-11-24 17:31:06 +01:00
qcow2-cache.c Reorganize struct Qcow2Cache for better struct packing 2011-01-31 10:03:00 +01:00
qcow2-cluster.c qcow2: Add bdrv_discard support 2011-01-31 10:03:00 +01:00
qcow2-refcount.c qcow2-refcount: remove write-only variables 2011-01-31 10:05:34 +01:00
qcow2-snapshot.c block/qcow2.c: rename qcow_ functions to qcow2_ 2010-12-17 16:15:01 +01:00
qcow2.c QCOW2: bug fix - read base image beyond its size 2011-02-10 13:23:44 +01:00
qcow2.h qcow2: Add bdrv_discard support 2011-01-31 10:03:00 +01:00
qed-check.c qed: Consistency check support 2010-12-17 16:11:04 +01:00
qed-cluster.c qed: Table, L2 cache, and cluster functions 2010-12-17 16:11:04 +01:00
qed-gencb.c qed: Table, L2 cache, and cluster functions 2010-12-17 16:11:04 +01:00
qed-l2-cache.c qed: Table, L2 cache, and cluster functions 2010-12-17 16:11:04 +01:00
qed-table.c qed: Table, L2 cache, and cluster functions 2010-12-17 16:11:04 +01:00
qed.c qed: Images with backing file do not require QED_F_NEED_CHECK 2011-01-31 10:03:00 +01:00
qed.h qed: Consistency check support 2010-12-17 16:11:04 +01:00
raw-posix-aio.h Remove aio_ctx from paio_* interface 2009-10-30 08:39:34 -05:00
raw-posix.c raw-posix: add discard support 2010-12-17 16:11:03 +01:00
raw-win32.c raw-win32: Fix bdrv_flush return value 2011-01-31 10:03:00 +01:00
raw.c block: add discard support 2010-12-17 16:11:03 +01:00
rbd.c ceph/rbd block driver for qemu-kvm 2010-12-14 15:44:21 +01:00
rbd_types.h ceph/rbd block driver for qemu-kvm 2010-12-14 15:44:21 +01:00
sheepdog.c sheepdog: support creating images on remote hosts 2011-01-31 10:03:00 +01:00
vdi.c block/vdi: Fix wrong size in conditionally used memset, memcmp 2011-02-07 10:07:25 +01:00
vmdk.c block: Remove unused s->hd in various drivers 2010-11-24 17:31:06 +01:00
vpc.c vpc: fix a file descriptor leak 2011-01-12 19:49:00 +00:00
vvfat.c vvfat: fix a file descriptor leak 2011-01-12 19:48:58 +00:00