From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:40324) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TS392-0000VP-5o for qemu-devel@nongnu.org; Sat, 27 Oct 2012 05:57:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TS390-00042U-RA for qemu-devel@nongnu.org; Sat, 27 Oct 2012 05:57:32 -0400 Message-ID: <508BB006.9020900@msgid.tls.msk.ru> Date: Sat, 27 Oct 2012 13:57:26 +0400 From: Michael Tokarev MIME-Version: 1.0 References: <1351280528-21889-1-git-send-email-kwolf@redhat.com> <1351280528-21889-2-git-send-email-kwolf@redhat.com> In-Reply-To: <1351280528-21889-2-git-send-email-kwolf@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/2] qcow2: Fix refcount table size calculation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: qemu-devel@nongnu.org, qemu-stable On 26.10.2012 23:42, Kevin Wolf wrote: > A missing factor for the refcount table entry size in the calculation > could mean that too little memory was allocated for the in-memory > representation of the table, resulting in a buffer overflow. > > Signed-off-by: Kevin Wolf Reviewed-and-tested-by: Michael Tokarev (but the thing is rather trivial and obvious :) (this fixes https://bugs.launchpad.net/qemu/+bug/1071236 fwiw -- maybe we should add some references to bugs when the work/patch is after a bugreport) This fix is applicable to -stable, at least to 1.2 and 1.1 versions. For 0.15, while the patch applies, qcow2 driver has other bug(s) which prevents the testcase (with qemu-img create) from working: $ ./qemu-img-0.15 create -f qcow2 -o cluster_size=512,preallocation=metadata disk.img 4G Formatting 'disk.img', fmt=qcow2 size=4294967296 encryption=off cluster_size=512 preallocation='metadata' qemu-img: disk.img: error while creating qcow2: Unknown error 1652533248 Thanks, /mjt