1. 02 2月, 2017 7 次提交
  2. 15 1月, 2017 1 次提交
    • R
      cifs: initialize file_info_lock · 81ddd8c0
      Rabin Vincent 提交于
      Reviewed-by: NJeff Layton <jlayton@redhat.com>
      CC: Stable <stable@vger.kernel.org>
      
      file_info_lock is not initalized in initiate_cifs_search(), leading to the
      following splat after a simple "mount.cifs ... dir && ls dir/":
      
       BUG: spinlock bad magic on CPU#0, ls/486
        lock: 0xffff880009301110, .magic: 00000000, .owner: <none>/-1, .owner_cpu: 0
       CPU: 0 PID: 486 Comm: ls Not tainted 4.9.0 #27
       Hardware name: QEMU Standard PC (i440FX + PIIX, 1996)
        ffffc900042f3db0 ffffffff81327533 0000000000000000 ffff880009301110
        ffffc900042f3dd0 ffffffff810baf75 ffff880009301110 ffffffff817ae077
        ffffc900042f3df0 ffffffff810baff6 ffff880009301110 ffff880008d69900
       Call Trace:
        [<ffffffff81327533>] dump_stack+0x65/0x92
        [<ffffffff810baf75>] spin_dump+0x85/0xe0
        [<ffffffff810baff6>] spin_bug+0x26/0x30
        [<ffffffff810bb159>] do_raw_spin_lock+0xe9/0x130
        [<ffffffff8159ad2f>] _raw_spin_lock+0x1f/0x30
        [<ffffffff8127e50d>] cifs_closedir+0x4d/0x100
        [<ffffffff81181cfd>] __fput+0x5d/0x160
        [<ffffffff81181e3e>] ____fput+0xe/0x10
        [<ffffffff8109410e>] task_work_run+0x7e/0xa0
        [<ffffffff81002512>] exit_to_usermode_loop+0x92/0xa0
        [<ffffffff810026f9>] syscall_return_slowpath+0x49/0x50
        [<ffffffff8159b484>] entry_SYSCALL_64_fastpath+0xa7/0xa9
      
      Fixes: 3afca265 ("Clarify locking of cifs file and tcon structures and make more granular")
      Signed-off-by: NRabin Vincent <rabinv@axis.com>
      Signed-off-by: NSteve French <smfrench@gmail.com>
      81ddd8c0
  3. 25 12月, 2016 1 次提交
  4. 15 12月, 2016 3 次提交
    • S
      cifs_get_root shouldn't use path with tree name · 374402a2
      Sachin Prabhu 提交于
      When a server returns the optional flag SMB_SHARE_IS_IN_DFS in response
      to a tree connect, cifs_build_path_to_root() will return a pathname
      which includes the hostname. This causes problems with cifs_get_root()
      which separates each component and does a lookup for each component of
      the path which in this case will incorrectly include looking up the
      hostname component as a path component.
      
      We encountered a problem with dfs shares hosted by a Netapp. When
      connecting to nodes pointed to by the DFS share. The tree connect for
      these nodes return SMB_SHARE_IS_IN_DFS resulting failures in lookup
      in cifs_get_root().
      
      RH bz: 1373153
      The patch was tested against a Netapp simulator and by a user using an
      actual Netapp server.
      Signed-off-by: NSachin Prabhu <sprabhu@redhat.com>
      Reported-by: NPierguido Lambri <plambri@redhat.com>
      Reviewed-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <smfrench@gmail.com>
      374402a2
    • G
      Fix default behaviour for empty domains and add domainauto option · 39566443
      Germano Percossi 提交于
      With commit 2b149f11 many things have been fixed/introduced.
      However, the default behaviour for RawNTLMSSP authentication
      seems to be wrong in case the domain is not passed on the command line.
      
      The main points (see below) of the patch are:
       - It alignes behaviour with Windows clients
       - It fixes backward compatibility
       - It fixes UPN
      
      I compared this behavour with the one from a Windows 10 command line
      client. When no domains are specified on the command line, I traced
      the packets and observed that the client does send an empty
      domain to the server.
      In the linux kernel case, the empty domain is replaced by the
      primary domain communicated by the SMB server.
      This means that, if the credentials are valid against the local server
      but that server is part of a domain, then the kernel module will
      ask to authenticate against that domain and we will get LOGON failure.
      
      I compared the packet trace from the smbclient when no domain is passed
      and, in that case, a default domain from the client smb.conf is taken.
      Apparently, connection succeeds anyway, because when the domain passed
      is not valid (in my case WORKGROUP), then the local one is tried and
      authentication succeeds. I tried with any kind of invalid domain and
      the result was always a connection.
      
      So, trying to interpret what to do and picking a valid domain if none
      is passed, seems the wrong thing to do.
      To this end, a new option "domainauto" has been added in case the
      user wants a mechanism for guessing.
      
      Without this patch, backward compatibility also is broken.
      With kernel 3.10, the default auth mechanism was NTLM.
      One of our testing servers accepted NTLM and, because no
      domains are passed, authentication was local.
      
      Moving to RawNTLMSSP forced us to change our command line
      to add a fake domain to pass to prevent this mechanism to kick in.
      
      For the same reasons, UPN is broken because the domain is specified
      in the username.
      The SMB server will work out the domain from the UPN and authenticate
      against the right server.
      Without the patch, though, given the domain is empty, it gets replaced
      with another domain that could be the wrong one for the authentication.
      Signed-off-by: NGermano Percossi <germano.percossi@citrix.com>
      Acked-by: NPavel Shilovsky <pshilov@microsoft.com>
      Signed-off-by: NSteve French <smfrench@gmail.com>
      39566443
    • R
      cifs: use %16phN for formatting md5 sum · c6fc663e
      Rasmus Villemoes 提交于
      Passing a gazillion arguments takes a lot of code:
      
      add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-253 (-253)
      Signed-off-by: NRasmus Villemoes <linux@rasmusvillemoes.dk>
      Reviewed-by: NPavel Shilovsky <pshilov@microsoft.com>
      Signed-off-by: NSteve French <smfrench@gmail.com>
      c6fc663e
  5. 14 12月, 2016 1 次提交
  6. 09 12月, 2016 1 次提交
  7. 06 12月, 2016 4 次提交
  8. 03 12月, 2016 1 次提交
  9. 01 12月, 2016 1 次提交
    • S
      SMB3: parsing for new snapshot timestamp mount parm · 8b217fe7
      Steve French 提交于
      New mount option "snapshot=<time>" to allow mounting an earlier
      version of the remote volume (if such a snapshot exists on
      the server).
      
      Note that eventually specifying a snapshot time of 1 will allow
      the user to mount the oldest snapshot. A subsequent patch
      add the processing for that and another for actually specifying
      the "time warp" create context on SMB2/SMB3 open.
      
      Check to make sure SMB2 negotiated, and ensure that
      we use a different tcon if mount same share twice
      but with different snaphshot times
      Signed-off-by: NSteve French <smfrench@gmail.com>
      Reviewed-by: NPavel Shilovsky <pshilov@microsoft.com>
      8b217fe7
  10. 29 11月, 2016 3 次提交
    • E
      CIFS: iterate over posix acl xattr entry correctly in ACL_to_cifs_posix() · ae9ebe7c
      Eryu Guan 提交于
      Commit 2211d5ba ("posix_acl: xattr representation cleanups")
      removes the typedefs and the zero-length a_entries array in struct
      posix_acl_xattr_header, and uses bare struct posix_acl_xattr_header
      and struct posix_acl_xattr_entry directly.
      
      But it failed to iterate over posix acl slots when converting posix
      acls to CIFS format, which results in several test failures in
      xfstests (generic/053 generic/105) when testing against a samba v1
      server, starting from v4.9-rc1 kernel. e.g.
      
        [root@localhost xfstests]# diff -u tests/generic/105.out /root/xfstests/results//generic/105.out.bad
        --- tests/generic/105.out       2016-09-19 16:33:28.577962575 +0800
        +++ /root/xfstests/results//generic/105.out.bad 2016-10-22 15:41:15.201931110 +0800
        @@ -1,3 +1,4 @@
         QA output created by 105
         -rw-r--r-- root
        +setfacl: subdir: Invalid argument
         -rw-r--r-- root
      
      Fix it by introducing a new "ace" var, like what
      cifs_copy_posix_acl() does, and iterating posix acl xattr entries
      over it in the for loop.
      Signed-off-by: NEryu Guan <guaneryu@gmail.com>
      Signed-off-by: NSteve French <smfrench@gmail.com>
      ae9ebe7c
    • S
      Call echo service immediately after socket reconnect · b8c60012
      Sachin Prabhu 提交于
      Commit 4fcd1813 ("Fix reconnect to not defer smb3 session reconnect
      long after socket reconnect") changes the behaviour of the SMB2 echo
      service and causes it to renegotiate after a socket reconnect. However
      under default settings, the echo service could take up to 120 seconds to
      be scheduled.
      
      The patch forces the echo service to be called immediately resulting a
      negotiate call being made immediately on reconnect.
      Signed-off-by: NSachin Prabhu <sprabhu@redhat.com>
      Reviewed-by: NPavel Shilovsky <pshilov@microsoft.com>
      Signed-off-by: NSteve French <smfrench@gmail.com>
      b8c60012
    • S
      CIFS: Fix BUG() in calc_seckey() · 5f4b5569
      Sachin Prabhu 提交于
      Andy Lutromirski's new virtually mapped kernel stack allocations moves
      kernel stacks the vmalloc area. This triggers the bug
       kernel BUG at ./include/linux/scatterlist.h:140!
      at calc_seckey()->sg_init()
      Signed-off-by: NSachin Prabhu <sprabhu@redhat.com>
      Signed-off-by: NSteve French <smfrench@gmail.com>
      Reviewed-by: NJeff Layton <jlayton@redhat.com>
      5f4b5569
  11. 01 11月, 2016 1 次提交
  12. 15 10月, 2016 2 次提交
  13. 14 10月, 2016 8 次提交
  14. 13 10月, 2016 6 次提交