1. 04 1月, 2012 3 次提交
  2. 24 11月, 2011 1 次提交
    • T
      eCryptfs: Prevent file create race condition · b59db43a
      Tyler Hicks 提交于
      The file creation path prematurely called d_instantiate() and
      unlock_new_inode() before the eCryptfs inode info was fully
      allocated and initialized and before the eCryptfs metadata was written
      to the lower file.
      
      This could result in race conditions in subsequent file and inode
      operations leading to unexpected error conditions or a null pointer
      dereference while attempting to use the unallocated memory.
      
      https://launchpad.net/bugs/813146Signed-off-by: NTyler Hicks <tyhicks@canonical.com>
      Cc: stable@kernel.org
      b59db43a
  3. 02 11月, 2011 1 次提交
  4. 29 7月, 2011 1 次提交
  5. 20 7月, 2011 3 次提交
  6. 30 5月, 2011 4 次提交
  7. 28 5月, 2011 2 次提交
  8. 26 5月, 2011 2 次提交
  9. 26 4月, 2011 5 次提交
    • T
      eCryptfs: Flush dirty pages in setattr · 5be79de2
      Tyler Hicks 提交于
      After 57db4e8d changed eCryptfs to
      write-back caching, eCryptfs page writeback updates the lower inode
      times due to the use of vfs_write() on the lower file.
      
      To preserve inode metadata changes, such as 'cp -p' does with
      utimensat(), we need to flush all dirty pages early in
      ecryptfs_setattr() so that the user-updated lower inode metadata isn't
      clobbered later in writeback.
      
      https://bugzilla.kernel.org/show_bug.cgi?id=33372Reported-by: NRocko <rockorequin@hotmail.com>
      Signed-off-by: NTyler Hicks <tyhicks@linux.vnet.ibm.com>
      5be79de2
    • T
      eCryptfs: Handle failed metadata read in lookup · 3aeb86ea
      Tyler Hicks 提交于
      When failing to read the lower file's crypto metadata during a lookup,
      eCryptfs must continue on without throwing an error. For example, there
      may be a plaintext file in the lower mount point that the user wants to
      delete through the eCryptfs mount.
      
      If an error is encountered while reading the metadata in lookup(), the
      eCryptfs inode's size could be incorrect. We must be sure to reread the
      plaintext inode size from the metadata when performing an open() or
      setattr(). The metadata is already being read in those paths, so this
      adds minimal performance overhead.
      
      This patch introduces a flag which will track whether or not the
      plaintext inode size has been read so that an incorrect i_size can be
      fixed in the open() or setattr() paths.
      
      https://bugs.launchpad.net/bugs/509180
      
      Cc: <stable@kernel.org>
      Signed-off-by: NTyler Hicks <tyhicks@linux.vnet.ibm.com>
      3aeb86ea
    • T
      eCryptfs: Add reference counting to lower files · 332ab16f
      Tyler Hicks 提交于
      For any given lower inode, eCryptfs keeps only one lower file open and
      multiplexes all eCryptfs file operations through that lower file. The
      lower file was considered "persistent" and stayed open from the first
      lookup through the lifetime of the inode.
      
      This patch keeps the notion of a single, per-inode lower file, but adds
      reference counting around the lower file so that it is closed when not
      currently in use. If the reference count is at 0 when an operation (such
      as open, create, etc.) needs to use the lower file, a new lower file is
      opened. Since the file is no longer persistent, all references to the
      term persistent file are changed to lower file.
      
      Locking is added around the sections of code that opens the lower file
      and assign the pointer in the inode info, as well as the code the fputs
      the lower file when all eCryptfs users are done with it.
      
      This patch is needed to fix issues, when mounted on top of the NFSv3
      client, where the lower file is left silly renamed until the eCryptfs
      inode is destroyed.
      Signed-off-by: NTyler Hicks <tyhicks@linux.vnet.ibm.com>
      332ab16f
    • T
      eCryptfs: dput dentries returned from dget_parent · dd55c898
      Tyler Hicks 提交于
      Call dput on the dentries previously returned by dget_parent() in
      ecryptfs_rename(). This is needed for supported eCryptfs mounts on top
      of the NFSv3 client.
      Signed-off-by: NTyler Hicks <tyhicks@linux.vnet.ibm.com>
      dd55c898
    • T
      eCryptfs: Remove extra d_delete in ecryptfs_rmdir · 35ffa948
      Tyler Hicks 提交于
      vfs_rmdir() already calls d_delete() on the lower dentry. That was being
      duplicated in ecryptfs_rmdir() and caused a NULL pointer dereference
      when NFSv3 was the lower filesystem.
      Signed-off-by: NTyler Hicks <tyhicks@linux.vnet.ibm.com>
      35ffa948
  10. 28 3月, 2011 2 次提交
  11. 22 2月, 2011 2 次提交
  12. 18 2月, 2011 1 次提交
  13. 18 1月, 2011 1 次提交
  14. 13 1月, 2011 1 次提交
  15. 07 1月, 2011 4 次提交
  16. 29 10月, 2010 2 次提交
    • T
      eCryptfs: Clear LOOKUP_OPEN flag when creating lower file · 2e21b3f1
      Tyler Hicks 提交于
      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: NTyler Hicks <tyhicks@linux.vnet.ibm.com>
      2e21b3f1
    • R
      ecryptfs: call vfs_setxattr() in ecryptfs_setxattr() · 48b512e6
      Roberto Sassu 提交于
      Ecryptfs is a stackable filesystem which relies on lower filesystems the
      ability of setting/getting extended attributes.
      
      If there is a security module enabled on the system it updates the
      'security' field of inodes according to the owned extended attribute set
      with the function vfs_setxattr().  When this function is performed on a
      ecryptfs filesystem the 'security' field is not updated for the lower
      filesystem since the call security_inode_post_setxattr() is missing for
      the lower inode.
      Further, the call security_inode_setxattr() is missing for the lower inode,
      leading to policy violations in the security module because specific
      checks for this hook are not performed (i. e. filesystem
      'associate' permission on SELinux is not checked for the lower filesystem).
      
      This patch replaces the call of the setxattr() method of the lower inode
      in the function ecryptfs_setxattr() with vfs_setxattr().
      Signed-off-by: NRoberto Sassu <roberto.sassu@polito.it>
      Cc: stable <stable@kernel.org>
      Cc: Dustin Kirkland <kirkland@canonical.com>
      Acked-by: NJames Morris <jmorris@namei.org>
      Signed-off-by: NTyler Hicks <tyhicks@linux.vnet.ibm.com>
      48b512e6
  17. 27 8月, 2010 1 次提交
  18. 10 8月, 2010 2 次提交
    • C
      check ATTR_SIZE contraints in inode_change_ok · 2c27c65e
      Christoph Hellwig 提交于
      Make sure we check the truncate constraints early on in ->setattr by adding
      those checks to inode_change_ok.  Also clean up and document inode_change_ok
      to make this obvious.
      
      As a fallout we don't have to call inode_newsize_ok from simple_setsize and
      simplify it down to a truncate_setsize which doesn't return an error.  This
      simplifies a lot of setattr implementations and means we use truncate_setsize
      almost everywhere.  Get rid of fat_setsize now that it's trivial and mark
      ext2_setsize static to make the calling convention obvious.
      
      Keep the inode_newsize_ok in vmtruncate for now as all callers need an
      audit for its removal anyway.
      
      Note: setattr code in ecryptfs doesn't call inode_change_ok at all and
      needs a deeper audit, but that is left for later.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      2c27c65e
    • L
      ecryptfs: dont call lookup_one_len to avoid NULL nameidata · 21edad32
      Lino Sanfilippo 提交于
      I have encountered the same problem that Eric Sandeen described in
      this post
      
       http://lkml.org/lkml/fancy/2010/4/23/467
      
      while experimenting with stackable filesystems.
      
      The reason seems to be that ecryptfs calls lookup_one_len() to get the
      lower dentry, which in turn calls the lower parent dirs d_revalidate()
      with a NULL nameidata object.
      If ecryptfs is the underlaying filesystem, the NULL pointer dereference
      occurs, since ecryptfs is not prepared to handle a NULL nameidata.
      
      I know that this cant happen any more, since it is no longer allowed to
      mount ecryptfs upon itself.
      
      But maybe this patch it useful nevertheless, since the problem would still
      apply for an underlaying filesystem that implements d_revalidate() and is
      not prepared to handle a NULL nameidata (I dont know if there actually
      is such a fs).
      
      With this patch (against 2.6.35-rc5) ecryptfs uses the vfs_lookup_path()
      function instead of lookup_one_len() which ensures that the nameidata
      passed to the lower filesystems d_revalidate().
      Signed-off-by: NLino Sanfilippo <LinoSanfilippo@gmx.de>
      Signed-off-by: NTyler Hicks <tyhicks@linux.vnet.ibm.com>
      21edad32
  19. 09 8月, 2010 1 次提交
  20. 28 5月, 2010 1 次提交