diff options
author | 2019-11-01 07:37:35 +0000 | |
---|---|---|
committer | 2019-11-07 14:37:33 +0100 | |
commit | 570542ecb11e04b61ef4b3f4d0965a6915232a88 (patch) | |
tree | 07b1fc9169e7393641e2048d4cedd4f9c83b1275 /util/qemu-timer.c | |
parent | Merge remote-tracking branch 'remotes/kraxel/tags/audio-20191106-pull-request' into staging (diff) | |
download | qemu-570542ecb11e04b61ef4b3f4d0965a6915232a88.tar.xz qemu-570542ecb11e04b61ef4b3f4d0965a6915232a88.zip |
qcow2-bitmap: Fix uint64_t left-shift overflow
There are two issues in In check_constraints_on_bitmap(),
1) The sanity check on the granularity will cause uint64_t
integer left-shift overflow when cluster_size is 2M and the
granularity is BIGGER than 32K.
2) The way to calculate image size that the maximum bitmap
supported can map to is a bit incorrect.
This patch fix it by add a helper function to calculate the
number of bytes needed by a normal bitmap in image and compare
it to the maximum bitmap bytes supported by qemu.
Fixes: 5f72826e7fc62167cf3a
Signed-off-by: Guoyi Tu <tu.guoyi@h3c.com>
Message-id: 4ba40cd1e7ee4a708b40899952e49f22@h3c.com
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'util/qemu-timer.c')
0 files changed, 0 insertions, 0 deletions