qemu-e2k/block
Max Reitz d1b9d19f99 qcow2: Limit total allocation range to INT_MAX
When the COW areas are included, the size of an allocation can exceed
INT_MAX.  This is kind of limited by handle_alloc() in that it already
caps avail_bytes at INT_MAX, but the number of clusters still reflects
the original length.

This can have all sorts of effects, ranging from the storage layer write
call failing to image corruption.  (If there were no image corruption,
then I suppose there would be data loss because the .cow_end area is
forced to be empty, even though there might be something we need to
COW.)

Fix all of it by limiting nb_clusters so the equivalent number of bytes
will not exceed INT_MAX.

Cc: qemu-stable@nongnu.org
Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2019-10-14 17:12:48 +02:00
..
accounting.c block: add empty account cookie type 2019-10-10 10:56:18 +02:00
aio_task.c block: introduce aio task pool 2019-10-10 10:56:17 +02:00
backup-top.c block/backup: use backup-top instead of write notifiers 2019-10-10 10:56:18 +02:00
backup-top.h block: introduce backup-top filter driver 2019-10-10 10:56:18 +02:00
backup.c block/backup: use backup-top instead of write notifiers 2019-10-10 10:56:18 +02:00
blkdebug.c
blklogwrites.c
blkreplay.c block: implement bdrv_snapshot_goto for blkreplay 2019-10-14 17:12:48 +02:00
blkverify.c
block-backend.c replay: add BH oneshot event for block layer 2019-10-14 17:12:48 +02:00
block-copy.c block/backup: use backup-top instead of write notifiers 2019-10-10 10:56:18 +02:00
bochs.c
cloop.c
commit.c
copy-on-read.c
create.c
crypto.c
crypto.h
curl.c
dirty-bitmap.c
dmg-bz2.c
dmg-lzfse.c
dmg.c
dmg.h
file-posix.c qapi: query-blockstat: add driver specific file-posix stats 2019-10-10 10:56:18 +02:00
file-win32.c
gluster.c
io.c block: Reject misaligned write requests with BDRV_REQ_NO_FALLBACK 2019-10-14 17:12:48 +02:00
iscsi-opts.c
iscsi.c replay: add BH oneshot event for block layer 2019-10-14 17:12:48 +02:00
linux-aio.c
Makefile.objs block: introduce backup-top filter driver 2019-10-10 10:56:18 +02:00
mirror.c
nbd.c nbd: add empty .bdrv_reopen_prepare 2019-10-10 10:56:18 +02:00
nfs.c replay: add BH oneshot event for block layer 2019-10-14 17:12:48 +02:00
null.c replay: add BH oneshot event for block layer 2019-10-14 17:12:48 +02:00
nvme.c replay: add BH oneshot event for block layer 2019-10-14 17:12:48 +02:00
parallels.c
parallels.h
qapi.c qapi: query-blockstat: add driver specific file-posix stats 2019-10-10 10:56:18 +02:00
qcow2-bitmap.c
qcow2-cache.c
qcow2-cluster.c qcow2: Limit total allocation range to INT_MAX 2019-10-14 17:12:48 +02:00
qcow2-refcount.c
qcow2-snapshot.c
qcow2-threads.c block/qcow2: refactor encryption code 2019-09-16 15:36:22 +02:00
qcow2.c block/qcow2: introduce parallel subrequest handling in read and write 2019-10-10 10:56:17 +02:00
qcow2.h block/qcow2: introduce parallel subrequest handling in read and write 2019-10-10 10:56:17 +02:00
qcow.c
qed-check.c
qed-cluster.c
qed-l2-cache.c
qed-table.c
qed.c
qed.h
quorum.c
raw-format.c
rbd.c replay: add BH oneshot event for block layer 2019-10-14 17:12:48 +02:00
replication.c block/backup: use backup-top instead of write notifiers 2019-10-10 10:56:18 +02:00
sheepdog.c
snapshot.c block/snapshot: Restrict set of snapshot nodes 2019-10-04 11:52:40 +02:00
ssh.c
stream.c
throttle-groups.c
throttle.c
trace-events block: move block_copy from block/backup.c to separate file 2019-10-10 10:56:17 +02:00
vdi.c
vhdx-endian.c
vhdx-log.c
vhdx.c block/vhdx: add check for truncated image files 2019-10-14 17:12:48 +02:00
vhdx.h
vmdk.c
vpc.c
vvfat.c
vxhs.c replay: add BH oneshot event for block layer 2019-10-14 17:12:48 +02:00
win32-aio.c
write-threshold.c