qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, mreitz@redhat.com
Subject: Re: [Qemu-devel] [PATCH] qcow2: Fix potential qemu-img check crash on 32 bit hosts
Date: Tue, 1 Dec 2015 16:25:38 +0200	[thread overview]
Message-ID: <20151201162529-mutt-send-email-mst@redhat.com> (raw)
In-Reply-To: <1448979825-24566-1-git-send-email-kwolf@redhat.com>

On Tue, Dec 01, 2015 at 03:23:45PM +0100, Kevin Wolf wrote:
> This crash was caught with qemu-iotests test case 138.
> 
> Commit b6d36de already fixed a few 32 bit truncation bugs that could
> cause qemu-img check to allocate too little memory and consequently
> it would segfault. On 32 bit hosts, there is one more place that needs
> to be fixed because size_t was involved in the calculation and is a
> 32 bit type there.
> 
> Cc: qemu-stable@nongnu.org
> Reported-by: Michael S. Tsirkin <mst@redhat.com>
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Tested-by: Michael S. Tsirkin <mst@redhat.com>
> ---
>  block/qcow2-refcount.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c
> index 6e0e5bd..820f412 100644
> --- a/block/qcow2-refcount.c
> +++ b/block/qcow2-refcount.c
> @@ -1244,7 +1244,7 @@ fail:
>  /* refcount checking functions */
>  
>  
> -static size_t refcount_array_byte_size(BDRVQcow2State *s, uint64_t entries)
> +static uint64_t refcount_array_byte_size(BDRVQcow2State *s, uint64_t entries)
>  {
>      /* This assertion holds because there is no way we can address more than
>       * 2^(64 - 9) clusters at once (with cluster size 512 = 2^9, and because
> -- 
> 1.8.3.1

      reply	other threads:[~2015-12-01 14:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-01 14:23 [Qemu-devel] [PATCH] qcow2: Fix potential qemu-img check crash on 32 bit hosts Kevin Wolf
2015-12-01 14:25 ` Michael S. Tsirkin [this message]

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=20151201162529-mutt-send-email-mst@redhat.com \
    --to=mst@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@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).