All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] PATCH: Control over drive open modes for backing file
Date: Fri, 01 Aug 2008 12:09:27 -0500	[thread overview]
Message-ID: <48934347.7040102@codemonkey.ws> (raw)
In-Reply-To: <18579.15930.393041.733173@mariner.uk.xensource.com>

Ian Jackson wrote:
> Anthony Liguori writes ("Re: [Qemu-devel] PATCH: Control over drive open modes for backing file"):
>   
>> Right, but my point is that ,mode=ro does not have to force QEMU to open 
>> the file O_RDONLY.  It simply needs to prevent writes from happening.
>>     
>
> Well, yes, but actually it's probably most reliable to do it that way.
> Given that this is a security feature we want to avoid accidentally
> `missing' a case.  So we should definitely open the underlying file(s)
> O_RDONLY.
>   

That is an implementation detail, and should be dependent on the 
underlying file format.  For instance, I completely agree that this 
should be the behaviour for raw images.  I don't agree that this should 
be the behaviour with qcow2 though.

FWIW, this isn't a major security improvement.  It's pretty darn easy to 
audit the single calling location where a file can be written to :-)

> If we do that then the guest definitely won't be able to write as if
> it manages to persuade qemu to try qemu will just get an error.  This
> is fine I think, if we can expose the read-only status to the guest.
>
>   
>> But it's important to be able to expose this property to the guest, so 
>> ,mode=ro should not be allowed for disks that do not support exposing 
>> their read-only-ness to the guest.
>>     
>
> I agree that it would be an unusual thing to do, to expose a ro disk
> in a way that doesn't support advertising the ro flag.  But I think it
> should still be possible perhaps with some kind of force option.
>   

There's no good reason to do this and it's just going to result in 
confusing users.  You can approximate the same functionality by using 
,snapshot=on while giving the guest predictable behaviour.

Regards,

Anthony Liguori

> Ian.
>
>
>   

  reply	other threads:[~2008-08-01 17:10 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-31 11:31 [Qemu-devel] PATCH: Control over drive open modes for backing file Daniel P. Berrange
2008-07-31 12:15 ` Jamie Lokier
2008-07-31 13:08   ` Daniel P. Berrange
2008-07-31 13:34 ` Daniel P. Berrange
2008-07-31 13:46   ` Paul Brook
2008-07-31 13:55     ` Daniel P. Berrange
2008-07-31 15:05       ` Blue Swirl
2008-07-31 16:01         ` Jamie Lokier
2008-07-31 16:10           ` Daniel P. Berrange
2008-07-31 18:07           ` Blue Swirl
2008-07-31 14:58     ` Chris Wedgwood
2008-07-31 18:26 ` Anthony Liguori
2008-07-31 18:59   ` Jamie Lokier
2008-07-31 19:37     ` Anthony Liguori
2008-08-01  7:46       ` Jamie Lokier
2008-08-01 15:14         ` Anthony Liguori
2008-08-01  9:18   ` Daniel P. Berrange
2008-08-01 14:48     ` Anthony Liguori
2008-08-01 16:47       ` Ian Jackson
2008-08-01 17:09         ` Anthony Liguori [this message]
2008-08-01 17:10         ` Jamie Lokier

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=48934347.7040102@codemonkey.ws \
    --to=anthony@codemonkey.ws \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.