From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41419) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKmEu-0002E4-Bg for qemu-devel@nongnu.org; Wed, 06 Jul 2016 08:47:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bKmEs-0001v2-J9 for qemu-devel@nongnu.org; Wed, 06 Jul 2016 08:47:39 -0400 References: <20160615153630.2116-1-mreitz@redhat.com> <20160615153630.2116-3-mreitz@redhat.com> <20160706084015.GF5233@noname.str.redhat.com> From: Max Reitz Message-ID: <1a0e01ee-fdcd-3428-c2de-7ea8e50dc5a6@redhat.com> Date: Wed, 6 Jul 2016 14:47:29 +0200 MIME-Version: 1.0 In-Reply-To: <20160706084015.GF5233@noname.str.redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="K641SMG3nf2l313SuNHl2EuBlTfSECJFU" 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: Kevin Wolf Cc: qemu-block@nongnu.org, qemu-devel@nongnu.org, qemu-stable@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --K641SMG3nf2l313SuNHl2EuBlTfSECJFU From: Max Reitz To: Kevin Wolf Cc: qemu-block@nongnu.org, qemu-devel@nongnu.org, qemu-stable@nongnu.org Message-ID: <1a0e01ee-fdcd-3428-c2de-7ea8e50dc5a6@redhat.com> Subject: Re: [PATCH 2/2] qcow2: Avoid making the L1 table too big References: <20160615153630.2116-1-mreitz@redhat.com> <20160615153630.2116-3-mreitz@redhat.com> <20160706084015.GF5233@noname.str.redhat.com> In-Reply-To: <20160706084015.GF5233@noname.str.redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 06.07.2016 10:40, Kevin Wolf wrote: > Am 15.06.2016 um 17:36 hat Max Reitz geschrieben: >> We refuse to open images whose L1 table we deem "too big". Consequentl= y, >> 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, >> } >> } >> =20 >> - if (new_l1_size > INT_MAX / sizeof(uint64_t)) { >> + if (new_l1_size > QCOW_MAX_L1_SIZE / sizeof(uint64_t)) { >> return -EFBIG; >> } >=20 > Maybe add a QEMU_BUILD_BUG_ON(QCOW_MAX_L1_SIZE > INT_MAX)? Good idea, did that. I changed it directly in my block branch, or do you think a v2 mail necessary? Max --K641SMG3nf2l313SuNHl2EuBlTfSECJFU Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEvBAEBCAAZBQJXfP3hEhxtcmVpdHpAcmVkaGF0LmNvbQAKCRA7sUIC6DisrfsT B/42k7NV9/2KK75BxJfPudJBGf93CMa3466GT3WcZPIflAYSxYvJEjUY4XFPJkS5 9u4w4teHcd5rForOrCyJ8e+XifXv+Nj9YUpjlKHljtTq9p6X40YuPdyY7sDLPssI X7rzGROsa6ZTw3mux+rM+Gw/6GmD+n0Decbt6HRjJEXv7A1Azzgvp0djH5Wmdkpc GfcKze3GnPnzGQgAW2swWv2Plqi9AmBFNR6nc1o39lft0EFGP+FTjzp/16lVObiT wPvH4bgDtxTCKW8mt8oShCsHY876MDJVBQYC6/JEgjpEtfdRRXybcaTDBnbwm8Rx dgxejGsjww7xdFh3qxjekImM =9hG/ -----END PGP SIGNATURE----- --K641SMG3nf2l313SuNHl2EuBlTfSECJFU--