From: Gerd Hoffmann <kraxel@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
qemu-devel@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] The unholy encrypted image key mess
Date: Wed, 05 Mar 2014 10:29:17 +0100 [thread overview]
Message-ID: <1394011757.17561.25.camel@nilsson.home.kraxel.org> (raw)
In-Reply-To: <871tyh9i43.fsf@blackfin.pond.sub.org>
Hi,
> I can't see why QMP commands would ever want to create in state NEEDKEY.
> We could easily avoid it there: give QMP commands creating
> BlockDriverStates an optional password parameter, fail the command if
> the BDS is encrypted and the password parameter is missing.
Fully agree.
The change command kind-of makes sense for encrypted block devices
specified on the command line. By passing the password via monitor
command it can't be captured easily (unlike for example passwords
specified on the command line which show up in ps listings).
> For HMP, we need to make up our minds how to do passwords.
>
> The current way is to tie NEEDKEY to "guest paused". I hate that.
I'd still tend to simply remove (or disable for 2.0, remove later on)
encryption support from qemu (keep in qemu-img).
Then worry how to do it right once we add a sane encrypted format.
> >> The final funny is device model usb-storage (another one that
> >> desperately needs to be buried deep). Its init() callback
> >> usb_msd_initfn_storage() tries to be cute when it detects state NEEDKEY.
> >>
> >> If it's running in monitor context (say in HMP/QMP command device_add),
> >> it attempts to ask for a key. In HMP context, it unplugs itself when
> >> this fails (I think). In QMP context, it behaves similar to change: it
> >> works, but you get a "DeviceEncrypted" error, and the backend remains in
> >> state NEEDKEY.
> >>
> >> If it's not running in monitor context, it clears autostart. No idea
> >> why it does that, and I'm not sure it has any effect. Opening an
> >> encrypted image clears autostart already, in blockdev_init().
IIRC to allow the user specify the password before starting the guest.
And, yes, if blockdev_init does that anyway it most likely is not
needed.
> Can we get rid of this, and make usb-storage behave like any other
> hot-pluggable block device model?
The dance is needed for the legacy usb_add monitor command, which
creates blockdev + usb-storage in one go.
If we go zap encryption altogether we can obviously simply remove that.
Otherwise it should be possible to move that logic into the legacy usb
init function (usb_msd_init) so it will never ever kick in with -device.
cheers,
Gerd
next prev parent reply other threads:[~2014-03-05 9:29 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-28 21:01 [Qemu-devel] The unholy encrypted image key mess Markus Armbruster
2014-02-28 22:08 ` Eric Blake
2014-03-01 14:44 ` Paolo Bonzini
2014-03-05 8:24 ` Markus Armbruster
2014-03-05 9:01 ` Paolo Bonzini
2014-03-05 9:49 ` Markus Armbruster
2014-03-05 8:15 ` Markus Armbruster
2014-03-05 9:29 ` Gerd Hoffmann [this message]
2014-03-05 10:16 ` Kevin Wolf
2014-03-05 12:45 ` Markus Armbruster
2014-03-03 10:58 ` Kevin Wolf
2014-03-05 8:43 ` Markus Armbruster
2014-03-05 9:17 ` Paolo Bonzini
2014-03-05 9:33 ` Andreas Färber
2014-03-05 10:36 ` Markus Armbruster
2014-03-05 10:40 ` Paolo Bonzini
2014-03-05 12:50 ` Markus Armbruster
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=1394011757.17561.25.camel@nilsson.home.kraxel.org \
--to=kraxel@redhat.com \
--cc=armbru@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/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).