]> rtime.felk.cvut.cz Git - lisovros/qemu_apohw.git/commit
qcow2: Validate refcount table offset
authorKevin Wolf <kwolf@redhat.com>
Wed, 26 Mar 2014 12:05:44 +0000 (13:05 +0100)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Thu, 3 Jul 2014 21:18:12 +0000 (16:18 -0500)
commit818ce8487eba6b460af5a7e9f3ae38533ff85bf1
tree2800c146ae445b1e29a718e6fba5e4e8ad90474b
parentf6027f805b111deccc0e09eec53d8be9812493fa
qcow2: Validate refcount table offset

The end of the refcount table must not exceed INT64_MAX so that integer
overflows are avoided.

Also check for misaligned refcount table. Such images are invalid and
probably the result of data corruption. Error out to avoid further
corruption.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
(cherry picked from commit 8c7de28305a514d7f879fdfc677ca11fbf60d2e9)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
block/qcow2.c
tests/qemu-iotests/080
tests/qemu-iotests/080.out