mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 00:33:55 -06:00
qcow2: Increase maximum cluster size to 2 MB
This patch increases the maximum qcow2 cluster size to 2 MB. Starting with 128k clusters, L2 tables span 2 GB or more of virtual disk space, causing 32 bit truncation and wraparound of signed integers. Therefore some variables need to use a larger data type. While being at reviewing data types, change some integers that are used for array indices to unsigned. In some places they were checked against some upper limit but not for negative values. This could avoid potential segfaults with corrupted qcow2 images. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
85352471ce
commit
80ee15a6b2
4 changed files with 12 additions and 9 deletions
|
@ -530,7 +530,7 @@ static int is_allocated_sectors(const uint8_t *buf, int n, int *pnum)
|
|||
return v;
|
||||
}
|
||||
|
||||
#define IO_BUF_SIZE 65536
|
||||
#define IO_BUF_SIZE (2 * 1024 * 1024)
|
||||
|
||||
static int img_convert(int argc, char **argv)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue