WSL2-Linux-Kernel/fs/crypto
Satya Tangirala 5fee36095c fscrypt: add inline encryption support
Add support for inline encryption to fs/crypto/.  With "inline
encryption", the block layer handles the decryption/encryption as part
of the bio, instead of the filesystem doing the crypto itself via
Linux's crypto API. This model is needed in order to take advantage of
the inline encryption hardware present on most modern mobile SoCs.

To use inline encryption, the filesystem needs to be mounted with
'-o inlinecrypt'. Blk-crypto will then be used instead of the traditional
filesystem-layer crypto whenever possible to encrypt the contents
of any encrypted files in that filesystem. Fscrypt still provides the key
and IV to use, and the actual ciphertext on-disk is still the same;
therefore it's testable using the existing fscrypt ciphertext verification
tests.

Note that since blk-crypto has a fallback to Linux's crypto API, and
also supports all the encryption modes currently supported by fscrypt,
this feature is usable and testable even without actual inline
encryption hardware.

Per-filesystem changes will be needed to set encryption contexts when
submitting bios and to implement the 'inlinecrypt' mount option.  This
patch just adds the common code.

Signed-off-by: Satya Tangirala <satyat@google.com>
Reviewed-by: Jaegeuk Kim <jaegeuk@kernel.org>
Reviewed-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Theodore Ts'o <tytso@mit.edu>
Link: https://lore.kernel.org/r/20200702015607.1215430-3-satyat@google.com
Co-developed-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Eric Biggers <ebiggers@google.com>
2020-07-08 10:29:30 -07:00
..
Kconfig fscrypt: add inline encryption support 2020-07-08 10:29:30 -07:00
Makefile fscrypt: add inline encryption support 2020-07-08 10:29:30 -07:00
bio.c fscrypt: add inline encryption support 2020-07-08 10:29:30 -07:00
crypto.c fscrypt: add inline encryption support 2020-07-08 10:29:30 -07:00
fname.c fscrypt: add inline encryption support 2020-07-08 10:29:30 -07:00
fscrypt_private.h fscrypt: add inline encryption support 2020-07-08 10:29:30 -07:00
hkdf.c fscrypt: use crypto_shash_tfm_digest() 2020-05-08 15:32:14 +10:00
hooks.c fscrypt: fix all kerneldoc warnings 2020-05-12 16:37:17 -07:00
inline_crypt.c fscrypt: add inline encryption support 2020-07-08 10:29:30 -07:00
keyring.c fscrypt: add inline encryption support 2020-07-08 10:29:30 -07:00
keysetup.c fscrypt: add inline encryption support 2020-07-08 10:29:30 -07:00
keysetup_v1.c fscrypt: add inline encryption support 2020-07-08 10:29:30 -07:00
policy.c fscrypt: add support for IV_INO_LBLK_32 policies 2020-05-19 09:34:18 -07:00