Message ID | 20231030064912.37912-1-njavali@marvell.com (mailing list archive) |
---|---|
State | Accepted |
Headers | show |
Series | qla2xxx: fix system crash due to bad pointer access | expand |
Nilesh, > User experience system crash when running AER error injection. The > perturbation cause the abort all IO path to trigger. The driver assume > all IO in this path are FCP only. Instead, there are both NVME & FCP > IO's. Due to the false assumption, system crash is the result. Add > additional check to see if IO is FCP or not before access. Applied to 6.7/scsi-staging, thanks!
On Mon, 30 Oct 2023 12:19:12 +0530, Nilesh Javali wrote: > User experience system crash when running AER error injection. > The perturbation cause the abort all IO path to trigger. The driver > assume all IO in this path are FCP only. Instead, there > are both NVME & FCP IO's. Due to the false assumption, system > crash is the result. Add additional check to see if IO is > FCP or not before access. > > [...] Applied to 6.7/scsi-fixes, thanks! [1/1] qla2xxx: fix system crash due to bad pointer access https://git.kernel.org/mkp/scsi/c/19597cad64d6
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 7e103d711825..d24410944f7d 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -1837,8 +1837,16 @@ static void qla2x00_abort_srb(struct qla_qpair *qp, srb_t *sp, const int res, } spin_lock_irqsave(qp->qp_lock_ptr, *flags); - if (ret_cmd && blk_mq_request_started(scsi_cmd_to_rq(cmd))) - sp->done(sp, res); + switch (sp->type) { + case SRB_SCSI_CMD: + if (ret_cmd && blk_mq_request_started(scsi_cmd_to_rq(cmd))) + sp->done(sp, res); + break; + default: + if (ret_cmd) + sp->done(sp, res); + break; + } } else { sp->done(sp, res); }