1. 26 3月, 2021 1 次提交
  2. 20 3月, 2021 1 次提交
    • S
      cifs: fix allocation size on newly created files · 65af8f01
      Steve French 提交于
      Applications that create and extend and write to a file do not
      expect to see 0 allocation size.  When file is extended,
      set its allocation size to a plausible value until we have a
      chance to query the server for it.  When the file is cached
      this will prevent showing an impossible number of allocated
      blocks (like 0).  This fixes e.g. xfstests 614 which does
      
          1) create a file and set its size to 64K
          2) mmap write 64K to the file
          3) stat -c %b for the file (to query the number of allocated blocks)
      
      It was failing because we returned 0 blocks.  Even though we would
      return the correct cached file size, we returned an impossible
      allocation size.
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      CC: <stable@vger.kernel.org>
      Reviewed-by: NAurelien Aptel <aaptel@suse.com>
      65af8f01
  3. 19 3月, 2021 2 次提交
  4. 15 3月, 2021 2 次提交
    • V
      cifs: Fix preauth hash corruption · 05946d4b
      Vincent Whitchurch 提交于
      smb311_update_preauth_hash() uses the shash in server->secmech without
      appropriate locking, and this can lead to sessions corrupting each
      other's preauth hashes.
      
      The following script can easily trigger the problem:
      
      	#!/bin/sh -e
      
      	NMOUNTS=10
      	for i in $(seq $NMOUNTS);
      		mkdir -p /tmp/mnt$i
      		umount /tmp/mnt$i 2>/dev/null || :
      	done
      	while :; do
      		for i in $(seq $NMOUNTS); do
      			mount -t cifs //192.168.0.1/test /tmp/mnt$i -o ... &
      		done
      		wait
      		for i in $(seq $NMOUNTS); do
      			umount /tmp/mnt$i
      		done
      	done
      
      Usually within seconds this leads to one or more of the mounts failing
      with the following errors, and a "Bad SMB2 signature for message" is
      seen in the server logs:
      
       CIFS: VFS: \\192.168.0.1 failed to connect to IPC (rc=-13)
       CIFS: VFS: cifs_mount failed w/return code = -13
      
      Fix it by holding the server mutex just like in the other places where
      the shashes are used.
      
      Fixes: 8bd68c6e ("CIFS: implement v3.11 preauth integrity")
      Signed-off-by: NVincent Whitchurch <vincent.whitchurch@axis.com>
      CC: <stable@vger.kernel.org>
      Reviewed-by: NAurelien Aptel <aaptel@suse.com>
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      05946d4b
    • S
      cifs: update new ACE pointer after populate_new_aces. · 5171317d
      Shyam Prasad N 提交于
      After the fix for retaining externally set ACEs with cifsacl and
      modefromsid,idsfromsid, there was an issue in populating the
      inherited ACEs after setting the ACEs introduced by these two modes.
      Fixed this by updating the ACE pointer again after the call to
      populate_new_aces.
      Signed-off-by: NShyam Prasad N <sprasad@microsoft.com>
      Reviewed-by: NRohith Surabattula <rohiths@microsoft.com>
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      5171317d
  5. 09 3月, 2021 4 次提交
  6. 07 3月, 2021 2 次提交
  7. 26 2月, 2021 10 次提交
  8. 25 2月, 2021 1 次提交
  9. 23 2月, 2021 8 次提交
  10. 20 2月, 2021 1 次提交
  11. 17 2月, 2021 5 次提交
    • S
      cifs: Reformat DebugData and index connections by conn_id. · 03e9bb1a
      Shyam Prasad N 提交于
      Reformat the output of /proc/fs/cifs/DebugData to print the
      conn_id for each connection. Also reordered and numbered the data
      into a more reader-friendly format.
      
      This is what the new format looks like:
      $ cat /proc/fs/cifs/DebugData
      Display Internal CIFS Data Structures for Debugging
      ---------------------------------------------------
      CIFS Version 2.30
      Features: DFS,FSCACHE,STATS,DEBUG,ALLOW_INSECURE_LEGACY,WEAK_PW_HASH,CIFS_POSIX,UPCALL(SPNEGO),XATTR,ACL
      CIFSMaxBufSize: 16384
      Active VFS Requests: 0
      
      Servers:
      1) ConnectionId: 0x1
      Number of credits: 371 Dialect 0x300
      TCP status: 1 Instance: 1
      Local Users To Server: 1 SecMode: 0x1 Req On Wire: 0 In Send: 0 In MaxReq Wait: 0
      
              Sessions:
              1) Name: 10.10.10.10 Uses: 1 Capability: 0x300077     Session Status: 1
              Security type: RawNTLMSSP  SessionId: 0x785560000019
              User: 1000 Cred User: 0
      
              Shares:
              0) IPC: \\10.10.10.10\IPC$ Mounts: 1 DevInfo: 0x0 Attributes: 0x0
              PathComponentMax: 0 Status: 1 type: 0 Serial Number: 0x0
              Share Capabilities: None        Share Flags: 0x30
              tid: 0x1        Maximal Access: 0x11f01ff
      
              1) \\10.10.10.10\shyam_test2 Mounts: 1 DevInfo: 0x20020 Attributes: 0xc706ff
              PathComponentMax: 255 Status: 1 type: DISK Serial Number: 0xd4723975
              Share Capabilities: None Aligned, Partition Aligned,    Share Flags: 0x0
              tid: 0x5        Optimal sector size: 0x1000     Maximal Access: 0x1f01ff
      
              MIDs:
      
              Server interfaces: 3
              1)      Speed: 10000000000 bps
                      Capabilities: rss
                      IPv4: 10.10.10.1
      
              2)      Speed: 10000000000 bps
                      Capabilities: rss
                      IPv6: fe80:0000:0000:0000:18b4:0000:0000:0000
      
              3)      Speed: 1000000000 bps
                      Capabilities: rss
                      IPv4: 10.10.10.10
                      [CONNECTED]
      Signed-off-by: NShyam Prasad N <sprasad@microsoft.com>
      Reviewed-by: NPavel Shilovsky <pshilov@microsoft.com>
      Reviewed-by: NAurelien Aptel <aaptel@suse.com>
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      03e9bb1a
    • S
      cifs: Identify a connection by a conn_id. · 6d82c27a
      Shyam Prasad N 提交于
      Introduced a new field conn_id in TCP_Server_Info structure.
      This is a non-persistent unique identifier maintained by the client
      for a connection to a file server. For this, a global counter named
      tcpSesNextId is maintained. On allocating a new TCP_Server_Info,
      this counter is incremented and assigned.
      
      Changed the dynamic tracepoints related to reconnects and
      crediting to be more informative (with conn_id printed).
      Debugging a crediting issue helped me understand the
      important things to print here.
      
      Always call dynamic tracepoints outside the scope of spinlocks.
      To do this, copy out the credits and in_flight fields of the
      server struct before dropping the lock.
      Signed-off-by: NShyam Prasad N <sprasad@microsoft.com>
      Reviewed-by: NPavel Shilovsky <pshilov@microsoft.com>
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      6d82c27a
    • S
      cifs: Fix in error types returned for out-of-credit situations. · 7de03948
      Shyam Prasad N 提交于
      For failure by timeout waiting for credits, changed the error
      returned to the app with EBUSY, instead of ENOTSUPP. This is done
      because this situation is possible even in non-buggy cases. i.e.
      overloaded server can return 0 credits until done with outstanding
      requests. And this feels like a better error to return to the app.
      
      For cases of zero credits found even when there are no requests
      in flight, replaced ENOTSUPP with EDEADLK, since we're avoiding
      deadlock here by returning error.
      Signed-off-by: NShyam Prasad N <sprasad@microsoft.com>
      Reviewed-by: NPavel Shilovsky <pshilov@microsoft.com>
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      7de03948
    • S
      cifs: New optype for session operations. · 0f56db83
      Shyam Prasad N 提交于
      We used to share the CIFS_NEG_OP flag between negotiate and
      session authentication. There was an assumption in the code that
      CIFS_NEG_OP is used by negotiate only. So introcuded CIFS_SESS_OP
      and used it for session setup optypes.
      Signed-off-by: NShyam Prasad N <sprasad@microsoft.com>
      Reviewed-by: NPavel Shilovsky <pshilov@microsoft.com>
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      0f56db83
    • S
      cifs: fix trivial typo · 201023c5
      Steve French 提交于
      Typo: exiting --> existing
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      201023c5
  12. 16 2月, 2021 1 次提交
  13. 12 2月, 2021 2 次提交