]> git.ipfire.org Git - thirdparty/qemu.git/commit
qcow1: Check maximum cluster size
authorKevin Wolf <kwolf@redhat.com>
Wed, 7 May 2014 15:30:30 +0000 (17:30 +0200)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Thu, 3 Jul 2014 21:31:28 +0000 (16:31 -0500)
commite6c55cf7c25ceb0c14a292520a61786374f69bcf
tree9468f2462ce7a2e3068dbbf7c480dbce9f07e5f5
parent41819e90af4228c40a92da828a82446073412a5a
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>
(cherry picked from commit 7159a45b2bf2dcb9f49f1e27d1d3d135a0247a2f)

Conflicts:
block/qcow.c
tests/qemu-iotests/group

*removed mismatch due to error msgs from upstream's b6d5066d
*removed context from upstream block tests

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
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