From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46618) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WTgIq-0002CF-79 for qemu-devel@nongnu.org; Fri, 28 Mar 2014 19:35:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WTgIk-0008Jh-2L for qemu-devel@nongnu.org; Fri, 28 Mar 2014 19:35:12 -0400 Message-ID: <53360725.4000102@redhat.com> Date: Sat, 29 Mar 2014 00:35:01 +0100 From: Max Reitz MIME-Version: 1.0 References: <1395835569-21193-1-git-send-email-stefanha@redhat.com> <1395835569-21193-43-git-send-email-stefanha@redhat.com> In-Reply-To: <1395835569-21193-43-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 42/47] qcow2: Fix NULL dereference in qcow2_open() error path (CVE-2014-0146) 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:06, Stefan Hajnoczi wrote: > From: Kevin Wolf > > The qcow2 code assumes that s->snapshots is non-NULL if s->nb_snapshots > != 0. By having the initialisation of both fields separated in > qcow2_open(), any error occuring in between would cause the error path > to dereference NULL in qcow2_free_snapshots() if the image had any > snapshots. > > Signed-off-by: Kevin Wolf > --- > block/qcow2.c | 7 ++++--- > tests/qemu-iotests/080 | 7 +++++++ > tests/qemu-iotests/080.out | 4 ++++ > 3 files changed, 15 insertions(+), 3 deletions(-) Reviewed-by: Max Reitz