linux/fs/ecryptfs
Tyler Hicks 6d65261a09 eCryptfs: don't pass fs-specific ioctl commands through
eCryptfs can't be aware of what to expect when after passing an
arbitrary ioctl command through to the lower filesystem. The ioctl
command may trigger an action in the lower filesystem that is
incompatible with eCryptfs.

One specific example is when one attempts to use the Btrfs clone
ioctl command when the source file is in the Btrfs filesystem that
eCryptfs is mounted on top of and the destination fd is from a new file
created in the eCryptfs mount. The ioctl syscall incorrectly returns
success because the command is passed down to Btrfs which thinks that it
was able to do the clone operation. However, the result is an empty
eCryptfs file.

This patch allows the trim, {g,s}etflags, and {g,s}etversion ioctl
commands through and then copies up the inode metadata from the lower
inode to the eCryptfs inode to catch any changes made to the lower
inode's metadata. Those five ioctl commands are mostly common across all
filesystems but the whitelist may need to be further pruned in the
future.

https://bugzilla.kernel.org/show_bug.cgi?id=93691
https://launchpad.net/bugs/1305335

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Cc: Rocko <rockorequin@hotmail.com>
Cc: Colin Ian King <colin.king@canonical.com>
Cc: stable@vger.kernel.org # v2.6.36+: c43f7b8 eCryptfs: Handle ioctl calls with unlocked and compat functions
2015-03-03 02:03:56 -06:00
..
crypto.c Fixes for filename decryption and encrypted view plus a cleanup 2014-12-19 18:15:12 -08:00
debug.c
dentry.c
ecryptfs_kernel.h eCryptfs: ensure copy to crypt_stat->cipher does not overrun 2015-02-24 19:23:28 -06:00
file.c eCryptfs: don't pass fs-specific ioctl commands through 2015-03-03 02:03:56 -06:00
inode.c VFS: (Scripted) Convert S_ISLNK/DIR/REG(dentry->d_inode) to d_is_*(dentry) 2015-02-22 11:38:41 -05:00
Kconfig
keystore.c eCryptfs: ensure copy to crypt_stat->cipher does not overrun 2015-02-24 19:23:28 -06:00
kthread.c
main.c eCryptfs: ensure copy to crypt_stat->cipher does not overrun 2015-02-24 19:23:28 -06:00
Makefile
messaging.c
miscdev.c
mmap.c kill f_dentry uses 2014-11-19 13:01:25 -05:00
read_write.c
super.c