linux_old1/fs/crypto
Eric Biggers 42d97eb0ad fscrypt: fix renaming and linking special files
Attempting to link a device node, named pipe, or socket file into an
encrypted directory through rename(2) or link(2) always failed with
EPERM.  This happened because fscrypt_has_permitted_context() saw that
the file was unencrypted and forbid creating the link.  This behavior
was unexpected because such files are never encrypted; only regular
files, directories, and symlinks can be encrypted.

To fix this, make fscrypt_has_permitted_context() always return true on
special files.

This will be covered by a test in my encryption xfstests patchset.

Fixes: 9bd8212f98 ("ext4 crypto: add encryption policy and password salt support")
Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Richard Weinberger <richard@nod.at>
Cc: stable@vger.kernel.org
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-12-31 00:47:05 -05:00
..
Kconfig fscrypto: remove unneeded Kconfig dependencies 2016-12-11 16:26:07 -05:00
Makefile fs crypto: move per-file encryption from f2fs tree to fs/crypto 2016-03-17 21:19:33 -07:00
crypto.c fscrypt: Rename FS_WRITE_PATH_FL to FS_CTX_HAS_BOUNCE_BUFFER_FL 2016-12-11 16:33:18 -05:00
fname.c fscrypt: rename get_crypt_info() to fscrypt_get_crypt_info() 2016-12-11 16:26:08 -05:00
fscrypt_private.h fscrypt: Rename FS_WRITE_PATH_FL to FS_CTX_HAS_BOUNCE_BUFFER_FL 2016-12-11 16:33:18 -05:00
keyinfo.c fscrypt: fix the test_dummy_encryption mount option 2016-12-27 19:46:27 -05:00
policy.c fscrypt: fix renaming and linking special files 2016-12-31 00:47:05 -05:00