linux/fs/crypto
Eric Biggers 85af90e57c fscrypt: check for appropriate use of DIRECT_KEY flag earlier
FSCRYPT_POLICY_FLAG_DIRECT_KEY is currently only allowed with Adiantum
encryption.  But FS_IOC_SET_ENCRYPTION_POLICY allowed it in combination
with other encryption modes, and an error wasn't reported until later
when the encrypted directory was actually used.

Fix it to report the error earlier by validating the correct use of the
DIRECT_KEY flag in fscrypt_supported_policy(), similar to how we
validate the IV_INO_LBLK_64 flag.

Link: https://lore.kernel.org/r/20191209211829.239800-3-ebiggers@kernel.org
Signed-off-by: Eric Biggers <ebiggers@google.com>
2019-12-31 10:33:50 -06:00
..
bio.c fscrypt: remove struct fscrypt_ctx 2019-10-21 13:22:08 -07:00
crypto.c fscrypt: move fscrypt_d_revalidate() to fname.c 2019-12-31 10:33:50 -06:00
fname.c fscrypt: move fscrypt_d_revalidate() to fname.c 2019-12-31 10:33:50 -06:00
fscrypt_private.h fscrypt: check for appropriate use of DIRECT_KEY flag earlier 2019-12-31 10:33:50 -06:00
hkdf.c fscrypt: constify struct fscrypt_hkdf parameter to fscrypt_hkdf_expand() 2019-12-31 10:33:50 -06:00
hooks.c fscrypt: make fscrypt_msg() take inode instead of super_block 2019-08-12 19:04:44 -07:00
Kconfig fscrypt: add an HKDF-SHA512 implementation 2019-08-12 19:18:50 -07:00
keyring.c fscrypt: support passing a keyring key to FS_IOC_ADD_ENCRYPTION_KEY 2019-12-31 10:33:49 -06:00
keysetup_v1.c fscrypt: check for appropriate use of DIRECT_KEY flag earlier 2019-12-31 10:33:50 -06:00
keysetup.c fscrypt: check for appropriate use of DIRECT_KEY flag earlier 2019-12-31 10:33:50 -06:00
Makefile fscrypt: add an HKDF-SHA512 implementation 2019-08-12 19:18:50 -07:00
policy.c fscrypt: check for appropriate use of DIRECT_KEY flag earlier 2019-12-31 10:33:50 -06:00