qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: kashyap.cv@gmail.com, qemu-devel@nongnu.org,
	"Benoît Canet" <benoit@irqsave.net>
Subject: Re: [Qemu-devel] [PATCH v2 2/3] qemu-img: Detect backing file chain infinite loops
Date: Tue, 16 Oct 2012 16:42:12 +0200	[thread overview]
Message-ID: <20121016144212.GA19559@stefanha-thinkpad> (raw)
In-Reply-To: <507D32E0.7020006@redhat.com>

On Tue, Oct 16, 2012 at 12:11:44PM +0200, Kevin Wolf wrote:
> Am 15.10.2012 14:44, schrieb Stefan Hajnoczi:
> > A malicious or corruption image can contain an infinite loop of backing
> > files.  The qemu-img info --backing-chain command must not hang when
> > such files are encountered.
> > 
> > Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> 
> This seems to do what is intended, but I think rather than fixing the
> 'qemu-img info' special case I'd have fixed bdrv_open() to detect the
> situation.

When bdrv_open() on the chain fails we'll still need to iterate each
image (with infinite loop detection) in qemu-img info.  This allows
qemu-img info to print out details of the chain and where the chain goes
wrong.

> Do we need to properly communicate what the broken image is with JSON
> output? This patch will only produce broken JSON in the failure case.

Ah, you're right.  We must close the JSON array and add a test case for
this :(.

Will send v3.

Stefan

  reply	other threads:[~2012-10-16 14:45 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-15 12:44 [Qemu-devel] [PATCH v2 0/3] qemu-img: Add --backing-chain option to info command Stefan Hajnoczi
2012-10-15 12:44 ` [Qemu-devel] [PATCH v2 1/3] " Stefan Hajnoczi
2012-10-16 10:04   ` Kevin Wolf
2012-10-16 14:51     ` Stefan Hajnoczi
2012-10-15 12:44 ` [Qemu-devel] [PATCH v2 2/3] qemu-img: Detect backing file chain infinite loops Stefan Hajnoczi
2012-10-16 10:11   ` Kevin Wolf
2012-10-16 14:42     ` Stefan Hajnoczi [this message]
2012-10-16 14:58       ` Kevin Wolf
2012-10-15 12:44 ` [Qemu-devel] [PATCH v2 3/3] qemu-iotests: Add 041 backing file chain infinite loop test Stefan Hajnoczi
2012-10-15 17:47   ` Eric Blake
2012-10-16  8:21     ` Stefan Hajnoczi
2012-10-16 10:22   ` Kevin Wolf
2012-10-16 14:53     ` Stefan Hajnoczi
2012-10-15 17:49 ` [Qemu-devel] [PATCH v2 0/3] qemu-img: Add --backing-chain option to info command Eric Blake

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121016144212.GA19559@stefanha-thinkpad \
    --to=stefanha@redhat.com \
    --cc=benoit@irqsave.net \
    --cc=kashyap.cv@gmail.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).