From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41387) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKiNd-0002xO-FG for qemu-devel@nongnu.org; Wed, 06 Jul 2016 04:40:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bKiNc-0000cB-JX for qemu-devel@nongnu.org; Wed, 06 Jul 2016 04:40:25 -0400 Date: Wed, 6 Jul 2016 10:40:15 +0200 From: Kevin Wolf Message-ID: <20160706084015.GF5233@noname.str.redhat.com> References: <20160615153630.2116-1-mreitz@redhat.com> <20160615153630.2116-3-mreitz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160615153630.2116-3-mreitz@redhat.com> Subject: Re: [Qemu-devel] [PATCH 2/2] qcow2: Avoid making the L1 table too big List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz Cc: qemu-block@nongnu.org, qemu-devel@nongnu.org, qemu-stable@nongnu.org Am 15.06.2016 um 17:36 hat Max Reitz geschrieben: > We refuse to open images whose L1 table we deem "too big". Consequently, > we should not produce such images ourselves. > > Cc: qemu-stable@nongnu.org > Signed-off-by: Max Reitz > --- > block/qcow2-cluster.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c > index 893ddf6..335b9b0 100644 > --- a/block/qcow2-cluster.c > +++ b/block/qcow2-cluster.c > @@ -65,7 +65,7 @@ int qcow2_grow_l1_table(BlockDriverState *bs, uint64_t min_size, > } > } > > - if (new_l1_size > INT_MAX / sizeof(uint64_t)) { > + if (new_l1_size > QCOW_MAX_L1_SIZE / sizeof(uint64_t)) { > return -EFBIG; > } Maybe add a QEMU_BUILD_BUG_ON(QCOW_MAX_L1_SIZE > INT_MAX)? Kevin