From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: Hyman Huang <yong.huang@smartx.com>,
qemu-devel <qemu-devel@nongnu.org>, Kevin Wolf <kwolf@redhat.com>,
Hanna Reitz <hreitz@redhat.com>, Eric Blake <eblake@redhat.com>
Subject: Re: [PATCH RESEND v3 01/10] crypto: Introduce option and structure for detached LUKS header
Date: Thu, 11 Jan 2024 14:58:41 +0000 [thread overview]
Message-ID: <ZaACIZlPRnJidSE_@redhat.com> (raw)
In-Reply-To: <87h6jkuee9.fsf@pond.sub.org>
On Thu, Jan 11, 2024 at 03:35:10PM +0100, Markus Armbruster wrote:
> Hyman Huang <yong.huang@smartx.com> writes:
>
> > Add the "header" option for the LUKS format. This field would be
> > used to identify the blockdev's position where a detachable LUKS
> > header is stored.
> >
> > In addition, introduce header field in struct BlockCrypto
> >
> > Signed-off-by: Hyman Huang <yong.huang@smartx.com>
> > Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
> > Message-Id: <5b99f60c7317092a563d7ca3fb4b414197015eb2.1701879996.git.yong.huang@smartx.com>
> > ---
> > block/crypto.c | 1 +
> > qapi/block-core.json | 6 +++++-
> > 2 files changed, 6 insertions(+), 1 deletion(-)
> >
> > diff --git a/block/crypto.c b/block/crypto.c
> > index 921933a5e5..f82b13d32b 100644
> > --- a/block/crypto.c
> > +++ b/block/crypto.c
> > @@ -39,6 +39,7 @@ typedef struct BlockCrypto BlockCrypto;
> > struct BlockCrypto {
> > QCryptoBlock *block;
> > bool updating_keys;
> > + BdrvChild *header; /* Reference to the detached LUKS header */
> > };
> >
> >
> > diff --git a/qapi/block-core.json b/qapi/block-core.json
> > index ca390c5700..10be08d08f 100644
> > --- a/qapi/block-core.json
> > +++ b/qapi/block-core.json
> > @@ -3352,11 +3352,15 @@
> > # decryption key (since 2.6). Mandatory except when doing a
> > # metadata-only probe of the image.
> > #
> > +# @header: optional reference to the location of a blockdev
> > +# storing a detached LUKS header. (since 9.0)
>
> This will come out like
>
> "header": "BlockdevRef" (optional)
> optional reference to the location of a blockdev storing a detached
> LUKS header. (since 9.0)
>
> in the manual. Scratch "optional".
>
> Moreover, a BlockdevRef is a "Reference to a block device" (quote from
> its doc comment), not a "reference to the location of a blockdev".
> Better simplify to something like "block device holding a detached LUKS
> header".
>
> But that's just phrasing. The contents could perhaps use improvement,
> too. Let's start with this question: what's a detachable LUKS header,
> and why would anybody want to use it?
Normally a LUKS volume has a layout:
disk: | header | key material | disk payload data |
With a detached LUKS header, you need 2 disks so getting
disk1: | header | key material |
disk2: | disk payload data |
There are a variety of reasons to do this
* Secrecy - the disk2 cannot be identified as containing LUKS volume
since there's no header
* Control - if access to the disk1 is restricted, then even if someone
has access to disk2 they can't unlock it. Might be useful
if you have disks on NFS but want to restrict which host
can launch a VM instance from it, by dynamically providing
access to the header to a designated host
* Flexibility - your application data volume may be a given size and
it is inconvenient to resize it to add encryption.
You can store the LUKS header separately and use
the existing storage volume for payload
* Recovery - corruption of a bit in the header may make the entire
payload inaccessible. It might be convenient to take
backups of the header. If your primary disk header
becomes corrupt, you can unlock the data still by
pointing to the backup detached header.
With 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:[~2024-01-11 14:59 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-25 5:45 [PATCH RESEND v3 00/10] Support generic Luks encryption Hyman Huang
2023-12-25 5:45 ` [PATCH RESEND v3 01/10] crypto: Introduce option and structure for detached LUKS header Hyman Huang
2024-01-11 14:35 ` Markus Armbruster
2024-01-11 14:58 ` Daniel P. Berrangé [this message]
2024-01-11 16:02 ` Yong Huang
2023-12-25 5:45 ` [PATCH RESEND v3 02/10] crypto: Support generic LUKS encryption Hyman Huang
2024-01-04 14:39 ` Daniel P. Berrangé
2024-01-07 11:56 ` Yong Huang
2023-12-25 5:45 ` [PATCH RESEND v3 03/10] qapi: Make parameter 'file' optional for BlockdevCreateOptionsLUKS Hyman Huang
2024-01-04 14:40 ` Daniel P. Berrangé
2023-12-25 5:45 ` [PATCH RESEND v3 04/10] crypto: Introduce creation option and structure for detached LUKS header Hyman Huang
2024-01-04 14:51 ` Daniel P. Berrangé
2024-01-07 11:58 ` Yong Huang
2023-12-25 5:45 ` [PATCH RESEND v3 05/10] crypto: Mark the payload_offset_sector invalid " Hyman Huang
2024-01-04 14:48 ` Daniel P. Berrangé
2023-12-25 5:45 ` [PATCH RESEND v3 06/10] block: Support detached LUKS header creation using blockdev-create Hyman Huang
2024-01-04 14:47 ` Daniel P. Berrangé
2024-01-11 14:05 ` Markus Armbruster
2024-01-11 15:52 ` Yong Huang
2023-12-25 5:45 ` [PATCH RESEND v3 07/10] block: Support detached LUKS header creation using qemu-img Hyman Huang
2023-12-25 5:45 ` [PATCH RESEND v3 08/10] crypto: Introduce 'detached-header' field in QCryptoBlockInfoLUKS Hyman Huang
2024-01-04 14:59 ` Daniel P. Berrangé
2023-12-25 5:45 ` [PATCH RESEND v3 09/10] tests: Add detached LUKS header case Hyman Huang
2023-12-25 5:45 ` [PATCH RESEND v3 10/10] MAINTAINERS: Add section "Detached LUKS header" Hyman Huang
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=ZaACIZlPRnJidSE_@redhat.com \
--to=berrange@redhat.com \
--cc=armbru@redhat.com \
--cc=eblake@redhat.com \
--cc=hreitz@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=yong.huang@smartx.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).