linux/fs/ecryptfs
Al Viro 25dcddef04 ecryptfs: fix handling of directory opening
[ Upstream commit 6a480a7842 ]

First of all, trying to open them r/w is idiocy; it's guaranteed to fail.
Moreover, assigning ->f_pos and assuming that everything will work is
blatantly broken - try that with e.g. tmpfs as underlying layer and watch
the fireworks.  There may be a non-trivial amount of state associated with
current IO position, well beyond the numeric offset.  Using the single
struct file associated with underlying inode is really not a good idea;
we ought to open one for each ecryptfs directory struct file.

Additionally, file_operations both for directories and non-directories are
full of pointless methods; non-directories should *not* have ->iterate(),
directories should not have ->flush(), ->fasync() and ->splice_read().

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-15 08:27:47 +02:00
..
crypto.c eCryptfs: Delete a check before the function call "key_put" 2015-08-18 17:29:49 -05:00
debug.c
dentry.c eCryptfs: Invalidate dcache entries when lower i_nlink is zero 2015-08-18 17:29:48 -05:00
ecryptfs_kernel.h KEYS: Merge the type-specific data with the payload data 2015-10-21 15:18:36 +01:00
file.c ecryptfs: fix handling of directory opening 2016-09-15 08:27:47 +02:00
inode.c fs: Drop unlikely before IS_ERR(_OR_NULL) 2015-09-29 15:13:58 +02:00
Kconfig
keystore.c
kthread.c Revert "ecryptfs: forbid opening files without mmap handler" 2016-08-10 11:49:27 +02:00
main.c
Makefile
messaging.c
miscdev.c
mmap.c treewide: Fix typo in printk 2015-08-07 13:58:05 +02:00
read_write.c
super.c