From: Patrick Steinhardt <ps@pks.im>
To: Daniel Kiper <dkiper@net-space.pl>
Cc: Glenn Washburn <development@efficientek.com>,
grub-devel@gnu.org,
Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>,
John Lane <john@lane.uk.net>
Subject: Re: [PATCH 0/3] Cryptomount detached headers
Date: Sun, 15 May 2022 18:50:29 +0200 [thread overview]
Message-ID: <YoEvVSK6ivqfQcer@xps> (raw)
In-Reply-To: <20220513112412.5y2mhhmt3mmjpj57@tomti.i.net-space.pl>
[-- Attachment #1: Type: text/plain, Size: 3365 bytes --]
On Fri, May 13, 2022 at 01:24:12PM +0200, Daniel Kiper wrote:
> On Tue, May 10, 2022 at 11:53:06PM -0500, Glenn Washburn wrote:
> > 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.
>
> I would get rid of this code. The first question which comes to my mind
> is: which hook has to process the data first? If we do not know potential
> users of that "multi-hook" feature I would not introduce it to not
> create a feeling the hook interface is well defined. So, at this point
> I would suggest to stick with one hook only.
>
> > 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.
>
> I am OK with the idea though I would like to hear Patrick's opinion here.
>
> Daniel
It's rather intimate with how the backends are working right now, but
has the big advantage that it's backend-agnostic except for GELI. I feel
like the code warrants some more comments to explain what the underlying
idea is, but overall I like it.
Patrick
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
prev parent reply other threads:[~2022-05-15 16:50 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-11 4:53 [PATCH 0/3] Cryptomount detached headers Glenn Washburn
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 [this message]
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=YoEvVSK6ivqfQcer@xps \
--to=ps@pks.im \
--cc=GNUtoo@cyberdimension.org \
--cc=development@efficientek.com \
--cc=dkiper@net-space.pl \
--cc=grub-devel@gnu.org \
--cc=john@lane.uk.net \
/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.