]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
scsi: bnx2fc: If IO is still in cleanup then do not return to SCSI layer.
authorChad Dupuis <chad.dupuis@cavium.com>
Mon, 26 Jun 2017 15:59:36 +0000 (08:59 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 28 Jun 2017 01:39:10 +0000 (21:39 -0400)
In eh_abort, driver is calling scsi->done() for a IO for which cleanup is
pending. As the IO is outstanding with the firmware, it may do DMA
associated with the IO. This may lead to heap corruption.

Do not complete the IO for which cleanup is still pending. Return failure
from eh_abort and let the SCSI-ml retry the IO.

Signed-off-by: Chad Dupuis <chad.dupuis@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/bnx2fc/bnx2fc_io.c

index 6e8b9bea89fc7be11acb5af40f2d30368e6d2ee7..5b6153f23f01a88d0b93118e889223cf26c93e19 100644 (file)
@@ -1167,16 +1167,11 @@ int bnx2fc_eh_abort(struct scsi_cmnd *sc_cmd)
                printk(KERN_ERR PFX "eh_abort: io_req (xid = 0x%x) "
                                "not on active_q\n", io_req->xid);
                /*
-                * This condition can happen only due to the FW bug,
-                * where we do not receive cleanup response from
-                * the FW. Handle this case gracefully by erroring
-                * back the IO request to SCSI-ml
+                * The IO is still with the FW.
+                * Return failure and let SCSI-ml retry eh_abort.
                 */
-               bnx2fc_scsi_done(io_req, DID_ABORT);
-
-               kref_put(&io_req->refcount, bnx2fc_cmd_release);
                spin_unlock_bh(&tgt->tgt_lock);
-               return SUCCESS;
+               return FAILED;
        }
 
        /*