unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#38826] doc: Mention no LUKS2 for luks-device-mapping
@ 2019-12-31  3:47 David Trudgian
  2020-01-02 22:32 ` Danny Milosavljevic
  0 siblings, 1 reply; 6+ messages in thread
From: David Trudgian @ 2019-12-31  3:47 UTC (permalink / raw)
  To: 38826

[-- Attachment #1: Type: text/plain, Size: 396 bytes --]

I spent a bit of time trying to mount some existing LUKS2 devices on
boot in a Guix system. They worked to open and mount manually in a
booted system, but not on boot with luks-device-mapping. Eventually
worked out LUKS2 is not supported by the code that inspects the
superblock directly for the (LUKS1) UUID.

A mention LUKS2 is not supported in the docs might be nice.

Cheers,

Dave Trudgian


[-- Attachment #2: 0001-Mention-no-LUKS2-in-luks-device-mapping-doc.patch --]
[-- Type: text/plain, Size: 1286 bytes --]

From 97ed4c1859e797adf4ba813ac7db3d1b8261a569 Mon Sep 17 00:00:00 2001
From: David Trudgian <EMAIL>
Date: Mon, 30 Dec 2019 21:37:35 -0600
Subject: [PATCH] Mention no LUKS2 in luks-device-mapping doc

---
 doc/guix.texi | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/doc/guix.texi b/doc/guix.texi
index 70e3dfea6a..232d99d508 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -69,6 +69,7 @@ Copyright @copyright{} 2019 Jakob L. Kreuze@*
 Copyright @copyright{} 2019 Kyle Andrews@*
 Copyright @copyright{} 2019 Alex Griffin@*
 Copyright @copyright{} 2019 Guillaume Le Vaillant@*
+Copyright @copyright{} 2019 David C. Trudgian@*
 
 Permission is granted to copy, distribute and/or modify this document
 under the terms of the GNU Free Documentation License, Version 1.3 or
@@ -11470,6 +11471,10 @@ This must be a @code{mapped-device-kind} object, which specifies how
 This defines LUKS block device encryption using the @command{cryptsetup}
 command from the package with the same name.  It relies on the
 @code{dm-crypt} Linux kernel module.
+
+Note that currently only LUKS1 encrypted devices are supported. Existing
+LUKS2 devices can be opened and mounted after boot, using
+@code{cryptsetup luksOpen}.
 @end defvr
 
 @defvr {Scheme Variable} raid-device-mapping
-- 
2.24.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [bug#38826] doc: Mention no LUKS2 for luks-device-mapping
  2019-12-31  3:47 [bug#38826] doc: Mention no LUKS2 for luks-device-mapping David Trudgian
@ 2020-01-02 22:32 ` Danny Milosavljevic
  2020-01-02 22:53   ` Tobias Geerinckx-Rice via Guix-patches via
  0 siblings, 1 reply; 6+ messages in thread
From: Danny Milosavljevic @ 2020-01-02 22:32 UTC (permalink / raw)
  To: David Trudgian; +Cc: 38826

[-- Attachment #1: Type: text/plain, Size: 1109 bytes --]

Hi,

On Mon, 30 Dec 2019 21:47:01 -0600
David Trudgian <dave@trudgian.net> wrote:

> I spent a bit of time trying to mount some existing LUKS2 devices on
> boot in a Guix system. They worked to open and mount manually in a
> booted system, but not on boot with luks-device-mapping. Eventually
> worked out LUKS2 is not supported by the code that inspects the
> superblock directly for the (LUKS1) UUID.
> 
> A mention LUKS2 is not supported in the docs might be nice.

I agree.

But better yet would be to implement LUKS2 in the uuid code.
Since you have such a device could you find where the magic number /
uuid parts in it are?

Both references [1] and [2] say that the magic number is 6 bytes and the
uuid is at offset 168 Byte, length 40 Byte.  Endianness is also big endian
in both, so I have no idea where the problem comes from.  The code should
work for both.

[1] LUKS1 on-disk format: https://gitlab.com/cryptsetup/cryptsetup/-/wikis/LUKS-standard/on-disk-format.pdf
[2] LUKS2 on-disk format: https://habd.as/post/external-backup-drive-encryption/assets/luks2_doc_wip.pdf

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [bug#38826] doc: Mention no LUKS2 for luks-device-mapping
  2020-01-02 22:32 ` Danny Milosavljevic
