]> xenbits.xensource.com Git - qemu-upstream-unstable.git/commit
qcow2: Fix header extension size check
authorKevin Wolf <kwolf@redhat.com>
Tue, 25 Nov 2014 17:12:40 +0000 (18:12 +0100)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Sun, 22 Feb 2015 18:10:11 +0000 (12:10 -0600)
commit63a3acd24af4067c5f8604ddde53c735bf1b95e1
treece9086fa218c604de6ff0cd094875d0c9533111b
parent9fc6075d289702fd6a169dfadc42a52f49f219df
qcow2: Fix header extension size check

After reading the extension header, offset is incremented, but not
checked against end_offset any more. This way an integer overflow could
happen when checking whether the extension end is within the allowed
range, effectively disabling the check.

This patch adds the missing check and a test case for it.

Cc: qemu-stable@nongnu.org
Reported-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-id: 1416935562-7760-2-git-send-email-kwolf@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit 2ebafc854d109ff09b66fb4dd62c2c53fc29754a)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
block/qcow2.c
tests/qemu-iotests/080
tests/qemu-iotests/080.out