Skip to content

Commit 2e21b3f

Browse files
author
Tyler Hicks
committed
eCryptfs: Clear LOOKUP_OPEN flag when creating lower file
eCryptfs was passing the LOOKUP_OPEN flag through to the lower file system, even though ecryptfs_create() doesn't support the flag. A valid filp for the lower filesystem could be returned in the nameidata if the lower file system's create() function supported LOOKUP_OPEN, possibly resulting in unencrypted writes to the lower file. However, this is only a potential problem in filesystems (FUSE, NFS, CIFS, CEPH, 9p) that eCryptfs isn't known to support today. https://bugs.launchpad.net/ecryptfs/+bug/641703 Reported-by: Kevin Buhr Cc: stable <stable@kernel.org> Signed-off-by: Tyler Hicks <tyhicks@linux.vnet.ibm.com>
1 parent 48b512e commit 2e21b3f

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎fs/ecryptfs/inode.c‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,19 @@ ecryptfs_create_underlying_file(struct inode *lower_dir_inode,
7171
struct vfsmount *lower_mnt = ecryptfs_dentry_to_lower_mnt(dentry);
7272
struct dentry *dentry_save;
7373
struct vfsmount *vfsmount_save;
74+
unsigned int flags_save;
7475
int rc;
7576

7677
dentry_save = nd->path.dentry;
7778
vfsmount_save = nd->path.mnt;
79+
flags_save = nd->flags;
7880
nd->path.dentry = lower_dentry;
7981
nd->path.mnt = lower_mnt;
82+
nd->flags &= ~LOOKUP_OPEN;
8083
rc = vfs_create(lower_dir_inode, lower_dentry, mode, nd);
8184
nd->path.dentry = dentry_save;
8285
nd->path.mnt = vfsmount_save;
86+
nd->flags = flags_save;
8387
return rc;
8488
}
8589

0 commit comments

Comments
 (0)