linux-uconsole/fs/ecryptfs
Tyler Hicks ad54262e86 eCryptfs: Properly check for O_RDONLY flag before doing privileged open
commit 9fe79d7600 upstream.

If the first attempt at opening the lower file read/write fails,
eCryptfs will retry using a privileged kthread. However, the privileged
retry should not happen if the lower file's inode is read-only because a
read/write open will still be unsuccessful.

The check for determining if the open should be retried was intended to
be based on the access mode of the lower file's open flags being
O_RDONLY, but the check was incorrectly performed. This would cause the
open to be retried by the privileged kthread, resulting in a second
failed open of the lower file. This patch corrects the check to
determine if the open request should be handled by the privileged
kthread.

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-16 08:47:50 -07:00
..
crypto.c eCryptfs: Fix oops when printing debug info in extent crypto functions 2012-02-03 09:18:51 -08:00
debug.c eCryptfs: update comment and debug statement 2007-10-16 09:43:11 -07:00
dentry.c eCryptfs: Handle NULL nameidata pointers 2011-02-21 14:45:57 -06:00
ecryptfs_kernel.h eCryptfs: Remove ecryptfs_header_cache_2 2011-05-29 14:24:25 -05:00
file.c eCryptfs: Flush file in vma close 2011-12-09 08:52:18 -08:00
inode.c eCryptfs: Copy up lower inode attrs after setting lower xattr 2012-02-29 16:33:41 -08:00
Kconfig eCryptfs: Remove Kconfig NET dependency and select MD5 2009-10-08 11:31:36 -05:00
keystore.c eCryptfs: Unlock keys needed by ecryptfsd 2011-08-04 21:58:39 -07:00
kthread.c eCryptfs: Properly check for O_RDONLY flag before doing privileged open 2012-07-16 08:47:50 -07:00
main.c Ecryptfs: Add mount option to check uid of device being mounted = expect uid 2011-08-15 18:31:41 -07:00
Makefile eCryptfs: remove netlink transport 2008-10-16 11:21:39 -07:00
messaging.c ecryptfs: properly mark init functions 2010-08-27 10:50:52 -05:00
miscdev.c eCryptfs: Fix lockdep warning in miscdev operations 2012-07-16 08:47:49 -07:00
mmap.c eCryptfs: Unlock page in write_begin error path 2011-03-28 01:47:46 -05:00
read_write.c eCryptfs: Infinite loop due to overflow in ecryptfs_write() 2012-02-13 11:06:09 -08:00
super.c eCryptfs: Consolidate inode functions into inode.c 2011-05-29 12:49:53 -05:00