@ 2020-01-02 22:53   ` Tobias Geerinckx-Rice via Guix-patches via
  2020-01-03  1:56     ` David Trudgian
  2020-01-10 15:39     ` [bug#38826] Fwd: [bug #55093] Add LUKS2 support Tobias Geerinckx-Rice via Guix-patches via
  0 siblings, 2 replies; 6+ messages in thread
From: Tobias Geerinckx-Rice via Guix-patches via @ 2020-01-02 22:53 UTC (permalink / raw)
  To: Danny Milosavljevic, David Trudgian; +Cc: 38826

[-- Attachment #1: Type: text/plain, Size: 580 bytes --]

Danny, David,

Danny Milosavljevic 写道:
> David Trudgian <dave@trudgian.net> wrote:
>> A mention LUKS2 is not supported in the docs might be nice.
>
> I agree.

Same.  Would you consider submitting a patch, David?  Or writing 
the text?

> But better yet would be to implement LUKS2 in the uuid code.

Has LUKS2 support[0] been added to GRUB yet?  Last I checked it 
hadn't.

Which isn't to say that we shouldn't get our own house in order, 
of course.

Kind regards,

T G-R

[0]: 
https://lists.gnu.org/archive/html/grub-devel/2019-11/msg00000.html

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [bug#38826] doc: Mention no LUKS2 for luks-device-mapping
  2020-01-02 22:53   ` Tobias Geerinckx-Rice via Guix-patches via
