From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47534) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WTgPO-0007O0-NE for qemu-devel@nongnu.org; Fri, 28 Mar 2014 19:42:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WTgPI-0001lW-I2 for qemu-devel@nongnu.org; Fri, 28 Mar 2014 19:41:58 -0400 Message-ID: <533608B7.6050804@redhat.com> Date: Sat, 29 Mar 2014 00:41:43 +0100 From: Max Reitz MIME-Version: 1.0 References: <1395835569-21193-1-git-send-email-stefanha@redhat.com> <1395835569-21193-46-git-send-email-stefanha@redhat.com> In-Reply-To: <1395835569-21193-46-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 45/47] qcow2: Limit snapshot table size 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 > > Even with a limit of 64k snapshots, each snapshot could have a filename > and an ID with up to 64k, which would still lead to pretty large > allocations, which could potentially lead to qemu aborting. Limit the > total size of the snapshot table to an average of 1k per entry when > the limit of 64k snapshots is fully used. This should be plenty for any > reasonable user. > > This also fixes potential integer overflows of s->snapshot_size. > > Suggested-by: Max Reitz > Signed-off-by: Kevin Wolf > --- > block/qcow2-snapshot.c | 15 ++++++++++++++- > block/qcow2.h | 4 ++++ > 2 files changed, 18 insertions(+), 1 deletion(-) Reviewed-by: Max Reitz