block/cloop: refuse images with bogus offsets (CVE-2014-0144)
authorStefan Hajnoczi <stefanha@redhat.com>
Wed, 26 Mar 2014 12:05:28 +0000 (13:05 +0100)
committerStefan Hajnoczi <stefanha@redhat.com>
Tue, 1 Apr 2014 11:59:47 +0000 (13:59 +0200)
commitf56b9bc3ae20fc93815b34aa022be919941406ce
tree678a4325d4277d2c272f895d01523a863bfb3668
parent7b103b36d6ef3b11827c203d3a793bf7da50ecd6
block/cloop: refuse images with bogus offsets (CVE-2014-0144)

The offsets[] array allows efficient seeking and tells us the maximum
compressed data size.  If the offsets are bogus the maximum compressed
data size will be unrealistic.

This could cause g_malloc() to abort and bogus offsets mean the image is
broken anyway.  Therefore we should refuse such images.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
block/cloop.c
tests/qemu-iotests/075
tests/qemu-iotests/075.out