1. Nov 13, 2021
    • Paulo Alcantara's avatar
      cifs: fix memory leak of smb3_fs_context_dup::server_hostname · 869da64d
      Paulo Alcantara authored
      Fix memory leak of smb3_fs_context_dup::server_hostname when parsing
      and duplicating fs contexts during mount(2) as reported by kmemleak:
      
        unreferenced object 0xffff888125715c90 (size 16):
          comm "mount.cifs", pid 3832, jiffies 4304535868 (age 190.094s)
          hex dump (first 16 bytes):
            7a 65 6c 64 61 2e 74 65 73 74 00 6b 6b 6b 6b a5  zelda.test.kkkk.
          backtrace:
            [<ffffffff8168106e>] kstrdup+0x2e/0x60
            [<ffffffffa027a362>] smb3_fs_context_dup+0x392/0x8d0 [cifs]
            [<ffffffffa0136353>] cifs_smb3_do_mount+0x143/0x1700 [cifs]
            [<ffffffffa02795e8>] smb3_get_tree+0x2e8/0x520 [cifs]
            [<ffffffff817a19aa>] vfs_get_tree+0x8a/0x2d0
            [<ffffffff8181e3e3>] path_mount+0x423/0x1a10
            [<ffffffff8181fbca>] __x64_sys_mount+0x1fa/0x270
            [<ffffffff83ae364b>] do_syscall_64+0x3b/0x90
            [<ffffffff83c0007c>] entry_SYSCALL_64_after_hwframe+0x44/0xae
        unreferenced object 0xffff888111deed20 (size 32):
          comm "mount.cifs", pid 3832, jiffies 4304536044 (age 189.918s)
          hex dump (first 32 bytes):
            44 46 53 52 4f 4f 54 31 2e 5a 45 4c 44 41 2e 54  DFSROOT1.ZELDA.T
            45 53 54 00 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b a5  EST.kkkkkkkkkkk.
          backtrace:
            [<ffffffff8168118d>] kstrndup+0x2d/0x90
            [<ffffffffa027ab2e>] smb3_parse_devname+0x9e/0x360 [cifs]
            [<ffffffffa01870c8>] cifs_setup_volume_info+0xa8/0x470 [cifs]
            [<ffffffffa018c469>] connect_dfs_target+0x309/0xc80 [cifs]
            [<ffffffffa018d6cb>] cifs_mount+0x8eb/0x17f0 [cifs]
            [<ffffffffa0136475>] cifs_smb3_do_mount+0x265/0x1700 [cifs]
            [<ffffffffa02795e8>] smb3_get_tree+0x2e8/0x520 [cifs]
            [<ffffffff817a19aa>] vfs_get_tree+0x8a/0x2d0
            [<ffffffff8181e3e3>] path_mount+0x423/0x1a10
            [<ffffffff8181fbca>] __x64_sys_mount+0x1fa/0x270
            [<ffffffff83ae364b>] do_syscall_64+0x3b/0x90
            [<ffffffff83c0007c>] entry_SYSCALL_64_after_hwframe+0x44/0xae
      
      Fixes: 7be3248f
      
       ("cifs: To match file servers, make sure the server hostname matches")
      Signed-off-by: default avatarPaulo Alcantara (SUSE) <pc@cjr.nz>
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      869da64d
    • Steve French's avatar
      smb3: add additional null check in SMB311_posix_mkdir · ca780da5
      Steve French authored
      
      
      Although unlikely for it to be possible for rsp to be null here,
      the check is safer to add, and quiets a Coverity warning.
      
      Addresses-Coverity: 1437501 ("Explicit Null dereference")
      Reviewed-by: default avatarPaulo Alcantara (SUSE) <pc@cjr.nz>
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      ca780da5
    • Steve French's avatar
      cifs: release lock earlier in dequeue_mid error case · 9e7ffa77
      Steve French authored
      
      
      In dequeue_mid we can log an error while holding a spinlock,
      GlobalMid_Lock.  Coverity notes that the error logging
      also grabs a lock so it is cleaner (and a bit safer) to
      release the GlobalMid_Lock before logging the warning.
      
      Addresses-Coverity: 1507573 ("Thread deadlock")
      Reviewed-by: default avatarPaulo Alcantara (SUSE) <pc@cjr.nz>
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      9e7ffa77
    • Steve French's avatar
      smb3: add additional null check in SMB2_tcon · bac35395
      Steve French authored
      
      
      Although unlikely to be possible for rsp to be null here,
      the check is safer to add, and quiets a Coverity warning.
      
      Addresses-Coverity: 1420428 ("Explicit null dereferenced")
      Reviewed-by: default avatarPaulo Alcantara (SUSE) <pc@cjr.nz>
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      bac35395
    • Steve French's avatar
      smb3: add additional null check in SMB2_open · 6b789518
      Steve French authored
      
      
      Although unlikely to be possible for rsp to be null here,
      the check is safer to add, and quiets a Coverity warning.
      
      Addresses-Coverity: 1418458 ("Explicit null dereferenced")
      Reviewed-by: default avatarPaulo Alcantara (SUSE) <pc@cjr.nz>
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      6b789518
  2. Nov 12, 2021
  3. Nov 11, 2021
  4. Nov 10, 2021
  5. Nov 09, 2021
  6. Nov 07, 2021