* [PATCH] scsi: qla2xxx: Fix crash on qla2x00_mailbox_command
@ 2018-05-28 17:58 Rodrigo R. Galvao
2018-05-30 9:31 ` Rodrigo Rosatti Galvao
2018-06-08 0:26 ` Martin K. Petersen
0 siblings, 2 replies; 3+ messages in thread
From: Rodrigo R. Galvao @ 2018-05-28 17:58 UTC (permalink / raw)
Cc: rosattig, maurosr, kernel, jejb, martin.petersen, linux-scsi,
linux-kernel
This patch fixes a crash on qla2x00_mailbox_command caused when the
driver is on UNLOADING state and tries to call qla2x00_poll, which
triggers a NULL pointer dereference.
Signed-off-by: Rodrigo R. Galvao <rosattig@linux.vnet.ibm.com>
Signed-off-by: Mauro S. M. Rodrigues <maurosr@linux.vnet.ibm.com>
---
drivers/scsi/qla2xxx/qla_mbx.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c
index d8a36c1..7e875f5 100644
--- a/drivers/scsi/qla2xxx/qla_mbx.c
+++ b/drivers/scsi/qla2xxx/qla_mbx.c
@@ -292,6 +292,14 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp)
if (time_after(jiffies, wait_time))
break;
+ /*
+ * Check if it's UNLOADING, cause we cannot poll in
+ * this case, or else a NULL pointer dereference
+ * is triggered.
+ */
+ if (unlikely(test_bit(UNLOADING, &base_vha->dpc_flags)))
+ return QLA_FUNCTION_TIMEOUT;
+
/* Check for pending interrupts. */
qla2x00_poll(ha->rsp_q_map[0]);
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] scsi: qla2xxx: Fix crash on qla2x00_mailbox_command
2018-05-28 17:58 [PATCH] scsi: qla2xxx: Fix crash on qla2x00_mailbox_command Rodrigo R. Galvao
@ 2018-05-30 9:31 ` Rodrigo Rosatti Galvao
2018-06-08 0:26 ` Martin K. Petersen
1 sibling, 0 replies; 3+ messages in thread
From: Rodrigo Rosatti Galvao @ 2018-05-30 9:31 UTC (permalink / raw)
Cc: maurosr, kernel, jejb, martin.petersen, linux-scsi, linux-kernel,
qla2xxx-upstream
Sorry, I just forgot to loop the Qlogic list. [qla2xxx-upstream@qlogic.com]
--
Rodrigo R. Galvão
Intern - Linux Technology Center - IBM
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] scsi: qla2xxx: Fix crash on qla2x00_mailbox_command
2018-05-28 17:58 [PATCH] scsi: qla2xxx: Fix crash on qla2x00_mailbox_command Rodrigo R. Galvao
2018-05-30 9:31 ` Rodrigo Rosatti Galvao
@ 2018-06-08 0:26 ` Martin K. Petersen
1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2018-06-08 0:26 UTC (permalink / raw)
To: Rodrigo R. Galvao
Cc: maurosr, kernel, jejb, martin.petersen, linux-scsi, linux-kernel
Rodrigo,
> This patch fixes a crash on qla2x00_mailbox_command caused when the
> driver is on UNLOADING state and tries to call qla2x00_poll, which
> triggers a NULL pointer dereference.
Applied to 4.18/scsi-fixes. Thank you!
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-06-08 0:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-28 17:58 [PATCH] scsi: qla2xxx: Fix crash on qla2x00_mailbox_command Rodrigo R. Galvao
2018-05-30 9:31 ` Rodrigo Rosatti Galvao
2018-06-08 0:26 ` Martin K. Petersen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).