1. 07 12月, 2010 1 次提交
  2. 03 12月, 2010 1 次提交
    • S
      cifs: add attribute cache timeout (actimeo) tunable · 6d20e840
      Suresh Jayaraman 提交于
      Currently, the attribute cache timeout for CIFS is hardcoded to 1 second. This
      means that the client might have to issue a QPATHINFO/QFILEINFO call every 1
      second to verify if something has changes, which seems too expensive. On the
      other hand, if the timeout is hardcoded to a higher value, workloads that
      expect strict cache coherency might see unexpected results.
      
      Making attribute cache timeout as a tunable will allow us to make a tradeoff
      between performance and cache metadata correctness depending on the
      application/workload needs.
      
      Add 'actimeo' tunable that can be used to tune the attribute cache timeout.
      The default timeout is set to 1 second. Also, display actimeo option value in
      /proc/mounts.
      
      It appears to me that 'actimeo' and the proposed (but not yet merged)
      'strictcache' option cannot coexist, so care must be taken that we reset the
      other option if one of them is set.
      
      Changes since last post:
         - fix option parsing and handle possible values correcly
      Reviewed-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSuresh Jayaraman <sjayaraman@suse.de>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      6d20e840
  3. 01 12月, 2010 1 次提交
    • J
      cifs: fix parsing of hostname in dfs referrals · ba038648
      Jeff Layton 提交于
      The DFS referral parsing code does a memchr() call to find the '\\'
      delimiter that separates the hostname in the referral UNC from the
      sharename. It then uses that value to set the length of the hostname via
      pointer subtraction.  Instead of subtracting the start of the hostname
      however, it subtracts the start of the UNC, which causes the code to
      pass in a hostname length that is 2 bytes too long.
      
      Regression introduced in commit 1a4240f4.
      Reported-and-Tested-by: NRobbert Kouprie <robbert@exx.nl>
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Cc: Wang Lei <wang840925@gmail.com>
      Cc: David Howells <dhowells@redhat.com>
      Cc: stable@kernel.org
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      ba038648
  4. 30 11月, 2010 6 次提交
  5. 14 11月, 2010 1 次提交
    • S
      [CIFS] fs/cifs/Kconfig: CIFS depends on CRYPTO_HMAC · 362d3129
      Steve French 提交于
      linux-2.6.37-rc1: I compiled a kernel with CIFS which subsequently
      failed with an error indicating it couldn't initialize crypto module
      "hmacmd5".  CONFIG_CRYPTO_HMAC=y fixed the problem.
      
      This patch makes CIFS depend on CRYPTO_HMAC in kconfig.
      
      Signed-off-by: Jody Bruchon<jody@nctritech.com>
      CC: Shirish Pargaonkar <shirishp@us.ibm.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      362d3129
  6. 13 11月, 2010 1 次提交
  7. 11 11月, 2010 2 次提交
  8. 10 11月, 2010 1 次提交
  9. 09 11月, 2010 2 次提交
    • S
      cifs: fix a memleak in cifs_setattr_nounix() · 3565bd46
      Suresh Jayaraman 提交于
      Andrew Hendry reported a kmemleak warning in 2.6.37-rc1 while editing a
      text file with gedit over cifs.
      
      unreferenced object 0xffff88022ee08b40 (size 32):
        comm "gedit", pid 2524, jiffies 4300160388 (age 2633.655s)
        hex dump (first 32 bytes):
          5c 2e 67 6f 75 74 70 75 74 73 74 72 65 61 6d 2d  \.goutputstream-
          35 42 41 53 4c 56 00 de 09 00 00 00 2c 26 78 ee  5BASLV......,&x.
        backtrace:
          [<ffffffff81504a4d>] kmemleak_alloc+0x2d/0x60
          [<ffffffff81136e13>] __kmalloc+0xe3/0x1d0
          [<ffffffffa0313db0>] build_path_from_dentry+0xf0/0x230 [cifs]
          [<ffffffffa031ae1e>] cifs_setattr+0x9e/0x770 [cifs]
          [<ffffffff8115fe90>] notify_change+0x170/0x2e0
          [<ffffffff81145ceb>] sys_fchmod+0x10b/0x140
          [<ffffffff8100c172>] system_call_fastpath+0x16/0x1b
          [<ffffffffffffffff>] 0xffffffffffffffff
      
      The commit 1025774c that removed inode_setattr() seems to have introduced this
      memleak by returning early without freeing 'full_path'.
      Reported-by: NAndrew Hendry <andrew.hendry@gmail.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Reviewed-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSuresh Jayaraman <sjayaraman@suse.de>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      3565bd46
    • J
      cifs: make cifs_ioctl handle NULL filp->private_data correctly · 61876395
      Jeff Layton 提交于
      Commit 13cfb733 made cifs_ioctl use the tlink attached to the
      cifsFileInfo for a filp. This ignores the case of an open directory
      however, which in CIFS can have a NULL private_data until a readdir
      is done on it.
      
      This patch re-adds the NULL pointer checks that were removed in commit
      50ae28f0 and moves the setting of tcon and "caps" variables lower.
      
      Long term, a better fix would be to establish a f_op->open routine for
      directories that populates that field at open time, but that requires
      some other changes to how readdir calls are handled.
      Reported-by: NKjell Rune Skaaraas <kjella79@yahoo.no>
      Reviewed-and-Tested-by: NSuresh Jayaraman <sjayaraman@suse.de>
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      61876395
  10. 06 11月, 2010 1 次提交
  11. 05 11月, 2010 2 次提交
  12. 03 11月, 2010 5 次提交
  13. 02 11月, 2010 1 次提交
    • J
      FS: cifs, remove unneeded NULL tests · 50ae28f0
      Jiri Slaby 提交于
      Stanse found that pSMBFile in cifs_ioctl and file->f_path.dentry in
      cifs_user_write are dereferenced prior their test to NULL.
      
      The alternative is not to dereference them before the tests. The patch is
      to point out the problem, you have to decide.
      
      While at it we cache the inode in cifs_user_write to a local variable
      and use all over the function.
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Cc: Steve French <sfrench@samba.org>
      Cc: linux-cifs@vger.kernel.org
      Cc: Jeff Layton <jlayton@redhat.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      50ae28f0
  14. 31 10月, 2010 2 次提交
  15. 29 10月, 2010 3 次提交
  16. 28 10月, 2010 1 次提交
  17. 27 10月, 2010 6 次提交
    • S
      NTLM auth and sign - minor error corrections and cleanup · f7c5445a
      Shirish Pargaonkar 提交于
      Minor cleanup - Fix spelling mistake, make meaningful (goto) label
      
      In function setup_ntlmv2_rsp(), do not return 0 and leak memory,
      let the tiblob get freed.
      
      For function find_domain_name(), pass already available nls table pointer
      instead of loading and unloading the table again in this function.
      
      For ntlmv2, the case sensitive password length is the length of the
      response, so subtract session key length (16 bytes) from the .len.
      Signed-off-by: NShirish Pargaonkar <shirishpargaonkar@gmail.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      f7c5445a
    • W
      writeback: remove nonblocking/encountered_congestion references · 1b430bee
      Wu Fengguang 提交于
      This removes more dead code that was somehow missed by commit 0d99519e
      (writeback: remove unused nonblocking and congestion checks).  There are
      no behavior change except for the removal of two entries from one of the
      ext4 tracing interface.
      
      The nonblocking checks in ->writepages are no longer used because the
      flusher now prefer to block on get_request_wait() than to skip inodes on
      IO congestion.  The latter will lead to more seeky IO.
      
      The nonblocking checks in ->writepage are no longer used because it's
      redundant with the WB_SYNC_NONE check.
      
      We no long set ->nonblocking in VM page out and page migration, because
      a) it's effectively redundant with WB_SYNC_NONE in current code
      b) it's old semantic of "Don't get stuck on request queues" is mis-behavior:
         that would skip some dirty inodes on congestion and page out others, which
         is unfair in terms of LRU age.
      
      Inspired by Christoph Hellwig. Thanks!
      Signed-off-by: NWu Fengguang <fengguang.wu@intel.com>
      Cc: Theodore Ts'o <tytso@mit.edu>
      Cc: David Howells <dhowells@redhat.com>
      Cc: Sage Weil <sage@newdream.net>
      Cc: Steve French <sfrench@samba.org>
      Cc: Chris Mason <chris.mason@oracle.com>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: Christoph Hellwig <hch@infradead.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      1b430bee
    • S
      NTLM auth and sign - Use kernel crypto apis to calculate hashes and smb signatures · 307fbd31
      Shirish Pargaonkar 提交于
      Use kernel crypto sync hash apis insetead of cifs crypto functions.
      The calls typically corrospond one to one except that insead of
      key init, setkey is used.
      
      Use crypto apis to generate smb signagtures also.
      Use hmac-md5 to genereate ntlmv2 hash, ntlmv2 response, and HMAC (CR1 of
      ntlmv2 auth blob.
      User crypto apis to genereate signature and to verify signature.
      md5 hash is used to calculate signature.
      Use secondary key to calculate signature in case of ntlmssp.
      
      For ntlmv2 within ntlmssp, during signature calculation, only 16 bytes key
      (a nonce) stored within session key is used. during smb signature calculation.
      For ntlm and ntlmv2 without extended security, 16 bytes key
      as well as entire response (24 bytes in case of ntlm and variable length
      in case of ntlmv2) is used for smb signature calculation.
      For kerberos, there is no distinction between key and response.
      Acked-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NShirish Pargaonkar <shirishpargaonkar@gmail.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      307fbd31
    • S
      NTLM auth and sign - Define crypto hash functions and create and send keys needed for key exchange · d2b91521
      Shirish Pargaonkar 提交于
      Mark dependency on crypto modules in Kconfig.
      
      Defining per structures sdesc and cifs_secmech which are used to store
      crypto hash functions and contexts.  They are stored per smb connection
      and used for all auth mechs to genereate hash values and signatures.
      
      Allocate crypto hashing functions, security descriptiors, and respective
      contexts when a smb/tcp connection is established.
      Release them when a tcp/smb connection is taken down.
      
      md5 and hmac-md5 are two crypto hashing functions that are used
      throught the life of an smb/tcp connection by various functions that
      calcualte signagure and ntlmv2 hash, HMAC etc.
      
      structure ntlmssp_auth is defined as per smb connection.
      
      ntlmssp_auth holds ciphertext which is genereated by rc4/arc4 encryption of
      secondary key, a nonce using ntlmv2 session key and sent in the session key
      field of the type 3 message sent by the client during ntlmssp
      negotiation/exchange
      
      A key is exchanged with the server if client indicates so in flags in
      type 1 messsage and server agrees in flag in type 2 message of ntlmssp
      negotiation.  If both client and agree, a key sent by client in
      type 3 message of ntlmssp negotiation in the session key field.
      The key is a ciphertext generated off of secondary key, a nonce, using
      ntlmv2 hash via rc4/arc4.
      
      Signing works for ntlmssp in this patch. The sequence number within
      the server structure needs to be zero until session is established
      i.e. till type 3 packet of ntlmssp exchange of a to be very first
      smb session on that smb connection is sent.
      Acked-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NShirish Pargaonkar <shirishpargaonkar@gmail.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      d2b91521
    • D
      cifs: cifs_convert_address() returns zero on error · b235f371
      Dan Carpenter 提交于
      The cifs_convert_address() returns zero on error but this caller is
      testing for negative returns.
      
      Btw. "i" is unsigned here, so it's never negative.
      Reviewed-by: NJeff Layton <jlayton@samba.org>
      Signed-off-by: NDan Carpenter <error27@gmail.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      b235f371
    • S
      NTLM auth and sign - Allocate session key/client response dynamically · 21e73393
      Shirish Pargaonkar 提交于
      Start calculating auth response within a session.  Move/Add pertinet
      data structures like session key, server challenge and ntlmv2_hash in
      a session structure.  We should do the calculations within a session
      before copying session key and response over to server data
      structures because a session setup can fail.
      
      Only after a very first smb session succeeds, it copy/make its
      session key, session key of smb connection.  This key stays with
      the smb connection throughout its life.
      sequence_number within server is set to 0x2.
      
      The authentication Message Authentication Key (mak) which consists
      of session key followed by client response within structure session_key
      is now dynamic.  Every authentication type allocates the key + response
      sized memory within its session structure and later either assigns or
      frees it once the client response is sent and if session's session key
      becomes connetion's session key.
      
      ntlm/ntlmi authentication functions are rearranged.  A function
      named setup_ntlm_resp(), similar to setup_ntlmv2_resp(), replaces
      function cifs_calculate_session_key().
      
      size of CIFS_SESS_KEY_SIZE is changed to 16, to reflect the byte size
      of the key it holds.
      Reviewed-by: NJeff Layton <jlayton@samba.org>
      Signed-off-by: NShirish Pargaonkar <shirishpargaonkar@gmail.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      21e73393
  18. 25 10月, 2010 3 次提交