1. 10 8月, 2010 2 次提交
  2. 02 8月, 2010 2 次提交
  3. 23 7月, 2010 1 次提交
    • D
      CIFS: Fix a malicious redirect problem in the DNS lookup code · 4c0c03ca
      David Howells 提交于
      Fix the security problem in the CIFS filesystem DNS lookup code in which a
      malicious redirect could be installed by a random user by simply adding a
      result record into one of their keyrings with add_key() and then invoking a
      CIFS CFS lookup [CVE-2010-2524].
      
      This is done by creating an internal keyring specifically for the caching of
      DNS lookups.  To enforce the use of this keyring, the module init routine
      creates a set of override credentials with the keyring installed as the thread
      keyring and instructs request_key() to only install lookup result keys in that
      keyring.
      
      The override is then applied around the call to request_key().
      
      This has some additional benefits when a kernel service uses this module to
      request a key:
      
       (1) The result keys are owned by root, not the user that caused the lookup.
      
       (2) The result keys don't pop up in the user's keyrings.
      
       (3) The result keys don't come out of the quota of the user that caused the
           lookup.
      
      The keyring can be viewed as root by doing cat /proc/keys:
      
      2a0ca6c3 I-----     1 perm 1f030000     0     0 keyring   .dns_resolver: 1/4
      
      It can then be listed with 'keyctl list' by root.
      
      	# keyctl list 0x2a0ca6c3
      	1 key in keyring:
      	726766307: --alswrv     0     0 dns_resolver: foo.bar.com
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Reviewed-and-Tested-by: NJeff Layton <jlayton@redhat.com>
      Acked-by: NSteve French <smfrench@gmail.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      4c0c03ca
  4. 12 6月, 2010 1 次提交
    • J
      cifs: implement drop_inode superblock op · 12420ac3
      Jeff Layton 提交于
      The standard behavior for drop_inode is to delete the inode when the
      last reference to it is put and the nlink count goes to 0. This helps
      keep inodes that are still considered "not deleted" in cache as long as
      possible even when there aren't dentries attached to them.
      
      When server inode numbers are disabled, it's not possible for cifs_iget
      to ever match an existing inode (since inode numbers are generated via
      iunique). In this situation, cifs can keep a lot of inodes in cache that
      will never be used again.
      
      Implement a drop_inode routine that deletes the inode if server inode
      numbers are disabled on the mount. This helps keep the cifs inode
      caches down to a more manageable size when server inode numbers are
      disabled.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      12420ac3
  5. 12 5月, 2010 1 次提交
  6. 06 5月, 2010 1 次提交
  7. 27 4月, 2010 2 次提交
  8. 22 4月, 2010 1 次提交
  9. 21 4月, 2010 1 次提交
    • J
      [CIFS] Neaten cERROR and cFYI macros, reduce text space · b6b38f70
      Joe Perches 提交于
      Neaten cERROR and cFYI macros, reduce text space
      ~2.5K
      
      Convert '__FILE__ ": " fmt' to '"%s: " fmt', __FILE__' to save text space
      Surround macros with do {} while
      Add parentheses to macros
      Make statement expression macro from macro with assign
      Remove now unnecessary parentheses from cFYI and cERROR uses
      
      defconfig with CIFS support old
      $ size fs/cifs/built-in.o
         text	   data	    bss	    dec	    hex	filename
       156012	   1760	    148	 157920	  268e0	fs/cifs/built-in.o
      
      defconfig with CIFS support old
      $ size fs/cifs/built-in.o
         text	   data	    bss	    dec	    hex	filename
       153508	   1760	    148	 155416	  25f18	fs/cifs/built-in.o
      
      allyesconfig old:
      $ size fs/cifs/built-in.o
         text	   data	    bss	    dec	    hex	filename
       309138	   3864	  74824	 387826	  5eaf2	fs/cifs/built-in.o
      
      allyesconfig new
      $ size fs/cifs/built-in.o
         text	   data	    bss	    dec	    hex	filename
       305655	   3864	  74824	 384343	  5dd57	fs/cifs/built-in.o
      Signed-off-by: NJoe Perches <joe@perches.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      b6b38f70
  10. 27 3月, 2010 1 次提交
  11. 10 3月, 2010 1 次提交
  12. 06 3月, 2010 1 次提交
    • J
      cifs: overhaul cifs_revalidate and rename to cifs_revalidate_dentry · df2cf170
      Jeff Layton 提交于
      cifs_revalidate is renamed to cifs_revalidate_dentry as a later patch
      will add a by-filehandle variant.
      
      Add a new "invalid_mapping" flag to the cifsInodeInfo that indicates
      that the pagecache is considered invalid. Add a new routine to check
      inode attributes whenever they're updated and set that flag if the inode
      has changed on the server.
      
      cifs_revalidate_dentry is then changed to just update the attrcache if
      needed and then to zap the pagecache if it's not valid.
      
      There are some other behavior changes in here as well. Open files are
      now allowed to have their caches invalidated. I see no reason why we'd
      want to keep stale data around just because a file is open. Also,
      cifs_revalidate_cache uses the server_eof for revalidating the file
      size since that should more closely match the size of the file on the
      server.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      df2cf170
  13. 07 12月, 2009 1 次提交
  14. 21 11月, 2009 1 次提交
    • D
      SLOW_WORK: Fix CIFS to pass THIS_MODULE to slow_work_register_user() · 0109d7e6
      David Howells 提交于
      As of the patch:
      
      	SLOW_WORK: Wait for outstanding work items belonging to a module to clear
      
      	Wait for outstanding slow work items belonging to a module to clear
      	when unregistering that module as a user of the facility.  This
      	prevents the put_ref code of a work item from being taken away before
      	it returns.
      
      slow_work_register_user() takes a module pointer as an argument.  CIFS must now
      pass THIS_MODULE as that argument, lest the following error be observed:
      
      	fs/cifs/cifsfs.c: In function 'init_cifs':
      	fs/cifs/cifsfs.c:1040: error: too few arguments to function 'slow_work_register_user'
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      0109d7e6
  15. 25 9月, 2009 2 次提交
    • S
      0f59e61c
    • J
      cifs: convert oplock breaks to use slow_work facility (try #4) · 3bc303c2
      Jeff Layton 提交于
      This is the fourth respin of the patch to convert oplock breaks to
      use the slow_work facility.
      
      A customer of ours was testing a backport of one of the earlier
      patchsets, and hit a "Busy inodes after umount..." problem. An oplock
      break job had raced with a umount, and the superblock got torn down and
      its memory reused. When the oplock break job tried to dereference the
      inode->i_sb, the kernel oopsed.
      
      This patchset has the oplock break job hold an inode and vfsmount
      reference until the oplock break completes.  With this, there should be
      no need to take a tcon reference (the vfsmount implicitly holds one
      already).
      
      Currently, when an oplock break comes in there's a chance that the
      oplock break job won't occur if the allocation of the oplock_q_entry
      fails. There are also some rather nasty races in the allocation and
      handling these structs.
      
      Rather than allocating oplock queue entries when an oplock break comes
      in, add a few extra fields to the cifsFileInfo struct. Get rid of the
      dedicated cifs_oplock_thread as well and queue the oplock break job to
      the slow_work thread pool.
      
      This approach also has the advantage that the oplock break jobs can
      potentially run in parallel rather than be serialized like they are
      today.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      3bc303c2
  16. 24 9月, 2009 1 次提交
    • T
      fs: Make unload_nls() NULL pointer safe · 6d729e44
      Thomas Gleixner 提交于
      Most call sites of unload_nls() do:
      	if (nls)
      		unload_nls(nls);
      
      Check the pointer inside unload_nls() like we do in kfree() and
      simplify the call sites.
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Steve French <sfrench@us.ibm.com>
      Cc: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
      Cc: Roman Zippel <zippel@linux-m68k.org>
      Cc: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
      Cc: Petr Vandrovec <vandrove@vc.cvut.cz>
      Cc: Anton Altaparmakov <aia21@cantab.net>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      6d729e44
  17. 22 9月, 2009 1 次提交
  18. 02 9月, 2009 2 次提交
  19. 04 8月, 2009 1 次提交
  20. 10 7月, 2009 1 次提交
  21. 26 6月, 2009 1 次提交
    • S
      [CIFS] remove bkl usage from umount begin · ad8034f1
      Steve French 提交于
      The lock_kernel call moved into the fs for umount_begin
      is not needed.  This adds a check to make sure we don't
      call umount_begin twice on the same fs.
      
      umount_begin for cifs is probably not needed and
      may eventually be able to be removed, but in
      the meantime this smaller patch is safe and
      gets rid of the bkl from this path which provides
      some benefit.
      
      Acked-by: Jeff Layton <redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      ad8034f1
  22. 25 6月, 2009 1 次提交
  23. 15 6月, 2009 1 次提交
  24. 13 6月, 2009 2 次提交
  25. 12 6月, 2009 1 次提交
    • C
      push BKL down into ->put_super · 6cfd0148
      Christoph Hellwig 提交于
      Move BKL into ->put_super from the only caller.  A couple of
      filesystems had trivial enough ->put_super (only kfree and NULLing of
      s_fs_info + stuff in there) to not get any locking: coda, cramfs, efs,
      hugetlbfs, omfs, qnx4, shmem, all others got the full treatment.  Most
      of them probably don't need it, but I'd rather sort that out individually.
      Preferably after all the other BKL pushdowns in that area.
      
      [AV: original used to move lock_super() down as well; these changes are
      removed since we don't do lock_super() at all in generic_shutdown_super()
      now]
      [AV: fuse, btrfs and xfs are known to need no damn BKL, exempt]
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      6cfd0148
  26. 28 5月, 2009 1 次提交
  27. 09 5月, 2009 2 次提交
  28. 17 4月, 2009 2 次提交
    • J
      cifs: remove dnotify thread code · 5144ebf4
      Jeff Layton 提交于
      cifs: remove dnotify thread code
      
      Al Viro recently removed the dir_notify code from the kernel along with
      the CIFS code that used it. We can also get rid of the dnotify thread
      as well.
      
      In actuality, it never had anything to do with dir_notify anyway. All
      it did was unnecessarily wake up all the tasks waiting on the response
      queues every 15s. Previously that happened to prevent tasks from hanging
      indefinitely when the server went unresponsive, but we put those to
      sleep with proper timeouts now so there's no reason to keep this around.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      5144ebf4
    • J
      cifs: vary timeout on writes past EOF based on offset (try #5) · fbec9ab9
      Jeff Layton 提交于
      This is the fourth version of this patch:
      
      The first three generated a compiler warning asking for explicit curly
      braces.
      
      The first two didn't handle update the size correctly when writes that
      didn't start at the eof were done.
      
      The first patch also didn't update the size correctly when it explicitly
      set via truncate().
      
      This patch adds code to track the client's current understanding of the
      size of the file on the server separate from the i_size, and then to use
      this info to semi-intelligently set the timeout for writes past the EOF.
      
      This helps prevent timeouts when trying to write large, sparse files on
      windows servers.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      fbec9ab9
  29. 28 3月, 2009 1 次提交
  30. 01 1月, 2009 1 次提交
    • A
      kill ->dir_notify() · 6badd79b
      Al Viro 提交于
      Remove the hopelessly misguided ->dir_notify().  The only instance (cifs)
      has been broken by design from the very beginning; the objects it creates
      are never destroyed, keep references to struct file they can outlive, nothing
      that could possibly evict them exists on close(2) path *and* no locking
      whatsoever is done to prevent races with close(), should the previous, er,
      deficiencies someday be dealt with.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      6badd79b
  31. 29 12月, 2008 1 次提交
  32. 26 12月, 2008 1 次提交