From: Glenn Washburn <development@efficientek.com>
To: grub-devel@gnu.org, Daniel Kiper <dkiper@net-space.pl>
Cc: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>,
Patrick Steinhardt <ps@pks.im>, John Lane <john@lane.uk.net>,
Glenn Washburn <development@efficientek.com>
Subject: [PATCH 0/3] Cryptomount detached headers
Date: Tue, 10 May 2022 23:53:06 -0500 [thread overview]
Message-ID: <cover.1652242759.git.development@efficientek.com> (raw)
This patch series is, I believe, a better approach to supporting detached
headers for cryptomount and backends. This series will probably not apply
cleanly without the changes from the recent series entitled "[PATCH 0/4]
Cryptomount keyfile support". But its only because they touch code in the
same vicinity, not because there's any real dependency.
Conceptually the approach is different than the previous detach header
series because this one uses the disk objects read hook to hook reads to
the disk in scan() and recover_key() such that if there is an associated
header file, the hook will cause the read to return data from the header
file instead of from the source disk.
For this the read hook implementation needed to be upgaded because prior
it didn't get the read buffer sent from the read caller and so could not
modify its contents. Patch #1 updates the hook accordingly and all instances
of its use, but doesn't functionally change how GRUB operates.
The second patch adds the header option to cryptomount and the read hook
to the source disk during the scan() and recover_key() stages. It takes
care of the case where there is already a previous read hook on the source
device and will call that read hook after modifying the read buffer. I don't
believe this is strictly necessary currently because I don't think there
ever is a read hook already set since the disk was just created with a
grub_disk_open(). I'm not opposed to getting rid of this code. The one
benefit I see if a bit of future proofing.
The benefit of this approach is its simpler/less code and does not require
the modification of backends, except to potentially cause a failure in
scan() if the backend doesn't support the current implementation of detached
headers, as with the GELI backend. This implementation requires that the
crypto volume header reside at the beginning of the volume. GELI has its
header at the end, which is why it can not currently be supported. In
theory, GELI could be supported if extra assumptions about its source
access pattern during scan() and recovery_key() were made. I don't use GELI,
no one seems to be asking for GELI detached headers, and I don't think that
GELI even support detached headers with the official tools. So for me, not
supporting crypto volumes with headers at the end of the disk is not a big
deal.
Glenn
Glenn Washburn (3):
disk: Allow read hook callback to take read buffer to potentially
modify it
cryptodisk: Add --header option to cryptomount to support detached
headers
docs: Add documentation on detached header option to cryptomount
docs/grub.texi | 13 +++++--
grub-core/commands/blocklist.c | 10 +++--
grub-core/commands/loadenv.c | 8 ++--
grub-core/commands/testload.c | 4 +-
grub-core/disk/cryptodisk.c | 68 +++++++++++++++++++++++++++++++++-
grub-core/disk/geli.c | 4 ++
grub-core/fs/hfspluscomp.c | 4 +-
grub-core/fs/ntfscomp.c | 14 +++----
grub-core/kern/disk.c | 12 +++---
grub-core/lib/progress.c | 11 ++++--
grub-core/net/net.c | 2 +-
include/grub/cryptodisk.h | 2 +
include/grub/disk.h | 6 +--
include/grub/file.h | 2 +
14 files changed, 125 insertions(+), 35 deletions(-)
--
2.34.1
next reply other threads:[~2022-05-11 4:53 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-11 4:53 Glenn Washburn [this message]
2022-05-11 4:53 ` [PATCH 1/3] disk: Allow read hook callback to take read buffer to potentially modify it Glenn Washburn
2022-05-11 4:53 ` [PATCH 2/3] cryptodisk: Add --header option to cryptomount to support detached headers Glenn Washburn
2022-05-15 16:47 ` Patrick Steinhardt
2022-05-16 14:26 ` Glenn Washburn
2022-05-16 15:39 ` Patrick Steinhardt
2022-05-16 21:31 ` Glenn Washburn
2022-05-11 4:53 ` [PATCH 3/3] docs: Add documentation on detached header option to cryptomount Glenn Washburn
2022-05-13 11:24 ` [PATCH 0/3] Cryptomount detached headers Daniel Kiper
2022-05-13 17:31 ` Glenn Washburn
2022-05-15 16:50 ` Patrick Steinhardt
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=cover.1652242759.git.development@efficientek.com \
--to=development@efficientek.com \
--cc=GNUtoo@cyberdimension.org \
--cc=dkiper@net-space.pl \
--cc=grub-devel@gnu.org \
--cc=john@lane.uk.net \
--cc=ps@pks.im \
/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.