Re: [PATCH 0/3] add support for metadata encryption to F2FS

From: Eric Biggers
Date: Wed Oct 07 2020 - 17:00:44 EST


On Mon, Oct 05, 2020 at 07:36:03AM +0000, Satya Tangirala wrote:
> This patch series adds support for metadata encryption to F2FS using
> blk-crypto.

This patch series needs more explanation about what "metadata encryption" is,
why people will want to use it (as opposed to either not using it, or using
fscrypt + dm-crypt instead), and why this is the best implementation of it.

> Patch 2 introduces some functions to fscrypt that help filesystems perform
> metadata encryption. Any filesystem that wants to use metadata encryption
> can call fscrypt_setup_metadata_encryption() with the super_block of the
> filesystem, the encryption algorithm and the descriptor of the encryption
> key. The descriptor is looked up in the logon keyring of the current
> session with "fscrypt:" as the prefix of the descriptor.

I notice this is missing the step I suggested to include the metadata encryption
key in the HKDF application-specific info string when deriving subkeys from the
fscrypt master keys.

The same effect could also be achieved by adding an additional level to the key
hierarchy: each HKDF key would be derived from a fscrypt master key and the
metadata encryption key.

We need one of those, to guarantee that the file contents encryption is at least
as strong as the "metadata encryption".

- Eric