[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-stable] [PATCH 2/2] qcow2: Avoid making the L1 table too big
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-stable] [PATCH 2/2] qcow2: Avoid making the L1 table too big |
Date: |
Wed, 6 Jul 2016 10:40:15 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
Am 15.06.2016 um 17:36 hat Max Reitz geschrieben:
> 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(-)
>
> 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;
> }
Maybe add a QEMU_BUILD_BUG_ON(QCOW_MAX_L1_SIZE > INT_MAX)?
Kevin
- Re: [Qemu-stable] [PATCH 2/2] qcow2: Avoid making the L1 table too big,
Kevin Wolf <=