An error occurred fetching the project authors.
  1. 15 Jun, 2023 1 commit
  2. 31 May, 2023 1 commit
  3. 08 May, 2023 1 commit
    • Quinn Tran's avatar
      scsi: qla2xxx: Fix mem access after free · b843adde
      Quinn Tran authored
      System crash, where driver is accessing scsi layer's
      memory (scsi_cmnd->device->host) to search for a well known internal
      pointer (vha). The scsi_cmnd was released back to upper layer which
      could be freed, but the driver is still accessing it.
      
      7 [ffffa8e8d2c3f8d0] page_fault at ffffffff86c010fe
        [exception RIP: __qla2x00_eh_wait_for_pending_commands+240]
        RIP: ffffffffc0642350  RSP: ffffa8e8d2c3f988  RFLAGS: 00010286
        RAX: 0000000000000165  RBX: 0000000000000002  RCX: 00000000000036d8
        RDX: 0000000000000000  RSI: ffff9c5c56535188  RDI: 0000000000000286
        RBP: ffff9c5bf7aa4a58   R8: ffff9c589aecdb70   R9: 00000000000003d1
        R10: 0000000000000001  R11: 0000000000380000 R12: ffff9c5c5392bc78
        R13: ffff9c57044ff5c0 R14: ffff9c56b5a3aa00  R15: 00000000000006db
        ORIG_RAX: ffffffffffffffff  CS: 0010  SS: 0018
      8 [ffffa8e8d2c3f9c8] qla2x00_eh_wait_for_pending_commands at ffffffffc0646dd5 [qla2xxx]
      9 [ffffa8e8d2c3fa00] __qla2x00_async_tm_cmd at ffffffffc0658094 [qla2xxx]
      
      Remove access of freed memory. Currently the driver was checking to see if
      scsi_done was called by seeing if the sp->type has changed. Instead,
      check to see if the command has left the  oustanding_cmds[] array as
      sign of scsi_done was called.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarQuinn Tran <qutran@marvell.com>
      Signed-off-by: default avatarNilesh Javali <njavali@marvell.com>
      Link: https://lore.kernel.org/r/20230428075339.32551-6-njavali@marvell.comReviewed-by: default avatarHimanshu Madhani <himanshu.madhani@oracle.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      b843adde
  4. 03 Apr, 2023 1 commit
    • Li Zetao's avatar
      scsi: qla2xxx: Fix memory leak in qla2x00_probe_one() · 85ade401
      Li Zetao authored
      There is a memory leak reported by kmemleak:
      
        unreferenced object 0xffffc900003f0000 (size 12288):
          comm "modprobe", pid 19117, jiffies 4299751452 (age 42490.264s)
          hex dump (first 32 bytes):
            00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
            00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
          backtrace:
            [<00000000629261a8>] __vmalloc_node_range+0xe56/0x1110
            [<0000000001906886>] __vmalloc_node+0xbd/0x150
            [<000000005bb4dc34>] vmalloc+0x25/0x30
            [<00000000a2dc1194>] qla2x00_create_host+0x7a0/0xe30 [qla2xxx]
            [<0000000062b14b47>] qla2x00_probe_one+0x2eb8/0xd160 [qla2xxx]
            [<00000000641ccc04>] local_pci_probe+0xeb/0x1a0
      
      The root cause is traced to an error-handling path in qla2x00_probe_one()
      when the adapter "base_vha" initialize failed. The fab_scan_rp "scan.l" is
      used to record the port information and it is allocated in
      qla2x00_create_host(). However, it is not released in the error handling
      path "probe_failed".
      
      Fix this by freeing the memory of "scan.l" when an error occurs in the
      adapter initialization process.
      
      Fixes: a4239945 ("scsi: qla2xxx: Add switch command to simplify fabric discovery")
      Signed-off-by: default avatarLi Zetao <lizetao1@huawei.com>
      Link: https://lore.kernel.org/r/20230325110004.363898-1-lizetao1@huawei.comReviewed-by: default avatarHimanshu Madhani <himanshu.madhani@oracle.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      85ade401
  5. 24 Mar, 2023 1 commit
  6. 17 Mar, 2023 1 commit
    • Nilesh Javali's avatar
      scsi: qla2xxx: Perform lockless command completion in abort path · 0367076b
      Nilesh Javali authored
      While adding and removing the controller, the following call trace was
      observed:
      
      WARNING: CPU: 3 PID: 623596 at kernel/dma/mapping.c:532 dma_free_attrs+0x33/0x50
      CPU: 3 PID: 623596 Comm: sh Kdump: loaded Not tainted 5.14.0-96.el9.x86_64 #1
      RIP: 0010:dma_free_attrs+0x33/0x50
      
      Call Trace:
         qla2x00_async_sns_sp_done+0x107/0x1b0 [qla2xxx]
         qla2x00_abort_srb+0x8e/0x250 [qla2xxx]
         ? ql_dbg+0x70/0x100 [qla2xxx]
         __qla2x00_abort_all_cmds+0x108/0x190 [qla2xxx]
         qla2x00_abort_all_cmds+0x24/0x70 [qla2xxx]
         qla2x00_abort_isp_cleanup+0x305/0x3e0 [qla2xxx]
         qla2x00_remove_one+0x364/0x400 [qla2xxx]
         pci_device_remove+0x36/0xa0
         __device_release_driver+0x17a/0x230
         device_release_driver+0x24/0x30
         pci_stop_bus_device+0x68/0x90
         pci_stop_and_remove_bus_device_locked+0x16/0x30
         remove_store+0x75/0x90
         kernfs_fop_write_iter+0x11c/0x1b0
         new_sync_write+0x11f/0x1b0
         vfs_write+0x1eb/0x280
         ksys_write+0x5f/0xe0
         do_syscall_64+0x5c/0x80
         ? do_user_addr_fault+0x1d8/0x680
         ? do_syscall_64+0x69/0x80
         ? exc_page_fault+0x62/0x140
         ? asm_exc_page_fault+0x8/0x30
         entry_SYSCALL_64_after_hwframe+0x44/0xae
      
      The command was completed in the abort path during driver unload with a
      lock held, causing the warning in abort path. Hence complete the command
      without any lock held.
      Reported-by: default avatarLin Li <lilin@redhat.com>
      Tested-by: default avatarLin Li <lilin@redhat.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarNilesh Javali <njavali@marvell.com>
      Link: https://lore.kernel.org/r/20230313043711.13500-2-njavali@marvell.comReviewed-by: default avatarHimanshu Madhani <himanshu.madhani@oracle.com>
      Reviewed-by: default avatarJohn Meneghini <jmeneghi@redhat.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      0367076b
  7. 10 Mar, 2023 1 commit
  8. 06 Mar, 2023 1 commit
  9. 12 Jan, 2023 9 commits
  10. 26 Nov, 2022 1 commit
  11. 08 Nov, 2022 1 commit
  12. 07 Sep, 2022 1 commit
  13. 01 Sep, 2022 4 commits
  14. 22 Aug, 2022 1 commit
  15. 19 Jul, 2022 1 commit
  16. 17 Jun, 2022 2 commits
  17. 08 Jun, 2022 1 commit
  18. 26 Apr, 2022 1 commit
  19. 15 Mar, 2022 3 commits
  20. 23 Feb, 2022 1 commit
  21. 11 Feb, 2022 1 commit
  22. 25 Jan, 2022 5 commits