1. 30 11月, 2010 3 次提交
  2. 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
  3. 13 11月, 2010 1 次提交
  4. 11 11月, 2010 2 次提交
  5. 10 11月, 2010 1 次提交
  6. 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
  7. 06 11月, 2010 1 次提交
  8. 05 11月, 2010 2 次提交
  9. 03 11月, 2010 5 次提交
  10. 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
  11. 31 10月, 2010 2 次提交
  12. 29 10月, 2010 3 次提交
  13. 28 10月, 2010 1 次提交
  14. 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
  15. 25 10月, 2010 5 次提交
  16. 22 10月, 2010 1 次提交
  17. 21 10月, 2010 1 次提交
    • S
      cifs: convert cifs_tcp_ses_lock from a rwlock to a spinlock · 3f9bcca7
      Suresh Jayaraman 提交于
      cifs_tcp_ses_lock is a rwlock with protects the cifs_tcp_ses_list,
      server->smb_ses_list and the ses->tcon_list. It also protects a few
      ref counters in server, ses and tcon. In most cases the critical section
      doesn't seem to be large, in a few cases where it is slightly large, there
      seem to be really no benefit from concurrent access. I briefly considered RCU
      mechanism but it appears to me that there is no real need.
      
      Replace it with a spinlock and get rid of the last rwlock in the cifs code.
      Signed-off-by: NSuresh Jayaraman <sjayaraman@suse.de>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      3f9bcca7
  18. 20 10月, 2010 2 次提交