From: Liao Yuanhong <liaoyuanhong@vivo.com>
To: Eric Biggers <ebiggers@kernel.org>
Cc: tytso@mit.edu, jaegeuk@kernel.org, linux-fscrypt@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-ext4@vger.kernel.org,
linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [PATCH] fscrypt: add software key support for filesystem-managed data
Date: Thu, 23 Apr 2026 18:41:30 +0800 [thread overview]
Message-ID: <05eca173-168a-47df-982f-ccc3e06c0d0c@vivo.com> (raw)
In-Reply-To: <20260422232747.GD2226@sol>
On 4/23/2026 7:27 AM, Eric Biggers wrote:
> I don't have time for a super detailed review at the moment, but here
> are my initial thoughts:
>
> - This needs to be sent along with the code that actually uses it in
> ext4 and f2fs. Please also Cc the mailing lists for those
> filesystems.
>
> - This is going to require an "incompat" filesystem feature flag. After
> all, once a filesystem contains files that use this scheme, older
> kernels won't understand it.
>
> - UBIFS and CephFS already use fs/crypto/ but don't support blk-crypto
> (inline encryption). This new code feels duplicative of that. It
> should be possible to reuse the existing code instead. That would
> include, for example, reusing the existing en/decryption functions and
> the existing struct ci_enc_key field. This would keep the changes
> limited mainly to how the key is being set up.
>
> - Supporting all the different IV generation methods doesn't make sense
> when a per-file key is always used.
>
> - The fact that this is incompatible with hardware-wrapped keys greatly
> limits the usefulness of this. (Note that technically, it could be
> supported in combination with them anyway. But the security models
> would be inconsistent, which I assume is what you have in mind.)
>
> Hope this is helpful,
>
> - Eric
Thanks for the comments. They are very helpful.
I agree that the fscrypt changes should stay much closer to the
existing filesystem-layer encryption code. I will rework this so
that the fscrypt side is mainly limited to key setup: when
blk-crypto is used for normal file contents, fscrypt can also
prepare the existing software contents crypto state for
filesystem-managed regions that cannot go through bio/blk-crypto.
I will also drop the separate key object / key-selection path, and
try to reuse the existing contents key and software encryption
functions as much as possible.
I agree that supporting all IV generation methods is unnecessary
here. For the first version, I plan to limit this to the normal v2
per-file-key case.
Regarding hardware-wrapped keys: it may be technically possible to
make this work in some cases, but using a software crypto key for
these regions seems to conflict with the expected hardware-wrapped
key security model. What would you prefer for the initial version:
should this combination be disallowed, or is there another approach
you would recommend?
Thanks,
Liao Yuanhong
prev parent reply other threads:[~2026-04-23 10:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20260421075717.170840-1-liaoyuanhong@vivo.com>
2026-04-22 23:27 ` [PATCH] fscrypt: add software key support for filesystem-managed data Eric Biggers
2026-04-23 10:41 ` Liao Yuanhong [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=05eca173-168a-47df-982f-ccc3e06c0d0c@vivo.com \
--to=liaoyuanhong@vivo.com \
--cc=ebiggers@kernel.org \
--cc=jaegeuk@kernel.org \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-fscrypt@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tytso@mit.edu \
/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