1. 16 11月, 2020 3 次提交
    • R
      smb3: Avoid Mid pending list corruption · ac873aa3
      Rohith Surabattula 提交于
      When reconnect happens Mid queue can be corrupted when both
      demultiplex and offload thread try to dequeue the MID from the
      pending list.
      
      These patches address a problem found during decryption offload:
               CIFS: VFS: trying to dequeue a deleted mid
      that could cause a refcount use after free:
               Workqueue: smb3decryptd smb2_decrypt_offload [cifs]
      Signed-off-by: NRohith Surabattula <rohiths@microsoft.com>
      Reviewed-by: NPavel Shilovsky <pshilov@microsoft.com>
      CC: Stable <stable@vger.kernel.org> #5.4+
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      ac873aa3
    • R
      smb3: Call cifs reconnect from demultiplex thread · de9ac0a6
      Rohith Surabattula 提交于
      cifs_reconnect needs to be called only from demultiplex thread.
      skip cifs_reconnect in offload thread. So, cifs_reconnect will be
      called by demultiplex thread in subsequent request.
      
      These patches address a problem found during decryption offload:
           CIFS: VFS: trying to dequeue a deleted mid
      that can cause a refcount use after free:
      
      [ 1271.389453] Workqueue: smb3decryptd smb2_decrypt_offload [cifs]
      [ 1271.389456] RIP: 0010:refcount_warn_saturate+0xae/0xf0
      [ 1271.389457] Code: fa 1d 6a 01 01 e8 c7 44 b1 ff 0f 0b 5d c3 80 3d e7 1d 6a 01 00 75 91 48 c7 c7 d8 be 1d a2 c6 05 d7 1d 6a 01 01 e8 a7 44 b1 ff <0f> 0b 5d c3 80 3d c5 1d 6a 01 00 0f 85 6d ff ff ff 48 c7 c7 30 bf
      [ 1271.389458] RSP: 0018:ffffa4cdc1f87e30 EFLAGS: 00010286
      [ 1271.389458] RAX: 0000000000000000 RBX: ffff9974d2809f00 RCX: ffff9974df898cc8
      [ 1271.389459] RDX: 00000000ffffffd8 RSI: 0000000000000027 RDI: ffff9974df898cc0
      [ 1271.389460] RBP: ffffa4cdc1f87e30 R08: 0000000000000004 R09: 00000000000002c0
      [ 1271.389460] R10: 0000000000000000 R11: 0000000000000001 R12: ffff9974b7fdb5c0
      [ 1271.389461] R13: ffff9974d2809f00 R14: ffff9974ccea0a80 R15: ffff99748e60db80
      [ 1271.389462] FS:  0000000000000000(0000) GS:ffff9974df880000(0000) knlGS:0000000000000000
      [ 1271.389462] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [ 1271.389463] CR2: 000055c60f344fe4 CR3: 0000001031a3c002 CR4: 00000000003706e0
      [ 1271.389465] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      [ 1271.389465] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      [ 1271.389466] Call Trace:
      [ 1271.389483]  cifs_mid_q_entry_release+0xce/0x110 [cifs]
      [ 1271.389499]  smb2_decrypt_offload+0xa9/0x1c0 [cifs]
      [ 1271.389501]  process_one_work+0x1e8/0x3b0
      [ 1271.389503]  worker_thread+0x50/0x370
      [ 1271.389504]  kthread+0x12f/0x150
      [ 1271.389506]  ? process_one_work+0x3b0/0x3b0
      [ 1271.389507]  ? __kthread_bind_mask+0x70/0x70
      [ 1271.389509]  ret_from_fork+0x22/0x30
      Signed-off-by: NRohith Surabattula <rohiths@microsoft.com>
      Reviewed-by: NPavel Shilovsky <pshilov@microsoft.com>
      CC: Stable <stable@vger.kernel.org> #5.4+
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      de9ac0a6
    • N
      cifs: fix a memleak with modefromsid · 98128572
      Namjae Jeon 提交于
      kmemleak reported a memory leak allocated in query_info() when cifs is
      working with modefromsid.
      
        backtrace:
          [<00000000aeef6a1e>] slab_post_alloc_hook+0x58/0x510
          [<00000000b2f7a440>] __kmalloc+0x1a0/0x390
          [<000000006d470ebc>] query_info+0x5b5/0x700 [cifs]
          [<00000000bad76ce0>] SMB2_query_acl+0x2b/0x30 [cifs]
          [<000000001fa09606>] get_smb2_acl_by_path+0x2f3/0x720 [cifs]
          [<000000001b6ebab7>] get_smb2_acl+0x75/0x90 [cifs]
          [<00000000abf43904>] cifs_acl_to_fattr+0x13b/0x1d0 [cifs]
          [<00000000a5372ec3>] cifs_get_inode_info+0x4cd/0x9a0 [cifs]
          [<00000000388e0a04>] cifs_revalidate_dentry_attr+0x1cd/0x510 [cifs]
          [<0000000046b6b352>] cifs_getattr+0x8a/0x260 [cifs]
          [<000000007692c95e>] vfs_getattr_nosec+0xa1/0xc0
          [<00000000cbc7d742>] vfs_getattr+0x36/0x40
          [<00000000de8acf67>] vfs_statx_fd+0x4a/0x80
          [<00000000a58c6adb>] __do_sys_newfstat+0x31/0x70
          [<00000000300b3b4e>] __x64_sys_newfstat+0x16/0x20
          [<000000006d8e9c48>] do_syscall_64+0x37/0x80
      
      This patch add missing kfree for pntsd when mounting modefromsid option.
      
      Cc: Stable <stable@vger.kernel.org> # v5.4+
      Signed-off-by: NNamjae Jeon <namjae.jeon@samsung.com>
      Reviewed-by: NAurelien Aptel <aaptel@suse.com>
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      98128572
  2. 24 10月, 2020 4 次提交
    • S
      cifs: update internal module version number · aef0388a
      Steve French 提交于
      To 2.29
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      aef0388a
    • S
      smb3: add some missing definitions from MS-FSCC · 7d03ae4d
      Steve French 提交于
      Add some structures and defines that were recently added to
      the protocol documentation (see MS-FSCC sections 2.3.29-2.3.34).
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      7d03ae4d
    • S
      smb3: remove two unused variables · 6a87266c
      Steve French 提交于
      Fix two unused variables in commit
      "add support for stat of WSL reparse points for special file types"
      Reported-by: Nkernel test robot <lkp@intel.com>
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      6a87266c
    • S
      smb3: add support for stat of WSL reparse points for special file types · 2e4564b3
      Steve French 提交于
      This is needed so when mounting to Windows we do not
      misinterpret various special files created by Linux (WSL) as symlinks.
      An earlier patch addressed readdir.  This patch fixes stat (getattr).
      
      With this patch:
        File: /mnt1/char
        Size: 0          Blocks: 0          IO Block: 16384  character special file
      Device: 34h/52d Inode: 844424930132069  Links: 1     Device type: 0,0
      Access: (0755/crwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
      Access: 2020-10-21 17:46:51.839458900 -0500
      Modify: 2020-10-21 17:46:51.839458900 -0500
      Change: 2020-10-21 18:30:39.797358800 -0500
       Birth: -
        File: /mnt1/fifo
        Size: 0          Blocks: 0          IO Block: 16384  fifo
      Device: 34h/52d Inode: 1125899906842722  Links: 1
      Access: (0755/prwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
      Access: 2020-10-21 16:21:37.259249700 -0500
      Modify: 2020-10-21 16:21:37.259249700 -0500
      Change: 2020-10-21 18:30:39.797358800 -0500
       Birth: -
        File: /mnt1/block
        Size: 0          Blocks: 0          IO Block: 16384  block special file
      Device: 34h/52d Inode: 844424930132068  Links: 1     Device type: 0,0
      Access: (0755/brwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
      Access: 2020-10-21 17:10:47.913103200 -0500
      Modify: 2020-10-21 17:10:47.913103200 -0500
      Change: 2020-10-21 18:30:39.796725500 -0500
       Birth: -
      
      without the patch all show up incorrectly as symlinks with annoying "operation not supported error also returned"
        File: /mnt1/charstat: cannot read symbolic link '/mnt1/char': Operation not supported
      
        Size: 0          Blocks: 0          IO Block: 16384  symbolic link
      Device: 34h/52d Inode: 844424930132069  Links: 1
      Access: (0000/l---------)  Uid: (    0/    root)   Gid: (    0/    root)
      Access: 2020-10-21 17:46:51.839458900 -0500
      Modify: 2020-10-21 17:46:51.839458900 -0500
      Change: 2020-10-21 18:30:39.797358800 -0500
       Birth: -
        File: /mnt1/fifostat: cannot read symbolic link '/mnt1/fifo': Operation not supported
      
        Size: 0          Blocks: 0          IO Block: 16384  symbolic link
      Device: 34h/52d Inode: 1125899906842722  Links: 1
      Access: (0000/l---------)  Uid: (    0/    root)   Gid: (    0/    root)
      Access: 2020-10-21 16:21:37.259249700 -0500
      Modify: 2020-10-21 16:21:37.259249700 -0500
      Change: 2020-10-21 18:30:39.797358800 -0500
       Birth: -
        File: /mnt1/blockstat: cannot read symbolic link '/mnt1/block': Operation not supported
      
        Size: 0          Blocks: 0          IO Block: 16384  symbolic link
      Device: 34h/52d Inode: 844424930132068  Links: 1
      Access: (0000/l---------)  Uid: (    0/    root)   Gid: (    0/    root)
      Access: 2020-10-21 17:10:47.913103200 -0500
      Modify: 2020-10-21 17:10:47.913103200 -0500
      Change: 2020-10-21 18:30:39.796725500 -0500
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      Reviewed-by: NRonnie Sahlberg <lsahlber@redhat.com>
      2e4564b3
  3. 23 10月, 2020 7 次提交
  4. 22 10月, 2020 4 次提交
  5. 21 10月, 2020 3 次提交
  6. 20 10月, 2020 5 次提交
  7. 16 10月, 2020 6 次提交
  8. 12 10月, 2020 5 次提交
  9. 11 10月, 2020 1 次提交
    • V
      cifs: Fix incomplete memory allocation on setxattr path · 64b7f674
      Vladimir Zapolskiy 提交于
      On setxattr() syscall path due to an apprent typo the size of a dynamically
      allocated memory chunk for storing struct smb2_file_full_ea_info object is
      computed incorrectly, to be more precise the first addend is the size of
      a pointer instead of the wanted object size. Coincidentally it makes no
      difference on 64-bit platforms, however on 32-bit targets the following
      memcpy() writes 4 bytes of data outside of the dynamically allocated memory.
      
        =============================================================================
        BUG kmalloc-16 (Not tainted): Redzone overwritten
        -----------------------------------------------------------------------------
      
        Disabling lock debugging due to kernel taint
        INFO: 0x79e69a6f-0x9e5cdecf @offset=368. First byte 0x73 instead of 0xcc
        INFO: Slab 0xd36d2454 objects=85 used=51 fp=0xf7d0fc7a flags=0x35000201
        INFO: Object 0x6f171df3 @offset=352 fp=0x00000000
      
        Redzone 5d4ff02d: cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc  ................
        Object 6f171df3: 00 00 00 00 00 05 06 00 73 6e 72 75 62 00 66 69  ........snrub.fi
        Redzone 79e69a6f: 73 68 32 0a                                      sh2.
        Padding 56254d82: 5a 5a 5a 5a 5a 5a 5a 5a                          ZZZZZZZZ
        CPU: 0 PID: 8196 Comm: attr Tainted: G    B             5.9.0-rc8+ #3
        Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1 04/01/2014
        Call Trace:
         dump_stack+0x54/0x6e
         print_trailer+0x12c/0x134
         check_bytes_and_report.cold+0x3e/0x69
         check_object+0x18c/0x250
         free_debug_processing+0xfe/0x230
         __slab_free+0x1c0/0x300
         kfree+0x1d3/0x220
         smb2_set_ea+0x27d/0x540
         cifs_xattr_set+0x57f/0x620
         __vfs_setxattr+0x4e/0x60
         __vfs_setxattr_noperm+0x4e/0x100
         __vfs_setxattr_locked+0xae/0xd0
         vfs_setxattr+0x4e/0xe0
         setxattr+0x12c/0x1a0
         path_setxattr+0xa4/0xc0
         __ia32_sys_lsetxattr+0x1d/0x20
         __do_fast_syscall_32+0x40/0x70
         do_fast_syscall_32+0x29/0x60
         do_SYSENTER_32+0x15/0x20
         entry_SYSENTER_32+0x9f/0xf2
      
      Fixes: 5517554e ("cifs: Add support for writing attributes on SMB2+")
      Signed-off-by: NVladimir Zapolskiy <vladimir@tuxera.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      64b7f674
  10. 07 9月, 2020 1 次提交
  11. 29 8月, 2020 1 次提交