From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50777) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XIlLU-0004a3-Ac for qemu-devel@nongnu.org; Sat, 16 Aug 2014 17:17:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XIlLP-0003u8-B3 for qemu-devel@nongnu.org; Sat, 16 Aug 2014 17:17:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:29699) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XIlLP-0003u3-2a for qemu-devel@nongnu.org; Sat, 16 Aug 2014 17:16:59 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s7GLGvX4007890 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Sat, 16 Aug 2014 17:16:57 -0400 From: Max Reitz Date: Sat, 16 Aug 2014 23:16:50 +0200 Message-Id: <1408223814-23999-1-git-send-email-mreitz@redhat.com> Subject: [Qemu-devel] [PATCH 0/4] qcow2: Check L1/L2/reftable entries for alignment List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Stefan Hajnoczi , Max Reitz 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