[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [Qemu-block] [PATCH 1/2] block: vpc - prevent overflow
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [Qemu-block] [PATCH 1/2] block: vpc - prevent overflow if max_table_entries >= 0x40000000 |
Date: |
Thu, 25 Jun 2015 15:28:35 +0100 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Wed, Jun 24, 2015 at 03:54:27PM -0400, Jeff Cody wrote:
> @@ -269,7 +270,9 @@ static int vpc_open(BlockDriverState *bs, QDict *options,
> int flags,
> goto fail;
> }
>
> - s->pagetable = qemu_try_blockalign(bs->file, s->max_table_entries *
> 4);
> + pagetable_size = (size_t) s->max_table_entries * 4;
> +
> + s->pagetable = qemu_try_blockalign(bs->file, pagetable_size);
On 32-bit hosts size_t is 32-bit so the overflow hasn't been solved.
Does it make sense to impose a limit on pagetable_size?
pgpvt3O3z1jZH.pgp
Description: PGP signature