All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Murphy <lists@colorremedies.com>
To: Milan Broz <gmazyland@gmail.com>
Cc: Chris Murphy <lists@colorremedies.com>, dm-crypt@saout.de
Subject: Re: [dm-crypt] LUKS2 support for null/plaintext target
Date: Fri, 13 Dec 2019 11:54:48 -0700	[thread overview]
Message-ID: <CAJCQCtSxN=uXX=yp3VyJcQMyeWmvLr=yb4kCPUqr1mFpc7=X-Q@mail.gmail.com> (raw)
In-Reply-To: <2b1f731d-0713-fadf-f895-b62b00363a95@gmail.com>

On Fri, Dec 13, 2019 at 7:59 AM Milan Broz <gmazyland@gmail.com> wrote:
>
> Hi,
>
> On 07/12/2019 00:10, Chris Murphy wrote:
> > I'm wondering if it's possible, or LUKS2 could be extended, to support
> > an non-encrypted target. That is, the virtual device and backing
> > device would contain the same information.
>
> (You are not the first one asking for support for this option.)
>
> In fact, the support is already there. But I am reluctant to officially
> support it for a very long time, because it would be super confusing
> for users (We have LUKS, but actually no encryption?!)

I agree there is potential for confusion. And it might be out of scope for LUKS.

When I do:
# blkid

I see a partition is TYPE="crypto_LUKS"  and that's a fairly difficult
statement of fact to overcome with a "yeah but it really isn't crypto,
you should have run this other command that would tell you that".

There is a valid argument that the crypto_LUKS signature should be
trusted to mean the contents are in fact ciphertext,, and not
pseudo-ciphertext trivially unlocked.


> So, the first method:
> you can always use cipher_null (and you must use empty passphrase in this case).
> That variant should work already and it is intended for debugging/measuring dm-crypt
> layer overhead (dm-crypt is used, but with the null cipher).
>
> The second variant is to directly use dm-linear target instead of dm-crypt,
> and it is already used during online (re)encryption in one phase - when adding
> encryption to not yet encrypted device.
> You cannot format such a device initially this way.
>
> It is not so complicated to add support for this to format operation,
> but ... I am still not sure. Any comments?

In some sense the feature request is trying to make LUKS deal with two
difficulties:
1.  producing a standard everyone can agree on, because if LUKS
doesn't do it, would anyone else follow it?
2.  adding the necessary free space in front of the partition to be
encrypted, the area that would be used for the LUKS header and padding

The gotcha with 2. without LUKS taking on this role, is how ugly it
ends up looking depending on what partition scheme is being used:
a. GPT only: create an empty partition ~16MB, immediately before the
intended plaintext partition that will be later converted (encrypted).
Maybe it gets a unique magic, or a new partition type GUID, that
describe it as "empty but intended for future LUKS-based encryption of
the partition that follows"

b. LVM LV? No idea.
c. MBR? Similar to GPT?
d. Files used on loop? Always use GPT, and follow the GPT guideline above.



-- 
Chris Murphy

  reply	other threads:[~2019-12-13 18:55 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-06 23:10 [dm-crypt] LUKS2 support for null/plaintext target Chris Murphy
2019-12-07  9:39 ` Michael Kjörling
2019-12-08 16:59   ` Chris Murphy
2019-12-13 14:59 ` Milan Broz
2019-12-13 18:54   ` Chris Murphy [this message]
2019-12-13 21:41     ` Arno Wagner
2019-12-14  4:28   ` Robert Nichols
2019-12-14 14:42     ` Arno Wagner
2019-12-14 21:18       ` Chris Murphy
2019-12-15 17:51         ` Jordan Glover
2019-12-15 19:12           ` Arno Wagner
2019-12-15 20:49           ` Chris Murphy
2019-12-16 17:08             ` Jordan Glover
2019-12-16 18:24               ` Chris Murphy
2019-12-16 18:49                 ` Arno Wagner
2019-12-16 20:46                   ` Chris Murphy
2019-12-16 22:08                     ` Arno Wagner
2019-12-16 21:33                 ` Michael Kjörling
2019-12-16 22:17                   ` Chris Murphy
2019-12-17 17:07                 ` Jordan Glover
2019-12-18  0:24                   ` Arno Wagner

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='CAJCQCtSxN=uXX=yp3VyJcQMyeWmvLr=yb4kCPUqr1mFpc7=X-Q@mail.gmail.com' \
    --to=lists@colorremedies.com \
    --cc=dm-crypt@saout.de \
    --cc=gmazyland@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.