]> 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>
Mon, 21 Jul 2014 03:30:36 +0000 (22:30 -0500)
commit5c85998739da2c904194a7fe985a0e7707c7da25
tree8b9ce6859a464a72cdbd4cdeb3d51b8ab54c6f20
parentd234c8f1f6bb52be075581d8237d4683b942bbe3
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:
tests/qemu-iotests/group

*removed context lines for tests not present in v2.0.0

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