qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Max Reitz <mreitz@redhat.com>
To: Alberto Garcia <berto@igalia.com>, qemu-devel@nongnu.org
Cc: qemu-block@nongnu.org, Kevin Wolf <kwolf@redhat.com>,
	Thomas Huth <thuth@redhat.com>,
	"R . Nageswara Sastry" <nasastry@in.ibm.com>
Subject: Re: [Qemu-devel] [PATCH 3/4] qcow2: Don't open images with header.refcount_table_clusters == 0
Date: Thu, 2 Nov 2017 18:41:44 +0100	[thread overview]
Message-ID: <6e9b5351-b1b4-4df4-c267-a8b4e8061864@redhat.com> (raw)
In-Reply-To: <33492fad2f21dff38a33a96decb38983aee7e405.1509550787.git.berto@igalia.com>

[-- Attachment #1: Type: text/plain, Size: 742 bytes --]

On 2017-11-01 16:42, Alberto Garcia wrote:
> qcow2_do_open() is checking that header.refcount_table_clusters is not
> too large, but it doesn't check that it's greater than zero. Apart
> from the fact that an image like that is obviously corrupted, trying
> to use it crashes QEMU since we end up with a null s->refcount_table
> after qcow2_refcount_init().
> 
> These images can however be repaired, so allow opening them if the
> BDRV_O_CHECK flag is set.
> 
> Signed-off-by: Alberto Garcia <berto@igalia.com>
> ---
>  block/qcow2.c              | 6 ++++++
>  tests/qemu-iotests/060     | 7 +++++++
>  tests/qemu-iotests/060.out | 5 +++++
>  3 files changed, 18 insertions(+)

Reviewed-by: Max Reitz <mreitz@redhat.com>


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 512 bytes --]

  reply	other threads:[~2017-11-02 17:41 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-01 15:42 [Qemu-devel] [PATCH 0/4] Misc qcow2 corruption checks Alberto Garcia
2017-11-01 15:42 ` [Qemu-devel] [PATCH 1/4] qcow2: Prevent allocating refcount blocks at offset 0 Alberto Garcia
2017-11-02 17:28   ` Max Reitz
2017-11-03  9:04     ` Alberto Garcia
2017-11-01 15:42 ` [Qemu-devel] [PATCH 2/4] qcow2: Prevent allocating L2 tables " Alberto Garcia
2017-11-02 17:31   ` Max Reitz
2017-11-03  9:56     ` Alberto Garcia
2017-11-01 15:42 ` [Qemu-devel] [PATCH 3/4] qcow2: Don't open images with header.refcount_table_clusters == 0 Alberto Garcia
2017-11-02 17:41   ` Max Reitz [this message]
2017-11-01 15:42 ` [Qemu-devel] [PATCH 4/4] qcow2: Add iotest for an empty refcount table Alberto Garcia
2017-11-02 17:43   ` Max Reitz
2017-11-02 17:24 ` [Qemu-devel] [PATCH 0/4] Misc qcow2 corruption checks Max Reitz
2017-11-03 12:32   ` Alberto Garcia

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=6e9b5351-b1b4-4df4-c267-a8b4e8061864@redhat.com \
    --to=mreitz@redhat.com \
    --cc=berto@igalia.com \
    --cc=kwolf@redhat.com \
    --cc=nasastry@in.ibm.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@redhat.com \
    /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).