@ 2020-01-03  1:56     ` David Trudgian
  2020-01-10 15:39     ` [bug#38826] Fwd: [bug #55093] Add LUKS2 support Tobias Geerinckx-Rice via Guix-patches via
  1 sibling, 0 replies; 6+ messages in thread
From: David Trudgian @ 2020-01-03  1:56 UTC (permalink / raw)
  To: Tobias Geerinckx-Rice; +Cc: David Trudgian, Danny Milosavljevic, 38826

[-- Attachment #1: Type: text/plain, Size: 1318 bytes --]


Hi Danny, Tobias,

>>> A mention LUKS2 is not supported in the docs might be nice.
>>
>> I agree.
>
> Same.  Would you consider submitting a patch, David?  Or writing the
> text?

My original email had a patch attached (or should have). Apologies -
there was no [PATCH] on the subject. Attaching here in case.

>> But better yet would be to implement LUKS2 in the uuid code.

I intend to take a look at this when I get time in the next week or so.

> Has LUKS2 support[0] been added to GRUB yet?  Last I checked it
> hadn't.

I don't believe GRUB has LUKS2 support for booting from an encrypted
partition merged yet. The last I saw there was a patch for LUKS2 but it
didn't support the Argon 2i PBKDF which is the default you get when you
use LUKS2 in distros where a separate `/boot` is kept unencrypted, so it
wouldn't be useful yet.

It would still be good to be able to boot from LUKS1 but mount non-boot
LUKS2 partitions, so people like me coming from other distros can mount
their encrypted `/home` or similar without having to convert to LUKS1.

I have actually converted to LUKS1, which requires converting the key to
pbkdf2 first...

cryptsetup luksConvertKey --pbkdf=pbkdf2 /dev/sdc1
cryptsetup convert /dev/sdc1 --type luks1

...but I can easily create LUKS2 things to work on the UUID code.

Cheers,

DT


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Mention-no-LUKS2-in-luks-device-mapping-doc.patch --]
[-- Type: text/x-patch, Size: 1286 bytes --]

From 97ed4c1859e797adf4ba813ac7db3d1b8261a569 Mon Sep 17 00:00:00 2001
From: David Trudgian <EMAIL>
Date: Mon, 30 Dec 2019 21:37:35 -0600
Subject: [PATCH] Mention no LUKS2 in luks-device-mapping doc

---
 doc/guix.texi | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/doc/guix.texi b/doc/guix.texi
index 70e3dfea6a..232d99d508 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -69,6 +69,7 @@ Copyright @copyright{} 2019 Jakob L. Kreuze@*
 Copyright @copyright{} 2019 Kyle Andrews@*
 Copyright @copyright{} 2019 Alex Griffin@*
 Copyright @copyright{} 2019 Guillaume Le Vaillant@*
+Copyright @copyright{} 2019 David C. Trudgian@*
 
 Permission is granted to copy, distribute and/or modify this document
 under the terms of the GNU Free Documentation License, Version 1.3 or
@@ -11470,6 +11471,10 @@ This must be a @code{mapped-device-kind} object, which specifies how
 This defines LUKS block device encryption using the @command{cryptsetup}
 command from the package with the same name.  It relies on the
 @code{dm-crypt} Linux kernel module.
+
+Note that currently only LUKS1 encrypted devices are supported. Existing
+LUKS2 devices can be opened and mounted after boot, using
+@code{cryptsetup luksOpen}.
 @end defvr
 
 @defvr {Scheme Variable} raid-device-mapping
-- 
2.24.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [bug#38826] Fwd: [bug #55093] Add LUKS2 support
  2020-01-02 22:53   ` Tobias Geerinckx-Rice via Guix-patches via
  2020-01-03  1:56     ` David Trudgian
@ 2020-01-10 15:39     ` Tobias Geerinckx-Rice via Guix-patches via
  2020-01-10 19:03       ` David Trudgian
  1 sibling, 1 reply; 6+ messages in thread
From: Tobias Geerinckx-Rice via Guix-patches via @ 2020-01-10 15:39 UTC (permalink / raw)
  To: 38826

[-- Attachment #1: Type: text/plain, Size: 368 bytes --]

Guix,

Good news:

Eli Schwartz (在 Savannah):
> Follow-up Comment #5, bug #55093 (project grub):
>
> Yay, this is implemented in
> https://git.savannah.gnu.org/cgit/grub.git/commit/?id=365e0cc3e7e44151c14dd29514c2f870b49f9755

I'll take a look later.  We'll see whether or not it would be 
prudent to ship this as-is in Guix.

Kind regards,

T G-R

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [bug#38826] Fwd: [bug #55093] Add LUKS2 support
  2020-01-10 15:39     ` [bug#38826] Fwd: [bug #55093] Add LUKS2 support Tobias Geerinckx-Rice via Guix-patches via
@ 2020-01-10 19:03       ` David Trudgian
  0 siblings, 0 replies; 6+ messages in thread
From: David Trudgian @ 2020-01-10 19:03 UTC (permalink / raw)
  To: Tobias Geerinckx-Rice; +Cc: 38826

[-- Attachment #1: Type: text/plain, Size: 1179 bytes --]

>> Yay, this is implemented in
>> https://git.savannah.gnu.org/cgit/grub.git/commit/?id=365e0cc3e7e44151c14dd29514c2f870b49f9755
>
> I'll take a look later.  We'll see whether or not it would be prudent
> to ship this as-is in Guix.


I had a look at this before, and the issue remaining is that the LUKS2
support in GRUB via this patch is not compatible with the default PBKDF
that is going to be used by cryptsetup when creating LUKS2 partitions.

Looking at `cryptsetup --help` on Guix or elsewhere will show that the
default LUKS2 PBKDF is argon2i. Unfortunately only pbkdf2 is supported by
this GRUB2 patch (it's the default PBKDF for LUKS1).

It's possible to create LUKS2 encrypted partitions using pbkdf2, but
this means they aren't using a PBKDF of the same strength that most
people expect from LUKS2 use elsewhere - in distros where an
unencrypted `/boot` is used to avoid the direct support in GRUB problem.

I'm not sure if this is a major concern or not here?

Have spent some of my morning writing up about encryption in Singularity
containers, which uses LUKS2... so this is a fun topic to see in my
mailbox right now :-)

Cheers,

DT

[-- Attachment #2: Type: text/html, Size: 1650 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-01-10 19:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-12-31  3:47 [bug#38826] doc: Mention no LUKS2 for luks-device-mapping David Trudgian
2020-01-02 22:32 ` Danny Milosavljevic
2020-01-02 22:53   ` Tobias Geerinckx-Rice via Guix-patches via
2020-01-03  1:56     ` David Trudgian
2020-01-10 15:39     ` [bug#38826] Fwd: [bug #55093] Add LUKS2 support Tobias Geerinckx-Rice via Guix-patches via
2020-01-10 19:03       ` David Trudgian
     [not found] <20181125-133249.sv131345.66349@savannah.gnu.org>
     [not found] ` <20190329-085821.sv141454.39342@savannah.gnu.org>
     [not found]   ` <20190529-204303.sv92573.55917@savannah.gnu.org>
     [not found]     ` <20191104-210711.sv164522.57380@savannah.gnu.org>
     [not found]       ` <20191104-214103.sv131345.42463@savannah.gnu.org>

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).