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
Signed-off-by: Kevin Wolf <firstname.lastname@example.org>
Reviewed-by: Benoit Canet <email@example.com>
4 files changed