qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Max Reitz <mreitz@redhat.com>
To: qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	Max Reitz <mreitz@redhat.com>
Subject: [Qemu-devel] [PATCH 0/4] qcow2: Check L1/L2/reftable entries for alignment
Date: Sat, 16 Aug 2014 23:16:50 +0200	[thread overview]
Message-ID: <1408223814-23999-1-git-send-email-mreitz@redhat.com> (raw)

The image fuzzer from Maria exposed a lot of assertions which might fail
in qemu when fed with a broken qcow2 image. Some of them are related to
qemu trusting the offsets given in the L1, L2 and refcount tables to
always be properly aligned on cluster boundaries (e.g.
https://bugs.launchpad.net/qemu/+bug/1354529).

This series fixes this by verifying (hopefully) all data read from L1,
L2 and refcount tables accordingly; if the offsets are not aligned on
cluster boundaries, an error message is emitted and the image is marked
corrupt unless it has been opened read-only.


Max Reitz (4):
  qcow2: Add qcow2_signal_corruption()
  qcow2: Use qcow2_signal_corruption() for overlaps
  iotests: Fix output of 060
  qcow2: Check L1/L2/reftable entries for alignment

 block/qcow2-cluster.c      | 27 ++++++++++++++++++++-
 block/qcow2-refcount.c     | 59 +++++++++++++++++++++++++++++-----------------
 block/qcow2.c              | 28 ++++++++++++++++++++++
 block/qcow2.h              |  4 ++++
 tests/qemu-iotests/060.out | 10 ++++----
 5 files changed, 100 insertions(+), 28 deletions(-)

-- 
2.0.4

             reply	other threads:[~2014-08-16 21:17 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-16 21:16 Max Reitz [this message]
2014-08-16 21:16 ` [Qemu-devel] [PATCH 1/4] qcow2: Add qcow2_signal_corruption() Max Reitz
2014-08-20 10:10   ` Kevin Wolf
2014-08-20 19:17     ` Max Reitz
2014-08-16 21:16 ` [Qemu-devel] [PATCH 2/4] qcow2: Use qcow2_signal_corruption() for overlaps Max Reitz
2014-08-16 21:16 ` [Qemu-devel] [PATCH 3/4] iotests: Fix output of 060 Max Reitz
2014-08-20 10:13   ` Kevin Wolf
2014-08-16 21:16 ` [Qemu-devel] [PATCH 4/4] qcow2: Check L1/L2/reftable entries for alignment Max Reitz
2014-08-20 10:51   ` Kevin Wolf
2014-08-20 19:26     ` Max Reitz
2014-08-21  8:14       ` Kevin Wolf
2014-08-21 12:24         ` Eric Blake

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=1408223814-23999-1-git-send-email-mreitz@redhat.com \
    --to=mreitz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@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).