All of lore.kernel.org
 help / color / mirror / Atom feed
From: Glenn Washburn <development@efficientek.com>
To: Josselin Poiret via Grub-devel <grub-devel@gnu.org>
Cc: Josselin Poiret <dev@jpoiret.xyz>
Subject: Re: [PATCH 0/2] Have LUKS2 cryptomounts be useable with grub-probe
Date: Thu, 9 Dec 2021 14:15:50 -0600	[thread overview]
Message-ID: <20211209141526.002e83a4@crass-HP-ZBook-15-G2> (raw)
In-Reply-To: <20211209173853.30489-1-dev@jpoiret.xyz>

On Thu,  9 Dec 2021 18:38:51 +0100
Josselin Poiret via Grub-devel <grub-devel@gnu.org> wrote:

> Hello,
> 
> These two draft patches make devmapper set up LUKS2 cryptomount
> properties when pulling, as well as report LUKS2 cryptomounts as
> having GRUB_DEV_ABSTRACTION_LUKS.  This makes grub-probe and
> grub-install behave properly wrt. LUKS2 drives: `grub-probe -t
> abstraction /` reports all the needed modules for the GRUB image, and
> grub-install leads to a working GRUB without manually adding modules.
> 
> One small part that I am unsure about, although I have tested it and
> it does seem to work properly: if I understand correctly, all dm
> devices have a 512 sector size, however LUKS2 lets one choose up to
> 4096 for the encryption sector size.  Which of these two should be
> used as cryptodisk->sector_size?  I put 512 here since we're reading
> through a cheated mount, but I'm not so sure.

Its not clear to me, did you test a LUKS2 device with sector size 4096
with this change? I believe DM does use 512-byte sectors internally,
but it can create block devices that report and use other sector sizes.
You can verfiy this by creating a 4096 sector size LUKS2 devices, open
it with cryptsetup, and then run "blockdev --getbsz /dev/mapper/<dm name>".

When having a 4096 byte sector size LUKS2 device opened via cyptsetup,
here's what dmsetup table --show returns "sector_size:4096" as part of
the output for the device. I'm not familiar with this code, but I'm
thinking tht might show up in the "params" variable for you to use when
setting log_sector_size.

I have a feeling that this is not going to work as is with non-512-byte
sector size LUKS2 devices. 

Glenn


  parent reply	other threads:[~2021-12-09 20:16 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-09 17:38 [PATCH 0/2] Have LUKS2 cryptomounts be useable with grub-probe Josselin Poiret
2021-12-09 17:38 ` [PATCH 1/2] devmapper/getroot: Have devmapper recognize LUKS2 Josselin Poiret
2021-12-09 17:38 ` [PATCH 2/2] devmapper/getroot: Set up cheated LUKS2 cryptodisk mount from DM parameters Josselin Poiret
2021-12-09 20:15 ` Glenn Washburn [this message]
2021-12-11 12:29   ` [PATCH v2 0/2] Have LUKS2 cryptomounts be useable with grub-probe Josselin Poiret
2021-12-11 12:29     ` [PATCH v2 1/2] devmapper/getroot: Have devmapper recognize LUKS2 Josselin Poiret
2022-05-12 22:25       ` Glenn Washburn
2021-12-11 12:29     ` [PATCH v2 2/2] devmapper/getroot: Set up cheated LUKS2 cryptodisk mount from DM parameters Josselin Poiret
2022-05-12 22:38       ` Glenn Washburn
2022-05-20 18:20         ` [PATCH v3 0/2] Have LUKS2 cryptomounts be useable with grub-probe Josselin Poiret
2022-05-20 18:20           ` [PATCH v3 1/2] devmapper/getroot: Have devmapper recognize LUKS2 Josselin Poiret
2022-05-20 18:20           ` [PATCH v3 2/2] devmapper/getroot: Set up cheated LUKS2 cryptodisk mount from DM parameters Josselin Poiret
2022-05-21  0:20             ` Glenn Washburn
2022-05-21  9:27               ` Josselin Poiret
2022-06-14 13:47               ` [PATCH v4 0/2] Have LUKS2 cryptomounts be useable with grub-probe Josselin Poiret
2022-06-14 13:47                 ` [PATCH v4 1/2] devmapper/getroot: Have devmapper recognize LUKS2 Josselin Poiret
2022-06-14 13:47                 ` [PATCH v4 2/2] devmapper/getroot: Set up cheated LUKS2 cryptodisk mount from DM parameters Josselin Poiret
2022-06-14 18:28                   ` Glenn Washburn
2022-06-15  3:52                   ` Michael Chang
2022-06-14 18:31                 ` [PATCH v4 0/2] Have LUKS2 cryptomounts be useable with grub-probe Glenn Washburn
2022-06-15 10:01                   ` [PATCH v5 " Josselin Poiret
2022-06-15 10:02                     ` [PATCH v5 1/2] devmapper/getroot: Have devmapper recognize LUKS2 Josselin Poiret
2022-06-15 10:02                     ` [PATCH v5 2/2] devmapper/getroot: Set up cheated LUKS2 cryptodisk mount from DM parameters Josselin Poiret
2022-07-05 11:09                       ` Daniel Kiper
2022-07-08 10:06                         ` [PATCH v6 0/2] Have LUKS2 cryptomounts be useable with grub-probe Josselin Poiret
2022-07-08 10:06                           ` [PATCH v6 1/2] devmapper/getroot: Have devmapper recognize LUKS2 Josselin Poiret
2022-07-08 10:06                           ` [PATCH v6 2/2] devmapper/getroot: Set up cheated LUKS2 cryptodisk mount from DM parameters Josselin Poiret
2022-11-08 15:07                             ` Fabian Vogt
2022-08-11 18:18                           ` [PATCH v6 0/2] Have LUKS2 cryptomounts be useable with grub-probe Glenn Washburn
2022-05-12 22:20     ` [PATCH v2 " Glenn Washburn
2022-05-13 11:58       ` Fabian Vogt

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=20211209141526.002e83a4@crass-HP-ZBook-15-G2 \
    --to=development@efficientek.com \
    --cc=dev@jpoiret.xyz \
    --cc=grub-devel@gnu.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 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.