From: Stefan Hajnoczi <stefanha@gmail.com>
To: Jeff Cody <jcody@redhat.com>
Cc: kwolf@redhat.com, qemu-devel@nongnu.org, qemu-block@nongnu.org
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 [thread overview]
Message-ID: <20150625142835.GP4419@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <4273ff9b577ffc2b2b3ff7137beabfb831a38d65.1435175476.git.jcody@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 556 bytes --]
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?
[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]
next prev parent reply other threads:[~2015-06-25 14:28 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-24 19:54 [Qemu-devel] [PATCH 0/2] block: vpc - prevent overflow Jeff Cody
2015-06-24 19:54 ` [Qemu-devel] [PATCH 1/2] block: vpc - prevent overflow if max_table_entries >= 0x40000000 Jeff Cody
2015-06-25 14:28 ` Stefan Hajnoczi [this message]
2015-06-25 15:05 ` [Qemu-devel] [Qemu-block] " Jeff Cody
2015-06-26 9:57 ` Stefan Hajnoczi
2015-07-08 11:55 ` Kevin Wolf
2015-07-09 10:12 ` Stefan Hajnoczi
2015-06-24 19:54 ` [Qemu-devel] [PATCH 2/2] block: qemu-iotests - add check for multiplication overflow in vpc Jeff Cody
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150625142835.GP4419@stefanha-thinkpad.redhat.com \
--to=stefanha@gmail.com \
--cc=jcody@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).