qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Berger <stefanb@linux.vnet.ibm.com>
To: "Daniel P. Berrange" <berrange@redhat.com>,
	Anthony Liguori <aliguori@us.ibm.com>,
	"Michael S. Tsirkin" <mst@redhat.com>
Cc: Markus Armbruster <armbru@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] blobstore disk format (was Re: Design of the blobstore)
Date: Wed, 28 Sep 2011 15:19:45 -0400	[thread overview]
Message-ID: <4E837351.7060309@linux.vnet.ibm.com> (raw)
In-Reply-To: <20110928155031.GV21102@redhat.com>

On 09/28/2011 11:50 AM, Daniel P. Berrange wrote:
> On Wed, Sep 28, 2011 at 11:48:19AM -0400, Stefan Berger wrote:
>> On 09/22/2011 02:37 AM, Michael S. Tsirkin wrote:
>>>
>>> I'm guessing that if we find a correct ber structure in the file, this
>>> most likely means the key is correct.
>> [I still would add at least a CRC32 (or maybe even a SHA1) for
>> detection of corruption of the ASN.1 encoded blob without having to
>> hunt the data through a ASN.1 decoder.]
>>
>> If we now say that data should be encryptable even if QCoW2 wasn't
>> used, then is a command line option
>>
>> -nvram id=<driveid>,key=<hex key>,...
>>
>> something we should support to make the key applicable to the whole NVRAM?
> Try to avoid requiring secret keys to be set on the command line...
> At least allow setting them via a monitor command
>
Hm, this brings me back to the previous problem of the ordering of 
things that ended up being problematic:

In the case of encrypted QCoW2 the monitor queries for the password when 
the use types 'c' for continue. That happens *after* device's 'init' 
function was called and also *after* their 'reset' handler was invoked, 
so not being able to decrypt encrypted state blobs and not being able to 
feed devices with their persistent state even until the 'reset' handler 
was invoked. The password comes quite late.

The monitor reacts to key typing, which in turn is handled in the 
main_loop() in vl.c.

So, the solution could be that each NVRAM client also registers its 
reset handler (along with the DeviceState pointer). Each NVRAM client 
would have to be written in such a way that it ignores previous failed 
attempts to read its state due to the key coming so late and once the 
NVRAM has the key it invokes the reset handlers again, which now trigger 
the reading of the state in the NVRAM that now can be decrypted.  Does 
this sound 'sane' or more like a 'hack' ?

    Stefan

> Daniel

  reply	other threads:[~2011-09-28 19:19 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-15 12:28 [Qemu-devel] blobstore disk format (was Re: Design of the blobstore) Michael S. Tsirkin
2011-09-15 14:33 ` Stefan Berger
2011-09-16 14:44   ` Michael S. Tsirkin
2011-09-16 16:46     ` Stefan Berger
2011-09-17 19:28       ` Michael S. Tsirkin
2011-09-19 16:22         ` Stefan Berger
2011-09-19 19:04           ` Michael S. Tsirkin
2011-09-22  1:44             ` Stefan Berger
2011-09-22  6:37               ` Michael S. Tsirkin
2011-09-28 15:48                 ` Stefan Berger
2011-09-28 15:50                   ` Daniel P. Berrange
2011-09-28 19:19                     ` Stefan Berger [this message]
2011-10-02  9:18                   ` Michael S. Tsirkin

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=4E837351.7060309@linux.vnet.ibm.com \
    --to=stefanb@linux.vnet.ibm.com \
    --cc=aliguori@us.ibm.com \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=mst@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).