[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 2/2] qcow2: Avoid making the L1 table too big
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH 2/2] qcow2: Avoid making the L1 table too big |
Date: |
Wed, 15 Jun 2016 09:43:04 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 |
On 06/15/2016 09:36 AM, Max Reitz wrote:
> We refuse to open images whose L1 table we deem "too big". Consequently,
> we should not produce such images ourselves.
>
> Cc: address@hidden
> Signed-off-by: Max Reitz <address@hidden>
> ---
> block/qcow2-cluster.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Eric Blake <address@hidden>
>
> diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c
> index 893ddf6..335b9b0 100644
> --- a/block/qcow2-cluster.c
> +++ b/block/qcow2-cluster.c
> @@ -65,7 +65,7 @@ int qcow2_grow_l1_table(BlockDriverState *bs, uint64_t
> min_size,
> }
> }
>
> - if (new_l1_size > INT_MAX / sizeof(uint64_t)) {
> + if (new_l1_size > QCOW_MAX_L1_SIZE / sizeof(uint64_t)) {
> return -EFBIG;
> }
>
>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature