Received: from eggs.gnu.org ([2001:4830:134:3::10]:43964) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XTt7N-00067i-5o for qemu-devel@nongnu.org; Tue, 16 Sep 2014 09:48:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XTt7G-0004Nc-DN for qemu-devel@nongnu.org; Tue, 16 Sep 2014 09:48:29 -0400 Received: from mail-wi0-x22a.google.com ([2a00:1450:400c:c05::22a]:60055) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XTt7G-0004MR-2q for qemu-devel@nongnu.org; Tue, 16 Sep 2014 09:48:22 -0400 Received: by mail-wi0-f170.google.com with SMTP id em10so3976913wid.3 for ; Tue, 16 Sep 2014 06:48:15 -0700 (PDT) Date: Tue, 16 Sep 2014 14:48:07 +0100 From: Stefan Hajnoczi Message-ID: <20140916134807.GB10303@stefanha-thinkpad.redhat.com> References: <1409926039-29044-1-git-send-email-mreitz@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="oC1+HKm2/end4ao3" Content-Disposition: inline In-Reply-To: <1409926039-29044-1-git-send-email-mreitz@redhat.com> Subject: Re: [Qemu-devel] [PATCH v2 0/5] qcow2: Check L1/L2/reftable entries for alignment List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz Cc: Kevin Wolf , qemu-devel@nongnu.org, Stefan Hajnoczi --oC1+HKm2/end4ao3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Sep 05, 2014 at 04:07:14PM +0200, Max Reitz wrote: > 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). >=20 > 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. >=20 > v2: > - Added patch 1 which adds a new field to the BLOCK_IMAGE_CORRUPTED. I > know this might be incompatible to existing users of that field, so I > did an investigative search (I googled) but did not find any. So I'm > confident this won't break anything. > - Patch 2: > - Suppress corruption events and messages after the first one; > however, a fatal corruption should still be signaled even after a > non-fatal one has already occured [Kevin] > - Also, use the new "fatal" field > - Patch 3: > - Fix test 060 right in this patch (squashed the old patch 3 into > patch 2, the result is now this patch 3) [Kevin] > - Set the "fatal" field to true > - Patch 4: > - Emit more debugging information (like table indices etc.) [Kevin] > - Generally set the "fatal" field to true > - In case a cluster with an unaligned offset should be freed, call the > corruption signalling function just like everywhere else; but set > "fatal" to false [Kevin+Eric] > - Patch 5: Added [Kevin] >=20 >=20 > git-backport-diff against v1 (although not very useful): >=20 > Key: > [----] : patches are identical > [####] : number of functional differences between upstream/downstream pat= ch > [down] : patch is downstream-only > The flags [FC] indicate (F)unctional and (C)ontextual differences, respec= tively >=20 > 001/5:[down] 'qapi/block: Add "fatal" to BLOCK_IMAGE_CORRUPTED' > 002/5:[0045] [FC] 'qcow2: Add qcow2_signal_corruption()' > 003/5:[0015] [FC] 'qcow2: Use qcow2_signal_corruption() for overlaps' > 004/5:[0068] [FC] 'qcow2: Check L1/L2/reftable entries for alignment' > 005/5:[down] 'iotests: Add more tests for qcow2 corruption' >=20 >=20 > Max Reitz (5): > qapi/block: Add "fatal" to BLOCK_IMAGE_CORRUPTED > qcow2: Add qcow2_signal_corruption() > qcow2: Use qcow2_signal_corruption() for overlaps > qcow2: Check L1/L2/reftable entries for alignment > iotests: Add more tests for qcow2 corruption >=20 > block/qcow2-cluster.c | 43 ++++++++++++++++++++++++++--- > block/qcow2-refcount.c | 67 +++++++++++++++++++++++++++++++---------= ------ > block/qcow2.c | 48 +++++++++++++++++++++++++++++++++ > block/qcow2.h | 5 ++++ > qapi/block-core.json | 9 +++++-- > tests/qemu-iotests/060 | 56 ++++++++++++++++++++++++++++++++++++-- > tests/qemu-iotests/060.out | 61 +++++++++++++++++++++++++++++++++++++---- > 7 files changed, 255 insertions(+), 34 deletions(-) >=20 > --=20 > 2.1.0 >=20 >=20 Thanks, applied to my block tree: https://github.com/stefanha/qemu/commits/block Stefan --oC1+HKm2/end4ao3 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJUGD+XAAoJEJykq7OBq3PIVnkH/AuvxJCxbay/XiuxMXmm5Q3c AcOVouFCTK26IX1iWbKtm7ksl1mix456Fa3bZLkj2ZO3phttT0z2FM16hscelDqC TcgPkllu/YHAs9K3Q04dVDidpJrrzulTixMr6YCN0v3M1CAehuF3/4bN5R6u3GZb yp6Itjyyckw2i8/M99F/k/1z7uvwzTvUu9keO3xwl1stLBt8O6V+jcWr7+4KsaF8 ShNtT4div/iue4ZCwZhmGjPjm0xQUsnRleonRQOxvsOCMA0xNBjrPfF65MCGDhTw +0uYLis4pMXGgljLL0H3Ohq45kI1MyYM3mByeGm8RoEVMG110uU1zrRMbvZnnIQ= =LEzD -----END PGP SIGNATURE----- --oC1+HKm2/end4ao3--