From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35416) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WSuod-00025E-8W for qemu-devel@nongnu.org; Wed, 26 Mar 2014 16:52:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WSuoV-0008LQ-1n for qemu-devel@nongnu.org; Wed, 26 Mar 2014 16:52:51 -0400 Message-ID: <53333E15.7010506@redhat.com> Date: Wed, 26 Mar 2014 21:52:37 +0100 From: Max Reitz MIME-Version: 1.0 References: <1395835569-21193-1-git-send-email-stefanha@redhat.com> <1395835569-21193-23-git-send-email-stefanha@redhat.com> In-Reply-To: <1395835569-21193-23-git-send-email-stefanha@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH for-2.0 22/47] qcow2: Validate refcount table offset List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Kevin Wolf , pmatouse@redhat.com, qemu-stable@nongnu.org On 26.03.2014 13:05, Stefan Hajnoczi wrote: > From: Kevin Wolf > > The end of the refcount table must not exceed INT64_MAX so that integer > overflows are avoided. > > Also check for misaligned refcount table. Such images are invalid and > probably the result of data corruption. Error out to avoid further > corruption. > > Signed-off-by: Kevin Wolf > --- > block/qcow2.c | 33 +++++++++++++++++++++++++++++++++ > tests/qemu-iotests/080 | 13 +++++++++++++ > tests/qemu-iotests/080.out | 10 ++++++++++ > 3 files changed, 56 insertions(+) Reviewed-by: Max Reitz