]> git.proxmox.com Git - mirror_qemu.git/commit - block/qcow.c
qcow1: Check maximum cluster size
authorKevin Wolf <kwolf@redhat.com>
Wed, 7 May 2014 15:30:30 +0000 (17:30 +0200)
committerKevin Wolf <kwolf@redhat.com>
Mon, 19 May 2014 09:36:49 +0000 (11:36 +0200)
commit7159a45b2bf2dcb9f49f1e27d1d3d135a0247a2f
tree9f386b302d585c903fd61522e4e584021eadfcff
parentea54feff58efedc809641474b25a3130309678e7
qcow1: Check maximum cluster size

Huge values for header.cluster_bits cause unbounded allocations (e.g.
for s->cluster_cache) and crash qemu this way. Less huge values may
survive those allocations, but can cause integer overflows later on.

The only cluster sizes that qemu can create are 4k (for standalone
images) and 512 (for images with backing files), so we can limit it
to 64k.

Cc: qemu-stable@nongnu.org
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Benoit Canet <benoit@irqsave.net>
block/qcow.c
tests/qemu-iotests/092 [new file with mode: 0755]
tests/qemu-iotests/092.out [new file with mode: 0644]
tests/qemu-iotests/group