From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60758) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1erZcj-0003QD-Aa for qemu-devel@nongnu.org; Thu, 01 Mar 2018 20:36:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1erZci-0007g7-Fc for qemu-devel@nongnu.org; Thu, 01 Mar 2018 20:36:37 -0500 References: From: Eric Blake Message-ID: <0511b0bf-aab9-42c5-797d-3844f72d044e@redhat.com> Date: Thu, 1 Mar 2018 19:36:14 -0600 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 6/7] qcow2: Check snapshot L1 table in qcow2_snapshot_delete() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alberto Garcia , qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Max Reitz , Kevin Wolf On 03/01/2018 10:27 AM, Alberto Garcia wrote: > This function deletes a snapshot from disk, removing its entry from > the snapshot table, freeing its L1 table and decreasing the refcounts > of all clusters. > > The L1 table offset and size are however not validated. If we use > invalid values in this function we'll probably corrupt the image even > more, so we should return an error instead. > > We now have a function to take care of this, so let's use it. > > Signed-off-by: Alberto Garcia > --- > block/qcow2-snapshot.c | 7 +++++++ > tests/qemu-iotests/080 | 2 ++ > tests/qemu-iotests/080.out | 2 ++ > 3 files changed, 11 insertions(+) > Reviewed-by: Eric Blake -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org