fscrypt: new helper function - fscrypt_prepare_rename()
authorEric Biggers <ebiggers@google.com>
Mon, 9 Oct 2017 19:15:42 +0000 (12:15 -0700)
committerJaegeuk Kim <jaegeuk@kernel.org>
Fri, 5 Jan 2018 00:17:33 +0000 (16:17 -0800)
commit9a24d618cb8a1d5862a681dfc9d9d84ae9fa9e6e
treebf5ad448c305110bd8190a76597b03b70985dee9
parent4bd6179f5211556874f1ca722b8a5c682a65f138
fscrypt: new helper function - fscrypt_prepare_rename()

Introduce a helper function which prepares to rename a file into a
possibly encrypted directory.  It handles loading the encryption keys
for the source and target directories if needed, and it handles
enforcing that if the target directory (and the source directory for a
cross-rename) is encrypted, then the file being moved into the directory
has the same encryption policy as its containing directory.

Acked-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/crypto/hooks.c
include/linux/fscrypt.h
include/linux/fscrypt_notsupp.h
include/linux/fscrypt_supp.h