From: Max Reitz <mreitz@redhat.com>
To: "Daniel P. Berrange" <berrange@redhat.com>, qemu-devel@nongnu.org
Cc: qemu-block@nongnu.org, Eric Blake <eblake@redhat.com>,
Kevin Wolf <kwolf@redhat.com>, Alberto Garcia <berto@igalia.com>
Subject: Re: [Qemu-devel] [PATCH v8 00/20] Convert QCow[2] to QCryptoBlock & add LUKS support
Date: Wed, 7 Jun 2017 19:44:24 +0200 [thread overview]
Message-ID: <ded45a2f-c950-c338-373d-63e0c50b16f5@redhat.com> (raw)
In-Reply-To: <20170601172734.9039-1-berrange@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 3889 bytes --]
On 2017-06-01 19:27, Daniel P. Berrange wrote:
> Previously posted:
>
> v1: https://lists.gnu.org/archive/html/qemu-devel/2017-01/msg00201.html
> v2: https://lists.gnu.org/archive/html/qemu-devel/2017-01/msg05147.html
> v3: https://lists.gnu.org/archive/html/qemu-devel/2017-01/msg05671.html
> v4: https://lists.gnu.org/archive/html/qemu-devel/2017-02/msg02293.html
> v5: https://lists.gnu.org/archive/html/qemu-devel/2017-02/msg04653.html
> v6: https://lists.gnu.org/archive/html/qemu-devel/2017-04/msg04561.html
> v7: https://lists.gnu.org/archive/html/qemu-devel/2017-05/msg05818.html
>
> This series is a continuation of previous work to support LUKS in
> QEMU. The existing merged code supports LUKS as a standalone
> driver which can be layered over/under any other QEMU block device
> driver. This works well when using LUKS over protocol drivers (file,
> rbd, iscsi, etc, etc), but has some downsides when combined with
> format drivers like qcow2.
>
> If you layer LUKS under qcow2 (eg qcow2 -> luks -> file) then you
> cannot get any information about the qcow2 file without first
> decrypting it, as both the header and payload are encrypted.
>
> If you layer LUKS over qcow2 (eg luks -> qcow2 -> file) then you
> cannot distinguish between a qcow2 file where the guest has done
> LUKS encryption from a qcow2 file which qemu has done encryption.
> More seriously, when encrypting sectors the guest virtual sector
> is used as the input for deriving the initialization vectors.
> When internal snapshots are used, this means that multiple sectors
> in the qcow2 file may be encrypted with the same initialization
> vector. This is a security weakness when combined with certain
> cryptographic modes.
>
> Integrating LUKS natively into qcow2 allows us to combine the
> best aspects of both layering strategies above. In particular
> the header remains unecrypted, but initialization vectors are
> generated using physical sector numbers preserving security
> when snapshots are used. This is a change from previous postings
> of this work, where the IVs were (incorrectly) generated based
> on the virtual disk sector.
>
> In a previous posting of this work, Fam had suggested that we
> do integration by layering luks over qcow2, but having QEMU
> block layer automatically create the luks driver above qcow2
> based on the qcow2 header crypt_method field. This is not
> possible though, because such a scheme would suffer from the
> problem of IVs being generated from the virtual disk sector
> instead of physical disk sector. So having LUKS specific
> code in the qcow2 block driver is unavoidable. In comparison
> to the previous posting though, the amount of code in qcow2.c
> has been reduced by allowing re-use of code from block/crypto.c
> for handling QemuOpts -> QAPI conversion. So extra lines of
> code in qcow2 to support LUKS is < 200.
>
> I have also split the changes to qcow2 up into 2 patches. The
> first patch simply introduces use of the QCryptoBlock framework
> to qcow2 for the existing (deprecated) AES-CBC encryption method.
> The second patch wires up the LUKS support for qcow2. This makes
> it clearer which parts of the changes are related to plain code
> refactoring, vs enabling the new features. Specifically we can
> now see that the LUKS enablement in qcow2 has this footprint:
I'm trusting Eric and Berto, so I haven't looked at all patches in
depth. But I did have a look at all, and found only some minor stuff to
complain about. I didn't send an R-b for patches I did not find
anything, because (as I said) I didn't look at them sufficiently that
I'd give an R-b (which I didn't because Eric's and Berto's were already
present).
I'm just writing this so you know I'm not planning to write any
complaints for the patches I did not reply to. :-)
Max
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 498 bytes --]
prev parent reply other threads:[~2017-06-07 17:44 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-01 17:27 [Qemu-devel] [PATCH v8 00/20] Convert QCow[2] to QCryptoBlock & add LUKS support Daniel P. Berrange
2017-06-01 17:27 ` [Qemu-devel] [PATCH v8 01/20] block: expose crypto option names / defs to other drivers Daniel P. Berrange
2017-06-01 17:27 ` [Qemu-devel] [PATCH v8 02/20] block: add ability to set a prefix for opt names Daniel P. Berrange
2017-06-01 17:27 ` [Qemu-devel] [PATCH v8 03/20] qcow: document another weakness of qcow AES encryption Daniel P. Berrange
2017-06-01 17:27 ` [Qemu-devel] [PATCH v8 04/20] qcow: require image size to be > 1 for new images Daniel P. Berrange
2017-06-01 17:27 ` [Qemu-devel] [PATCH v8 05/20] iotests: skip 042 with qcow which dosn't support zero sized images Daniel P. Berrange
2017-06-01 17:27 ` [Qemu-devel] [PATCH v8 06/20] iotests: skip 048 with qcow which doesn't support resize Daniel P. Berrange
2017-06-01 17:27 ` [Qemu-devel] [PATCH v8 07/20] block: deprecate "encryption=on" in favor of "encrypt.format=aes" Daniel P. Berrange
2017-06-07 16:40 ` Max Reitz
2017-06-19 13:56 ` Daniel P. Berrange
2017-06-01 17:27 ` [Qemu-devel] [PATCH v8 08/20] qcow: make encrypt_sectors encrypt in place Daniel P. Berrange
2017-06-01 17:27 ` [Qemu-devel] [PATCH v8 09/20] qcow: convert QCow to use QCryptoBlock for encryption Daniel P. Berrange
2017-06-07 16:55 ` Max Reitz
2017-06-19 13:58 ` Daniel P. Berrange
2017-06-01 17:27 ` [Qemu-devel] [PATCH v8 10/20] qcow2: make qcow2_encrypt_sectors encrypt in place Daniel P. Berrange
2017-06-01 17:27 ` [Qemu-devel] [PATCH v8 11/20] qcow2: convert QCow2 to use QCryptoBlock for encryption Daniel P. Berrange
2017-06-01 17:27 ` [Qemu-devel] [PATCH v8 12/20] qcow2: extend specification to cover LUKS encryption Daniel P. Berrange
2017-06-01 18:04 ` Eric Blake
2017-06-01 17:27 ` [Qemu-devel] [PATCH v8 13/20] qcow2: add support for LUKS encryption format Daniel P. Berrange
2017-06-07 17:19 ` Max Reitz
2017-06-19 14:00 ` Daniel P. Berrange
2017-06-01 17:27 ` [Qemu-devel] [PATCH v8 14/20] qcow2: add iotests to cover LUKS encryption support Daniel P. Berrange
2017-06-01 17:27 ` [Qemu-devel] [PATCH v8 15/20] iotests: enable tests 134 and 158 to work with qcow (v1) Daniel P. Berrange
2017-06-01 17:27 ` [Qemu-devel] [PATCH v8 16/20] block: rip out all traces of password prompting Daniel P. Berrange
2017-06-01 17:27 ` [Qemu-devel] [PATCH v8 17/20] block: remove all encryption handling APIs Daniel P. Berrange
2017-06-01 17:27 ` [Qemu-devel] [PATCH v8 18/20] block: pass option prefix down to crypto layer Daniel P. Berrange
2017-06-01 17:27 ` [Qemu-devel] [PATCH v8 19/20] qcow2: report encryption specific image information Daniel P. Berrange
2017-06-01 18:08 ` Eric Blake
2017-06-02 8:32 ` Alberto Garcia
2017-06-07 17:38 ` Max Reitz
2017-06-19 14:08 ` Daniel P. Berrange
2017-06-01 17:27 ` [Qemu-devel] [PATCH v8 20/20] docs: document encryption options for qcow, qcow2 and luks Daniel P. Berrange
2017-06-07 17:44 ` Max Reitz [this message]
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=ded45a2f-c950-c338-373d-63e0c50b16f5@redhat.com \
--to=mreitz@redhat.com \
--cc=berrange@redhat.com \
--cc=berto@igalia.com \
--cc=eblake@redhat.com \
--cc=kwolf@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).