mbox series

[0/4] fscrypt: fscrypt_supported_policy() fixes and cleanups

Message ID 20191209211829.239800-1-ebiggers@kernel.org (mailing list archive)
Headers show
Series fscrypt: fscrypt_supported_policy() fixes and cleanups | expand

Message

Eric Biggers Dec. 9, 2019, 9:18 p.m. UTC
Make FS_IOC_SET_ENCRYPTION_POLICY start rejecting the DIRECT_KEY flag
when it's incompatible with the selected encryption modes, instead of
delaying this check until later when actually trying to set up the
directory's key.

Also make some related cleanups, such as splitting
fscrypt_supported_policy() into a separate function for each encryption
policy version.

Eric Biggers (4):
  fscrypt: split up fscrypt_supported_policy() by policy version
  fscrypt: check for appropriate use of DIRECT_KEY flag earlier
  fscrypt: move fscrypt_valid_enc_modes() to policy.c
  fscrypt: remove fscrypt_is_direct_key_policy()

 fs/crypto/fscrypt_private.h |  30 +------
 fs/crypto/keysetup.c        |  14 +---
 fs/crypto/keysetup_v1.c     |  15 ----
 fs/crypto/policy.c          | 163 +++++++++++++++++++++++-------------
 4 files changed, 111 insertions(+), 111 deletions(-)

Comments

Eric Biggers Jan. 3, 2020, 5 p.m. UTC | #1
On Mon, Dec 09, 2019 at 01:18:25PM -0800, Eric Biggers wrote:
> Make FS_IOC_SET_ENCRYPTION_POLICY start rejecting the DIRECT_KEY flag
> when it's incompatible with the selected encryption modes, instead of
> delaying this check until later when actually trying to set up the
> directory's key.
> 
> Also make some related cleanups, such as splitting
> fscrypt_supported_policy() into a separate function for each encryption
> policy version.
> 
> Eric Biggers (4):
>   fscrypt: split up fscrypt_supported_policy() by policy version
>   fscrypt: check for appropriate use of DIRECT_KEY flag earlier
>   fscrypt: move fscrypt_valid_enc_modes() to policy.c
>   fscrypt: remove fscrypt_is_direct_key_policy()
> 
>  fs/crypto/fscrypt_private.h |  30 +------
>  fs/crypto/keysetup.c        |  14 +---
>  fs/crypto/keysetup_v1.c     |  15 ----
>  fs/crypto/policy.c          | 163 +++++++++++++++++++++++-------------
>  4 files changed, 111 insertions(+), 111 deletions(-)
> 
> -- 
> 2.24.0.393.g34dc348eaf-goog
> 

All applied to fscrypt.git#master for 5.6.

- Eric