From: "Daniel P. Berrange" <berrange@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org,
Max Reitz <mreitz@redhat.com>, Kevin Wolf <kwolf@redhat.com>,
Alberto Garcia <berto@igalia.com>
Subject: Re: [Qemu-devel] [PATCH v7 12/20] qcow2: extend specification to cover LUKS encryption
Date: Fri, 26 May 2017 14:57:31 +0100 [thread overview]
Message-ID: <20170526135731.GJ24484@redhat.com> (raw)
In-Reply-To: <bf5923b7-60aa-f2b9-4a22-7d5ff814698a@redhat.com>
On Thu, May 25, 2017 at 02:39:56PM -0500, Eric Blake wrote:
> On 05/25/2017 11:38 AM, Daniel P. Berrange wrote:
> > Update the qcow2 specification to describe how the LUKS header is
> > placed inside a qcow2 file, when using LUKS encryption for the
> > qcow2 payload instead of the legacy AES-CBC encryption
> >
> > Reviewed-by: Alberto Garcia <berto@igalia.com>
> > Reviewed-by: Max Reitz <mreitz@redhat.com>
> > Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
> > ---
> > docs/specs/qcow2.txt | 96 ++++++++++++++++++++++++++++++++++++++++++++++++++++
> > 1 file changed, 96 insertions(+)
> >
>
> > +
> > +The first 592 bytes of the header clusters will contain the LUKS
> > +partition header. This is then followed by the key material data areas.
> > +The size of the key material data areas is determined by the number of
> > +stripes in the key slot and key size. Refer to the LUKS format
> > +specification ('docs/on-disk-format.pdf' in the cryptsetup source
> > +package) for details of the LUKS partition header format.
> > +
> > +In the LUKS partition header, the "payload-offset" field will be
> > +calculated as normal for the LUKS spec. ie the size of the LUKS
> > +header, plus key material regions, plus padding, relative to the
> > +start of the LUKS header. Its value is never used in the context
> > +of qcow2, however, since the qcow2 file format itself defines where
> > +the real payload offset is.
>
> Is it possible/valid for the LUKS payload-offset field to NOT be
> qcow2-cluster-aligned? (I'm guessing yes, for example, if we have 2M
> clusters; and that we don't care, because you documented that we don't
> actually use that offset). Is it worth documenting this?
Yeah, it is not required to be cluster aligned, and that doesn't
matter because we don't use it in context of qcow2.
Essentially the only time it would be used if is we had some
optimized way in future to convert from qcow2 w/ luks over to
file w/ luks, without having to decrypt+reencrypt the payload.
ie we could just copy out the entire luks header as-is, and
then copy out the qcow2 payload after it.
> > +== Data encryption ==
> > +
> > +When an encryption method is requested in the header, the image payload
> > +data must be encrypted/decrypted on every write/read. The image headers
> > +and metadata is never encrypted.
>
> s/is/are/
>
> > +
> > +The algorithms used for encryption vary depending on the method
> > +
> > + - AES:
> > +
> > + The AES cipher, in CBC mode, with 256 bit keys.
> > +
> > + Initialization vectors generated using plain64 method, with
> > + the virtual disk sector as the input tweak.
>
> Worth documenting that implementations should avoid creating new images
> with this encryption (ie. make it officially part of the spec that this
> is not recommended, but merely documented for back-compat data
> liberation purposes)?
I guess I could document that here too - I did add such a note to
the qemu-doc.texi at the end of this series.
>
> Reviewed-by: Eric Blake <eblake@redhat.com>
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
next prev parent reply other threads:[~2017-05-26 13:57 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-25 16:38 [Qemu-devel] [PATCH v7 00/20] Convert QCow[2] to QCryptoBlock & add LUKS support Daniel P. Berrange
2017-05-25 16:38 ` [Qemu-devel] [PATCH v7 01/20] block: expose crypto option names / defs to other drivers Daniel P. Berrange
2017-05-25 16:38 ` [Qemu-devel] [PATCH v7 02/20] block: add ability to set a prefix for opt names Daniel P. Berrange
2017-05-25 19:21 ` Eric Blake
2017-05-25 16:38 ` [Qemu-devel] [PATCH v7 03/20] qcow: document another weakness of qcow AES encryption Daniel P. Berrange
2017-05-25 16:38 ` [Qemu-devel] [PATCH v7 04/20] qcow: require image size to be > 1 for new images Daniel P. Berrange
2017-05-25 16:38 ` [Qemu-devel] [PATCH v7 05/20] iotests: skip 042 with qcow which dosn't support zero sized images Daniel P. Berrange
2017-05-25 16:38 ` [Qemu-devel] [PATCH v7 06/20] iotests: skip 048 with qcow which doesn't support resize Daniel P. Berrange
2017-05-25 16:38 ` [Qemu-devel] [PATCH v7 07/20] block: deprecate "encryption=on" in favor of "encrypt.format=aes" Daniel P. Berrange
2017-05-25 16:38 ` [Qemu-devel] [PATCH v7 08/20] qcow: make encrypt_sectors encrypt in place Daniel P. Berrange
2017-05-25 16:38 ` [Qemu-devel] [PATCH v7 09/20] qcow: convert QCow to use QCryptoBlock for encryption Daniel P. Berrange
2017-05-26 12:03 ` Alberto Garcia
2017-05-26 13:53 ` Daniel P. Berrange
2017-05-25 16:38 ` [Qemu-devel] [PATCH v7 10/20] qcow2: make qcow2_encrypt_sectors encrypt in place Daniel P. Berrange
2017-05-25 16:38 ` [Qemu-devel] [PATCH v7 11/20] qcow2: convert QCow2 to use QCryptoBlock for encryption Daniel P. Berrange
2017-05-26 12:07 ` Alberto Garcia
2017-05-25 16:38 ` [Qemu-devel] [PATCH v7 12/20] qcow2: extend specification to cover LUKS encryption Daniel P. Berrange
2017-05-25 19:39 ` Eric Blake
2017-05-26 13:57 ` Daniel P. Berrange [this message]
2017-05-25 16:38 ` [Qemu-devel] [PATCH v7 13/20] qcow2: add support for LUKS encryption format Daniel P. Berrange
2017-05-25 16:38 ` [Qemu-devel] [PATCH v7 14/20] qcow2: add iotests to cover LUKS encryption support Daniel P. Berrange
2017-05-25 16:38 ` [Qemu-devel] [PATCH v7 15/20] iotests: enable tests 134 and 158 to work with qcow (v1) Daniel P. Berrange
2017-05-25 16:38 ` [Qemu-devel] [PATCH v7 16/20] block: rip out all traces of password prompting Daniel P. Berrange
2017-05-25 16:38 ` [Qemu-devel] [PATCH v7 17/20] block: remove all encryption handling APIs Daniel P. Berrange
2017-05-29 13:47 ` Alberto Garcia
2017-05-25 16:38 ` [Qemu-devel] [PATCH v7 18/20] block: pass option prefix down to crypto layer Daniel P. Berrange
2017-05-25 16:38 ` [Qemu-devel] [PATCH v7 19/20] qcow2: report encryption specific image information Daniel P. Berrange
2017-05-25 19:52 ` Eric Blake
2017-05-26 14:02 ` Daniel P. Berrange
2017-05-29 9:53 ` Markus Armbruster
2017-05-30 9:16 ` Daniel P. Berrange
2017-05-25 16:38 ` [Qemu-devel] [PATCH v7 20/20] docs: document encryption options for qcow, qcow2 and luks Daniel P. Berrange
2017-05-25 19:32 ` Eric Blake
2017-05-29 13:53 ` Alberto Garcia
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=20170526135731.GJ24484@redhat.com \
--to=berrange@redhat.com \
--cc=berto@igalia.com \
--cc=eblake@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--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).