1. 25 7月, 2008 1 次提交
    • M
      eCryptfs: Privileged kthread for lower file opens · 746f1e55
      Michael Halcrow 提交于
      eCryptfs would really like to have read-write access to all files in the
      lower filesystem.  Right now, the persistent lower file may be opened
      read-only if the attempt to open it read-write fails.  One way to keep
      from having to do that is to have a privileged kthread that can open the
      lower persistent file on behalf of the user opening the eCryptfs file;
      this patch implements this functionality.
      
      This patch will properly allow a less-privileged user to open the eCryptfs
      file, followed by a more-privileged user opening the eCryptfs file, with
      the first user only being able to read and the second user being able to
      both read and write.  eCryptfs currently does this wrong; it will wind up
      calling vfs_write() on a file that was opened read-only.  This is fixed in
      this patch.
      Signed-off-by: NMichael Halcrow <mhalcrow@us.ibm.com>
      Cc: Dave Kleikamp <shaggy@austin.ibm.com>
      Cc: Serge Hallyn <serue@us.ibm.com>
      Cc: Eric Sandeen <sandeen@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      746f1e55
  2. 05 7月, 2008 1 次提交
  3. 03 7月, 2008 1 次提交
  4. 07 6月, 2008 1 次提交
    • M
      eCryptfs: remove unnecessary page decrypt call · d3e49afb
      Michael Halcrow 提交于
      The page decrypt calls in ecryptfs_write() are both pointless and buggy.
      Pointless because ecryptfs_get_locked_page() has already brought the page
      up to date, and buggy because prior mmap writes will just be blown away by
      the decrypt call.
      
      This patch also removes the declaration of a now-nonexistent function
      ecryptfs_write_zeros().
      
      Thanks to Eric Sandeen and David Kleikamp for helping to track this
      down.
      
      Eric said:
      
         fsx w/ mmap dies quickly ( < 100 ops) without this, and survives
         nicely (to millions of ops+) with it in place.
      Signed-off-by: NMichael Halcrow <mhalcrow@us.ibm.com>
      Cc: Eric Sandeen <sandeen@redhat.com>
      Cc: Dave Kleikamp <shaggy@austin.ibm.com>
      Cc: <stable@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d3e49afb
  5. 25 5月, 2008 1 次提交
  6. 22 5月, 2008 1 次提交
  7. 13 5月, 2008 2 次提交
  8. 29 4月, 2008 8 次提交
  9. 20 3月, 2008 1 次提交
  10. 05 3月, 2008 1 次提交
    • M
      eCryptfs: make ecryptfs_prepare_write decrypt the page · e4465fda
      Michael Halcrow 提交于
      When the page is not up to date, ecryptfs_prepare_write() should be
      acting much like ecryptfs_readpage(). This includes the painfully
      obvious step of actually decrypting the page contents read from the
      lower encrypted file.
      
      Note that this patch resolves a bug in eCryptfs in 2.6.24 that one can
      produce with these steps:
      
      # mount -t ecryptfs /secret /secret
      # echo "abc" > /secret/file.txt
      # umount /secret
      # mount -t ecryptfs /secret /secret
      # echo "def" >> /secret/file.txt
      # cat /secret/file.txt
      
      Without this patch, the resulting data returned from cat is likely to
      be something other than "abc\ndef\n".
      
      (Thanks to Benedikt Driessen for reporting this.)
      Signed-off-by: NMichael Halcrow <mhalcrow@us.ibm.com>
      Cc: Benedikt Driessen <bdriessen@escrypt.com>
      Cc: <stable@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      e4465fda
  11. 15 2月, 2008 2 次提交
  12. 07 2月, 2008 8 次提交
  13. 06 2月, 2008 1 次提交
    • C
      Pagecache zeroing: zero_user_segment, zero_user_segments and zero_user · eebd2aa3
      Christoph Lameter 提交于
      Simplify page cache zeroing of segments of pages through 3 functions
      
      zero_user_segments(page, start1, end1, start2, end2)
      
              Zeros two segments of the page. It takes the position where to
              start and end the zeroing which avoids length calculations and
      	makes code clearer.
      
      zero_user_segment(page, start, end)
      
              Same for a single segment.
      
      zero_user(page, start, length)
      
              Length variant for the case where we know the length.
      
      We remove the zero_user_page macro. Issues:
      
      1. Its a macro. Inline functions are preferable.
      
      2. The KM_USER0 macro is only defined for HIGHMEM.
      
         Having to treat this special case everywhere makes the
         code needlessly complex. The parameter for zeroing is always
         KM_USER0 except in one single case that we open code.
      
      Avoiding KM_USER0 makes a lot of code not having to be dealing
      with the special casing for HIGHMEM anymore. Dealing with
      kmap is only necessary for HIGHMEM configurations. In those
      configurations we use KM_USER0 like we do for a series of other
      functions defined in highmem.h.
      
      Since KM_USER0 is depends on HIGHMEM the existing zero_user_page
      function could not be a macro. zero_user_* functions introduced
      here can be be inline because that constant is not used when these
      functions are called.
      
      Also extract the flushing of the caches to be outside of the kmap.
      
      [akpm@linux-foundation.org: fix nfs and ntfs build]
      [akpm@linux-foundation.org: fix ntfs build some more]
      Signed-off-by: NChristoph Lameter <clameter@sgi.com>
      Cc: Steven French <sfrench@us.ibm.com>
      Cc: Michael Halcrow <mhalcrow@us.ibm.com>
      Cc: <linux-ext4@vger.kernel.org>
      Cc: Steven Whitehouse <swhiteho@redhat.com>
      Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
      Cc: "J. Bruce Fields" <bfields@fieldses.org>
      Cc: Anton Altaparmakov <aia21@cantab.net>
      Cc: Mark Fasheh <mark.fasheh@oracle.com>
      Cc: David Chinner <dgc@sgi.com>
      Cc: Michael Halcrow <mhalcrow@us.ibm.com>
      Cc: Steven French <sfrench@us.ibm.com>
      Cc: Steven Whitehouse <swhiteho@redhat.com>
      Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      eebd2aa3
  14. 29 1月, 2008 1 次提交
  15. 25 1月, 2008 8 次提交
  16. 09 1月, 2008 1 次提交
    • M
      eCryptfs: fix dentry handling on create error, unlink, and inode destroy · caeeeecf
      Michael Halcrow 提交于
      This patch corrects some erroneous dentry handling in eCryptfs.
      
      If there is a problem creating the lower file, then there is nothing that
      the persistent lower file can do to really help us.  This patch makes a
      vfs_create() failure in the lower filesystem always lead to an
      unconditional do_create failure in eCryptfs.
      
      Under certain sequences of operations, the eCryptfs dentry can remain in
      the dcache after an unlink.  This patch calls d_drop() on the eCryptfs
      dentry to correct this.
      
      eCryptfs has no business calling d_delete() directly on a lower
      filesystem's dentry.  This patch removes the call to d_delete() on the
      lower persistent file's dentry in ecryptfs_destroy_inode().
      
      (Thanks to David Kleikamp, Eric Sandeen, and Jeff Moyer for helping
      identify and resolve this issue)
      Signed-off-by: NMichael Halcrow <mhalcrow@us.ibm.com>
      Cc: Dave Kleikamp <shaggy@austin.ibm.com>
      Cc: Eric Sandeen <sandeen@redhat.com>
      Cc: Jeff Moyer <jmoyer@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      caeeeecf
  17. 24 12月, 2007 1 次提交