From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:39018) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TMgAI-0006lA-Vi for qemu-devel@nongnu.org; Fri, 12 Oct 2012 10:24:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TMgAD-00014M-OU for qemu-devel@nongnu.org; Fri, 12 Oct 2012 10:24:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44869) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TMgAD-00013P-Ed for qemu-devel@nongnu.org; Fri, 12 Oct 2012 10:24:33 -0400 Message-ID: <5078281B.3090702@redhat.com> Date: Fri, 12 Oct 2012 08:24:27 -0600 From: Eric Blake MIME-Version: 1.0 References: <1350050969-14034-1-git-send-email-stefanha@redhat.com> In-Reply-To: <1350050969-14034-1-git-send-email-stefanha@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enigFE37A2222E118EC2794E0316" Subject: Re: [Qemu-devel] [PATCH] qemu-img: Add --backing-chain option to info command List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Kevin Wolf , Kashyap Chamarthy , qemu-devel@nongnu.org, =?UTF-8?B?QmVub8OudCBDYW5ldA==?= This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigFE37A2222E118EC2794E0316 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 10/12/2012 08:09 AM, Stefan Hajnoczi wrote: > The qemu-img info --backing-chain option enumerates the backing file > chain. For example, for base.qcow2 <- snap1.qcow2 <- snap2.qcow2 the > output becomes: >=20 > + do { > + bs =3D bdrv_new_open(filename, fmt, BDRV_O_FLAGS | BDRV_O_NO_B= ACKING, > + false); > + if (!bs) { > + goto err; > + } > + } while (filename); Eww - infinite loop if presented with malicious data where someone has used 'qemu-img rebase -u' to create a cycle. I think you need a followup patch that hashes which files have been opened to date, and abort the loop once a cycle is detected. --=20 Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enigFE37A2222E118EC2794E0316 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://www.enigmail.net/ iQEcBAEBCAAGBQJQeCgbAAoJEKeha0olJ0NqzZwH/jio1nOPbSv+HQZhDjM6fRed GfO6JDlgNSKuyueF/W0r+X3uKJMfu3oc/UcCqjG8RHz80UP3XyFj4aWKQ2s8I5lQ U/aPt2HCi6+uJ7awVNgotkkiCnfiayHcqc8dj4v8MxN8WAEtp61eqfig9OvlJ/U1 w82xGGnKOUGurBAVZKMEvNxSE2TMbkVPujQBz2vylVksYyCwu9xIrQbQE7fniyGP g9deFwTnYlzGWYL44urqe6PTupuUPlKPTAEkjT63mqA+lGH149cb3yybmUcnVZNq C5bsCIiQb0k5HqQ5C1w520F6kiTM3yqXaCHl5PfTGWzkWgcbA6tVM7tatcD+Oic= =qj9i -----END PGP SIGNATURE----- --------------enigFE37A2222E118EC2794E0316--