1. 13 5月, 2008 2 次提交
    • S
      [CIFS] cleanup old checkpatch warnings · 582d21e5
      Steve French 提交于
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      582d21e5
    • J
      [CIFS] CIFS currently allows for permissions to be changed on files, even · d0a9c078
      Jeff Layton 提交于
      when unix extensions and cifsacl support are disabled. These
      permissions changes are "ephemeral" however. They are lost whenever
      a share is mounted and unmounted, or when memory pressure forces
      the inode out of the cache.
      
      Because of this, we'd like to introduce a behavior change to make
      CIFS behave more like local DOS/Windows filesystems. When unix
      extensions and cifsacl support aren't enabled, then don't silently
      ignore changes to permission bits that can't be reflected on the
      server.
      
      Still, there may be people relying on the current behavior for
      certain applications. This patch adds a new "dynperm" (and a
      corresponding "nodynperm") mount option that will be intended
      to make the client fall back to legacy behavior when setting
      these modes.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      d0a9c078
  2. 12 5月, 2008 3 次提交
    • S
      [CIFS] don't allow demultiplex thread to exit until kthread_stop is called · e691b9d1
      Steve French 提交于
      cifs_demultiplex_thread can exit under several conditions:
      
      1) if it's signaled
      2) if there's a problem with session setup
      3) if kthread_stop is called on it
      
      The first two are problems. If kthread_stop is called on the thread,
      there is no guarantee that it will still be up. We need to have the
      thread stay up until kthread_stop is called on it.
      
      One option would be to not even try to tear things down until after
      kthread_stop is called. However, in the case where there is a problem
      setting up the session, there's no real reason to try continuing the
      loop.
      
      This patch allows the thread to clean up and prepare for exit under all
      three conditions, but it has the thread go to sleep until kthread_stop
      is called. This allows us to simplify the shutdown code somewhat since
      we can be reasonably sure that the thread won't exit after being
      signaled but before kthread_stop is called.
      
      It also removes the places where the thread itself set the tsk variable
      since it appeared that it could have a potential race where the thread
      might never be shut down.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Acked-by: NChristoph Hellwig <hch@infradead.org>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      e691b9d1
    • J
      [CIFS] add local struct inode pointer to cifs_setattr · 02eadeff
      Jeff Layton 提交于
      Clean up cifs_setattr a bit by adding a local inode pointer, and
      changing all of the direntry->d_inode references to it. This also adds a
      bit of micro-optimization. d_inode shouldn't change over the life of
      this function, so we only need to dereference it once.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      02eadeff
    • C
      [CIFS] cifs_find_tcp_session cleanup · 1b20d672
      Cyrill Gorcunov 提交于
      This patch cleans up cifs_find_tcp_session so it become
      less indented. Also the error of skipping IPv6 matched
      addresses fixed.
      Signed-off-by: NCyrill Gorcunov <gorcunov@gmail.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      1b20d672
  3. 09 5月, 2008 1 次提交
  4. 07 5月, 2008 2 次提交
  5. 29 4月, 2008 1 次提交
  6. 16 4月, 2008 1 次提交
  7. 16 2月, 2008 2 次提交
  8. 14 2月, 2008 1 次提交
    • S
      [CIFS] fixup prefixpaths which contain multiple path components · 03a143c9
      Steve French 提交于
      Currently, when we get a prefixpath as part of mount, the kernel only
      changes the first character to be a '/' or '\' depending on whether
      posix extensions are enabled. This is problematic as it expects
      mount.cifs to pass in the correct delimiter in the rest of the
      prefixpath. But, mount.cifs may not know *what* the correct delimiter
      is. It's a chicken and egg problem.
      
      Note that mount.cifs should not do conversion of the
      prefixpath - if we want posix behavior then '\' is legal in a path
      (and we have had bugs in the distant path to prove to me that
      customers sometimes have apps that require '\').  The kernel code
      assumes that the path passed in is posix (and current code will handle
      the first path component fine but was broken for Windows mounts
      for "deep" prefixpaths unless the user specified a prefixpath with '\'
      deep in it.   So e.g. with current kernel code:
      
      1) mount to //server/share/dir1 will work to all server types
      2) mount to //server/share/dir1/subdir1 will work to Samba
      3) mount to //server/share/dir1\\subdir1 will work to Windows
      
      But case two would fail to Windows without the fix.
      With the kernel cifs module fix case two now works.
      
      First analyzed by Jeff Layton and Simo Sorce
      
      CC: Jeff Layton <jlayton@redhat.com>
      CC: Simo Sorce <simo@samba.org>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      03a143c9
  9. 13 2月, 2008 1 次提交
  10. 25 1月, 2008 1 次提交
  11. 04 1月, 2008 1 次提交
  12. 31 12月, 2007 1 次提交
    • J
      [CIFS] redo existing session setup if needed in cifs_mount · 1d9a8852
      Jeff Layton 提交于
      When cifs_mount finds an existing SMB session that it can use for a new
      mount, it does not check to see whether that session is in need of being
      reconnected. An easy way to reproduce:
      
      1) mount //server/share1
      2) watch /proc/fs/cifs/DebugData for the share to go DISCONNECTED
      3) mount //server/share2 with same creds as in step 1.
      
      The second mount will fail because CIFSTCon returned -EAGAIN. If you do
      an operation in share1 and then reattempt the mount it will work (since
      the session is reestablished).
      
      The following patch fixes this by having cifs_mount check the status
      of the session when it picks an existing session and calling
      cifs_setup_session on it again if it's in need of reconnection.
      
      Thanks to Wojciech Pilorz for the initial bug report.
      Signed-off-by: NJeff Layton <jlayton@tupile.poochiereds.net>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      1d9a8852
  13. 20 11月, 2007 1 次提交
  14. 17 11月, 2007 3 次提交
  15. 14 11月, 2007 1 次提交
    • S
      [CIFS] Fix buffer overflow if server sends corrupt response to small · 133672ef
      Steve French 提交于
      request
      
      In SendReceive() function in transport.c - it memcpy's
      message payload into a buffer passed via out_buf param. The function
      assumes that all buffers are of size (CIFSMaxBufSize +
      MAX_CIFS_HDR_SIZE) , unfortunately it is also called with smaller
      (MAX_CIFS_SMALL_BUFFER_SIZE) buffers.  There are eight callers
      (SMB worker functions) which are primarily affected by this change:
      
      TreeDisconnect, uLogoff, Close, findClose, SetFileSize, SetFileTimes,
      Lock and PosixLock
      
      CC: Dave Kleikamp <shaggy@austin.ibm.com>
      CC: Przemyslaw Wegrzyn <czajnik@czajsoft.pl>
      Acked-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      133672ef
  16. 13 11月, 2007 1 次提交
  17. 10 11月, 2007 1 次提交
    • J
      [CIFS] fix oops on second mount to same server when null auth is used · 9b8f5f57
      Jeff Layton 提交于
      When a share is mounted using no username, cifs_mount sets
      volume_info.username as a NULL pointer, and the sesInfo userName as an
      empty string. The volume_info.username is passed to a couple of other
      functions to see if there is an existing unc or tcp connection that can
      be used. These functions assume that the username will be a valid
      string that can be passed to strncmp. If the pointer is NULL, then the
      kernel will oops if there's an existing session to which the string
      can be compared.
      
      This patch changes cifs_mount to set volume_info.username to an empty
      string in this situation, which prevents the oops and should make it
      so that the comparison to other null auth sessions match.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      9b8f5f57
  18. 02 11月, 2007 1 次提交
  19. 20 10月, 2007 1 次提交
  20. 18 10月, 2007 1 次提交
    • S
      [CIFS] fix bad handling of EAGAIN error on kernel_recvmsg in cifs_demultiplex_thread · c18c732e
      Steve French 提交于
      When kernel_recvmsg returns -EAGAIN or -ERESTARTSYS, then
      cifs_demultiplex_thread sleeps for a bit and then tries the read again.
      When it does this, it's not zeroing out the length and that throws off
      the value of total_read. Fix it to zero out the length.
      
      Can cause memory corruption:
      If kernel_recvmsg returns an error and total_read is a large enough
      value, then we'll end up going through the loop again. total_read will
      be a bogus value, as will (pdu_length-total_read). When this happens we
      end up calling kernel_recvmsg with a bogus value (possibly larger than
      the current iov_len).
      
      At that point, memcpy_toiovec can overrun iov. It will start walking
      up the stack, casting other things that are there to struct iovecs
      (since it assumes that it's been passed an array of them). Any pointer
      on the stack at an address above the kvec is a candidate for corruption
      here.
      
      Many thanks to Ulrich Obergfell for pointing this out.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      c18c732e
  21. 17 10月, 2007 1 次提交
  22. 05 10月, 2007 1 次提交
    • S
      [CIFS] Fix cifsd so shuts down when signing fails during mount · a013689d
      Steve French 提交于
      Fixes two problems:
      1) we dropped down to negotiating lanman if we did not recognize the
      mechanism (krb5 e.g.)
      2) we did not stop cifsd (thus will fail when doing rmod cifs with
      slab free errors) when we fail tcon but have a bad session (which is
      the case in which signing is required but we don't allow signing on
      the client)
      
      It also turns on extended security flag in the header when passing
      "sec=krb5" on mount command (although kerberos support is not done of
      course)
      Acked-by: NJeff Layton <jlayton@redhat.com>
      CC: Shaggy <shaggy@us.ibm.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      a013689d
  23. 04 10月, 2007 1 次提交
  24. 29 9月, 2007 1 次提交
  25. 25 9月, 2007 1 次提交
  26. 20 9月, 2007 2 次提交
  27. 15 9月, 2007 2 次提交
  28. 31 8月, 2007 3 次提交
  29. 19 7月, 2007 1 次提交