]> git.baikalelectronics.ru Git - kernel.git/commit
fs, fscrypt: clear DCACHE_ENCRYPTED_NAME when unaliasing directory
authorEric Biggers <ebiggers@google.com>
Wed, 20 Mar 2019 18:39:11 +0000 (11:39 -0700)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 17 Apr 2019 14:05:51 +0000 (10:05 -0400)
commit4e39533bb6021c74a01e0ae4f5208d7d9e064ca9
tree97a5f5cedec9b310490df829e03997036869c9fa
parent05a39ac2d538543fd00b524137aba3404c46fffc
fs, fscrypt: clear DCACHE_ENCRYPTED_NAME when unaliasing directory

Make __d_move() clear DCACHE_ENCRYPTED_NAME on the source dentry.  This
is needed for when d_splice_alias() moves a directory's encrypted alias
to its decrypted alias as a result of the encryption key being added.

Otherwise, the decrypted alias will incorrectly be invalidated on the
next lookup, causing problems such as unmounting a mount the user just
mount()ed there.

Note that we don't have to support arbitrary moves of this flag because
fscrypt doesn't allow dentries with DCACHE_ENCRYPTED_NAME to be the
source or target of a rename().

Fixes: e1d95458645c ("ext4 crypto: revalidate dentry after adding or removing the key")
Reported-by: Sarthak Kukreti <sarthakkukreti@chromium.org>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/dcache.c
include/linux/fscrypt.h