1. 01 8月, 2011 1 次提交
  2. 27 5月, 2011 4 次提交
  3. 26 5月, 2011 1 次提交
  4. 23 5月, 2011 2 次提交
  5. 19 5月, 2011 6 次提交
    • J
      cifs: keep BCC in little-endian format · 820a803f
      Jeff Layton 提交于
      This is the same patch as originally posted, just with some merge
      conflicts fixed up...
      
      Currently, the ByteCount is usually converted to host-endian on receive.
      This is confusing however, as we need to keep two sets of routines for
      accessing it, and keep track of when to use each routine. Munging
      received packets like this also limits when the signature can be
      calulated.
      
      Simplify the code by keeping the received ByteCount in little-endian
      format. This allows us to eliminate a set of routines for accessing it
      and we can now drop the *_le suffixes from the accessor functions since
      that's now implied.
      
      While we're at it, switch all of the places that read the ByteCount
      directly to use the get_bcc inline which should also clean up some
      unaligned accesses.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      820a803f
    • S
      consistently use smb_buf_length as be32 for cifs (try 3) · be8e3b00
      Steve French 提交于
             There is one big endian field in the cifs protocol, the RFC1001
             length, which cifs code (unlike in the smb2 code) had been handling as
             u32 until the last possible moment, when it was converted to be32 (its
             native form) before sending on the wire.   To remove the last sparse
             endian warning, and to make this consistent with the smb2
             implementation  (which always treats the fields in their
             native size and endianness), convert all uses of smb_buf_length to
             be32.
      
             This version incorporates Christoph's comment about
             using be32_add_cpu, and fixes a typo in the second
             version of the patch.
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      Signed-off-by: NPavel Shilovsky <piastry@etersoft.ru>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      be8e3b00
    • J
      cifs: fix comment in validate_t2 · fd5707e1
      Jeff Layton 提交于
      The comment about checking the bcc is in the wrong place. Also make it
      match kernel coding style.
      Reported-and-acked-by: NDavid Howells <dhowells@redhat.com>
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      fd5707e1
    • S
      cifs: cleanup: Rename and remove config flags · 25720873
      Shirish Pargaonkar 提交于
      Remove config flag CIFS_EXPERIMENTAL.
      Do export operations under new config flag CIFS_NFSD_EXPORT
      Signed-off-by: NShirish Pargaonkar <shirishpargaonkar@gmail.com>
      Reviewed-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      25720873
    • S
      Don't compile in unused reparse point symlink code · c52a9554
      Steve French 提交于
      Recent Windows versions now create symlinks more frequently
      and they do use this "reparse point" symlink mechanism.  We can of course
      do symlinks nicely to Samba and other servers which support the
      CIFS Unix Extensions and we can also do SFU symlinks and "client only"
      "MF" symlinks optionally, but for recent Windows we currently can not
      handle the common "reparse point" symlinks fully, removing the caller
      for this. We will need to extend and reenable this "reparse point" worker
      code in cifs and fix cifs_symlink to call this.  In the interim this code
      has been moved to its own config option so it is not compiled in by default
      until cifs_symlink fixed up (and tested) to use this.
      
      CC: Jeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      c52a9554
    • S
      Remove unused CIFSSMBNotify worker function · 0eff0e26
      Steve French 提交于
      The CIFSSMBNotify worker is unused, pending changes to allow it to be called
      via inotify, so move it into its own experimental config option so it does
      not get built in, until the necessary VFS support is fixed.  It used to
      be used in dnotify, but according to Jeff, inotify needs minor changes
      before we can reenable this.
      
      CC: Jeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      0eff0e26
  6. 12 4月, 2011 2 次提交
    • S
      [CIFS] cifs: clarify the meaning of tcpStatus == CifsGood · fd88ce93
      Steve French 提交于
      When the TCP_Server_Info is first allocated and connected, tcpStatus ==
      CifsGood means that the NEGOTIATE_PROTOCOL request has completed and the
      socket is ready for other calls. cifs_reconnect however sets tcpStatus
      to CifsGood as soon as the socket is reconnected and the optional
      RFC1001 session setup is done. We have no clear way to tell the
      difference between these two states, and we need to know this in order
      to know whether we can send an echo or not.
      
      Resolve this by adding a new statusEnum value -- CifsNeedNegotiate. When
      the socket has been connected but has not yet had a NEGOTIATE_PROTOCOL
      request done, set it to this value. Once the NEGOTIATE is done,
      cifs_negotiate_protocol will set tcpStatus to CifsGood.
      
      This also fixes and cleans the logic in cifs_reconnect and
      cifs_reconnect_tcon. The old code checked for specific states when what
      it really wants to know is whether the state has actually changed from
      CifsNeedReconnect.
      Reported-and-Tested-by: NJG <jg@cms.ac>
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      fd88ce93
    • S
      various endian fixes to cifs · 5443d130
      Steve French 提交于
      make modules C=2 M=fs/cifs CF=-D__CHECK_ENDIAN__
      
      Found for example:
      
       CHECK   fs/cifs/cifssmb.c
      fs/cifs/cifssmb.c:728:22: warning: incorrect type in assignment (different base types)
      fs/cifs/cifssmb.c:728:22:    expected unsigned short [unsigned] [usertype] Tid
      fs/cifs/cifssmb.c:728:22:    got restricted __le16 [usertype] <noident>
      fs/cifs/cifssmb.c:1883:45: warning: incorrect type in assignment (different base types)
      fs/cifs/cifssmb.c:1883:45:    expected long long [signed] [usertype] fl_start
      fs/cifs/cifssmb.c:1883:45:    got restricted __le64 [usertype] start
      fs/cifs/cifssmb.c:1884:54: warning: restricted __le64 degrades to integer
      fs/cifs/cifssmb.c:1885:58: warning: restricted __le64 degrades to integer
      fs/cifs/cifssmb.c:1886:43: warning: incorrect type in assignment (different base types)
      fs/cifs/cifssmb.c:1886:43:    expected unsigned int [unsigned] fl_pid
      fs/cifs/cifssmb.c:1886:43:    got restricted __le32 [usertype] pid
      
      In checking new smb2 code for missing endian conversions, I noticed
      some endian errors had crept in over the last few releases into the
      cifs code (symlink, ntlmssp, posix lock, and also a less problematic warning
      in fscache).  A followon patch will address a few smb2 endian
      problems.
      Reviewed-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      5443d130
  7. 31 3月, 2011 1 次提交
  8. 08 2月, 2011 1 次提交
  9. 31 1月, 2011 1 次提交
    • J
      cifs: clean up some compiler warnings · 31c2659d
      Jeff Layton 提交于
      New compiler warnings that I noticed when building a patchset based
      on recent Fedora kernel:
      
      fs/cifs/cifssmb.c: In function 'CIFSSMBSetFileSize':
      fs/cifs/cifssmb.c:4813:8: warning: variable 'data_offset' set but not used
      [-Wunused-but-set-variable]
      
      fs/cifs/file.c: In function 'cifs_open':
      fs/cifs/file.c:349:24: warning: variable 'pCifsInode' set but not used
      [-Wunused-but-set-variable]
      fs/cifs/file.c: In function 'cifs_partialpagewrite':
      fs/cifs/file.c:1149:23: warning: variable 'cifs_sb' set but not used
      [-Wunused-but-set-variable]
      fs/cifs/file.c: In function 'cifs_iovec_write':
      fs/cifs/file.c:1740:9: warning: passing argument 6 of 'CIFSSMBWrite2' from
      incompatible pointer type [enabled by default]
      fs/cifs/cifsproto.h:337:12: note: expected 'unsigned int *' but argument is
      of type 'size_t *'
      
      fs/cifs/readdir.c: In function 'cifs_readdir':
      fs/cifs/readdir.c:767:23: warning: variable 'cifs_sb' set but not used
      [-Wunused-but-set-variable]
      
      fs/cifs/cifs_dfs_ref.c: In function 'cifs_dfs_d_automount':
      fs/cifs/cifs_dfs_ref.c:342:2: warning: 'rc' may be used uninitialized in
      this function [-Wuninitialized]
      fs/cifs/cifs_dfs_ref.c:278:6: note: 'rc' was declared here
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Reviewed-by: NPavel Shilovsky <piastry@etersoft.ru>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      31c2659d
  10. 21 1月, 2011 6 次提交
  11. 20 1月, 2011 1 次提交
    • P
      CIFS: Fix oplock break handling (try #2) · 12fed00d
      Pavel Shilovsky 提交于
      When we get oplock break notification we should set the appropriate
      value of OplockLevel field in oplock break acknowledge according to
      the oplock level held by the client in this time. As we only can have
      level II oplock or no oplock in the case of oplock break, we should be
      aware only about clientCanCacheRead field in cifsInodeInfo structure.
      
      Also fix bug connected with wrong interpretation of OplockLevel field
      during oplock break notification processing.
      Signed-off-by: NPavel Shilovsky <piastryyy@gmail.com>
      Cc: <stable@kernel.org>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      12fed00d
  12. 10 1月, 2011 1 次提交
  13. 07 12月, 2010 1 次提交
  14. 29 10月, 2010 1 次提交
    • S
      NTLM auth and sign - Use appropriate server challenge · d3ba50b1
      Shirish Pargaonkar 提交于
      Need to have cryptkey or server challenge in smb connection
      (struct TCP_Server_Info) for ntlm and ntlmv2 auth types for which
      cryptkey (Encryption Key) is supplied just once in Negotiate Protocol
      response during an smb connection setup for all the smb sessions over
      that smb connection.
      
      For ntlmssp, cryptkey or server challenge is provided for every
      smb session in type 2 packet of ntlmssp negotiation, the cryptkey
      provided during Negotiation Protocol response before smb connection
      does not count.
      
      Rename cryptKey to cryptkey and related changes.
      Signed-off-by: NShirish Pargaonkar <shirishpargaonkar@gmail.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      d3ba50b1
  15. 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
  16. 18 10月, 2010 1 次提交
    • J
      cifs: convert GlobalSMBSeslock from a rwlock to regular spinlock · 4477288a
      Jeff Layton 提交于
      Convert this lock to a regular spinlock
      
      A rwlock_t offers little value here. It's more expensive than a regular
      spinlock unless you have a fairly large section of code that runs under
      the read lock and can benefit from the concurrency.
      
      Additionally, we need to ensure that the refcounting for files isn't
      racy and to do that we need to lock areas that can increment it for
      write. That means that the areas that can actually use a read_lock are
      very few and relatively infrequently used.
      
      While we're at it, change the name to something easier to type, and fix
      a bug in find_writable_file. cifsFileInfo_put can sleep and shouldn't be
      called while holding the lock.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Reviewed-by: NSuresh Jayaraman <sjayaraman@suse.de>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      4477288a
  17. 15 10月, 2010 1 次提交
  18. 02 10月, 2010 1 次提交
    • J
      cifs: prevent infinite recursion in cifs_reconnect_tcon · f569599a
      Jeff Layton 提交于
      cifs_reconnect_tcon is called from smb_init. After a successful
      reconnect, cifs_reconnect_tcon will call reset_cifs_unix_caps. That
      function will, in turn call CIFSSMBQFSUnixInfo and CIFSSMBSetFSUnixInfo.
      Those functions also call smb_init.
      
      It's possible for the session and tcon reconnect to succeed, and then
      for another cifs_reconnect to occur before CIFSSMBQFSUnixInfo or
      CIFSSMBSetFSUnixInfo to be called. That'll cause those functions to call
      smb_init and cifs_reconnect_tcon again, ad infinitum...
      
      Break the infinite recursion by having those functions use a new
      smb_init variant that doesn't attempt to perform a reconnect.
      Reported-and-Tested-by: NMichal Suchanek <hramrach@centrum.cz>
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      f569599a
  19. 30 9月, 2010 1 次提交
    • S
      cifs NTLMv2/NTLMSSP ntlmv2 within ntlmssp autentication code · 2b149f11
      Shirish Pargaonkar 提交于
      Attribue Value (AV) pairs or Target Info (TI) pairs are part of
      ntlmv2 authentication.
      Structure ntlmv2_resp had only definition for two av pairs.
      So removed it, and now allocation of av pairs is dynamic.
      For servers like Windows 7/2008, av pairs sent by server in
      challege packet (type 2 in the ntlmssp exchange/negotiation) can
      vary.
      
      Server sends them during ntlmssp negotiation. So when ntlmssp is used
      as an authentication mechanism, type 2 challenge packet from server
      has this information.  Pluck it and use the entire blob for
      authenticaiton purpose.  If user has not specified, extract
      (netbios) domain name from the av pairs which is used to calculate
      ntlmv2 hash.  Servers like Windows 7 are particular about the AV pair
      blob.
      
      Servers like Windows 2003, are not very strict about the contents
      of av pair blob used during ntlmv2 authentication.
      So when security mechanism such as ntlmv2 is used (not ntlmv2 in ntlmssp),
      there is no negotiation and so genereate a minimal blob that gets
      used in ntlmv2 authentication as well as gets sent.
      
      Fields tilen and tilbob are session specific.  AV pair values are defined.
      
      To calculate ntlmv2 response we need ti/av pair blob.
      
      For sec mech like ntlmssp, the blob is plucked from type 2 response from
      the server.  From this blob, netbios name of the domain is retrieved,
      if user has not already provided, to be included in the Target String
      as part of ntlmv2 hash calculations.
      
      For sec mech like ntlmv2, create a minimal, two av pair blob.
      
      The allocated blob is freed in case of error.  In case there is no error,
      this blob is used in calculating ntlmv2 response (in CalcNTLMv2_response)
      and is also copied on the response to the server, and then freed.
      
      The type 3 ntlmssp response is prepared on a buffer,
      5 * sizeof of struct _AUTHENTICATE_MESSAGE, an empirical value large
      enough to hold _AUTHENTICATE_MESSAGE plus a blob with max possible
      10 values as part of ntlmv2 response and lmv2 keys and domain, user,
      workstation  names etc.
      
      Also, kerberos gets selected as a default mechanism if server supports it,
      over the other security mechanisms.
      Signed-off-by: NShirish Pargaonkar <shirishpargaonkar@gmail.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      2b149f11
  20. 09 9月, 2010 1 次提交
  21. 21 8月, 2010 1 次提交
  22. 06 5月, 2010 2 次提交
  23. 27 4月, 2010 2 次提交