From: Eric Biggers <ebiggers@kernel.org>
To: "Luís Henriques" <lhenriques@suse.de>
Cc: Jeff Layton <jlayton@kernel.org>,
ceph-devel@vger.kernel.org, fstests@vger.kernel.org
Subject: Re: [PATCH v2] common/encrypt: allow the use of 'fscrypt:' as key prefix
Date: Mon, 4 Apr 2022 17:23:55 -0700 [thread overview]
Message-ID: <YkuMG5MH17qkS0EA@sol.localdomain> (raw)
In-Reply-To: <20220404102554.6616-1-lhenriques@suse.de>
The code looks fine, but the explanation needs some tweaks:
On Mon, Apr 04, 2022 at 11:25:54AM +0100, Luís Henriques wrote:
> fscrypt keys have used the $FSTYP as prefix. However this format is being
> deprecated -- newer kernels already allow the usage of the generic
> 'fscrypt:' prefix for ext4 and f2fs. This patch allows the usage of this
> new prefix for testing filesystems that have never supported the old
> format, but keeping the $FSTYP prefix for filesystems that support it, so
> that old kernels can be tested.
This explanation is inconsistent with the code, which uses FSTYP for only ext4
and f2fs, and fscrypt for everything else including ubifs.
A better explanation would be something like "Only use $FSTYP on filesystems
that never supported the 'fscrypt' prefix, i.e. ext4 and f2fs."
> +# Keys are named $FSTYP:KEYDESC where KEYDESC is the 16-character key descriptor
> +# hex string. Newer kernels (ext4 4.8 and later, f2fs 4.6 and later) also allow
> +# the common key prefix "fscrypt:" in addition to their filesystem-specific key
> +# prefix ("ext4:", "f2fs:"). It would be nice to use the common key prefix, but
> +# for now use the filesystem- specific prefix for these 2 filesystems to make it
> +# possible to test older kernels, and the "fscrypt" prefix for anything else.
> +_get_fs_keyprefix()
The first part of this comment sort of implies that FSTYP is the default and
"fscrypt" is the exception, but it should be the other way around.
How about:
# When fscrypt keys are added using the legacy mechanism (process-subscribed
# keyrings rather than filesystem keyrings), they are normally named
# "fscrypt:KEYDESC" where KEYDESC is the 16-character key descriptor hex string.
# However, ext4 and f2fs didn't add support for the "fscrypt" prefix until
# kernel v4.8 and v4.6, respectively. Before that, they used "ext4" and "f2fs",
# respectively. To allow testing ext4 and f2fs encryption on kernels older than
# this, we use these filesystem-specific prefixes for ext4 and f2fs.
next prev parent reply other threads:[~2022-04-05 2:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-04 10:25 [PATCH v2] common/encrypt: allow the use of 'fscrypt:' as key prefix Luís Henriques
2022-04-05 0:23 ` Eric Biggers [this message]
2022-04-05 8:53 ` Luís Henriques
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=YkuMG5MH17qkS0EA@sol.localdomain \
--to=ebiggers@kernel.org \
--cc=ceph-devel@vger.kernel.org \
--cc=fstests@vger.kernel.org \
--cc=jlayton@kernel.org \
--cc=lhenriques@suse.de \
/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