From: Milan Broz <gmazyland@gmail.com>
To: Guilhem Moulin <guilhem@fripost.org>
Cc: dm-crypt@saout.de
Subject: Re: [dm-crypt] Debian installer formatting LUKS2 devices by default?
Date: Mon, 30 Jul 2018 12:51:11 +0200 [thread overview]
Message-ID: <d349eeb9-4509-e188-4bb2-90854bcc9a69@gmail.com> (raw)
In-Reply-To: <20180727081626.GA29834@localhost.localdomain>
On 27/07/18 10:16, Guilhem Moulin wrote:
> Debian Buster will freeze at the beginning of next year and we have
> people asking for the installer to format devices with `--type luks2`.
>
> (FWIW, I think these requests to default to `--type luks2` are mostly
> motivated by a better PBKDF, so nothing impossible to obtain by
> conversion from an existing LUKS1 device.)
Hi,
(btw another important LUKS2 option is the sector size - 4k sectors are
much faster if used over 4k sector devices)
We already added configure switch for default format, so now it is up to
the distro maintainer.
I would like to change upstream default in some next version (see below),
but we still have some issues to solve.
One important issue is with Argon2 (or with memory-hard functions in general):
If the Argon2 required amount of memory is too high (existing device from different
systems etc), out-of-memory killer can kill cryptsetup.
This is because of (stupid) Linux memory over-committing strategy.
(And that's why we have hard upper limit to 1GB but it is still a lot.)
We will need to tune some switches to work it reliably and perhaps
fork process during key-derivation to have control over possible unconditional
process termination to clean memory with sensitive data.
(I hate it, but seems nothing else is reliable.)
You can workaround it by limiting memory yourself, cryptsetup limits it as
well according to physical memory, but OOM can still happen, it just depends
how other processes allocates memory.
Just be prepared for these reports. Actually, it was Fedora installer where
we saw this when tried to use LUKS2 :-)
Another thing is that I would like to see some independent analysis of Argon2
costs - do we really provide better security margin than PBKDF2 now?
Anyway, the rough plan is:
- later this week there will be stable 2.0.4 release.
The major LUKS2 fix is that libcryptsetup is now linked to libblkid
and will not automatically recover from secondary header if it detects
another (fs) signature.
(Because recovery could revert intentional change... We were too aggressive here.)
Libblkid is already used in dm/udev rules, so it should not increase
any image sizes. (And it can be disabled in configure if needed.)
As a bonus we now warn user before luksFormat if some signature is found.
Related patch for libblkid that can detect secondary LUKS2 header and properly
wipe it in wipefs is in util-linux upstream, not sure if it planned for stable,
but is should be in distro that use LUKS2 as default.
(Now only primary header is wiped and some commands, unfortunately including isLuks,
will quietly recover from secondary header :-)
- there will be cryptsetup 2.1 release, I hope not later than end of this year (i.e. 2018 :),
where some bigger changes are planned, including OOM "fixes" mentioned above
(but no changes in LUKS2 on-disk format, maybe we just increase default header size,
but that's already supported).
Perhaps I will need to bump library version because of some dm-integrity
parameters struct change (my mistake). Only recompilation will be needed though.
I guess we can make LUKS2 default in 2.1 upstream.
For the authenticated encryption - it will remain experimental for some time still.
There are AEGIS and MORUS AEADs in 4.18 kernel that have 128bit nonces, so are
usable for our scenarios, but some other things are missing in cryptsetup code
(resize, recovery on dm-integrity metadata/journal corruption etc).
Milan
> Personally I'd rather *not* have such custom defaults in the installer.
> Do you have any plan to have `luksFormat` default to LUKS2 at some
> point? If so, any idea, when that would happen? ;-) Given the warning
> in the latest Release Notes [0] I assume LUKS2 is not mature enough for
> our installer yet. Not sure what other distros are doing, but for
> Debian we're waiting for that scary warning to disappear (or
> alternatively, an explicit blessing from upstream) before promoting
> LUKS2 (and latter authenticated encryption — once a better AEAD
> algorithm is available) in our installer and documentation :-)
>
> Cheers,
>
next prev parent reply other threads:[~2018-07-30 10:51 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-27 8:16 [dm-crypt] Debian installer formatting LUKS2 devices by default? Guilhem Moulin
2018-07-30 10:51 ` Milan Broz [this message]
2018-07-30 20:47 ` Guilhem Moulin
2018-07-31 6:00 ` Michael Kjörling
2018-07-31 7:53 ` Guilhem Moulin
2018-11-23 9:21 ` Milan Broz
2018-11-23 18:26 ` Guilhem Moulin
2018-11-23 18:46 ` Milan Broz
2019-01-25 13:54 ` Guilhem Moulin
2019-01-25 14:31 ` Milan Broz
2019-01-25 15:05 ` Guilhem Moulin
2019-02-05 15:29 ` Milan Broz
2018-07-31 8:56 ` Milan Broz
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=d349eeb9-4509-e188-4bb2-90854bcc9a69@gmail.com \
--to=gmazyland@gmail.com \
--cc=dm-crypt@saout.de \
--cc=guilhem@fripost.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