public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] qla2xxx: Fix memory corruption during hba reset test
@ 2018-01-23 19:05 Himanshu Madhani
  2018-01-24  8:18 ` Johannes Thumshirn
  2018-01-31  2:15 ` Martin K. Petersen
  0 siblings, 2 replies; 3+ messages in thread
From: Himanshu Madhani @ 2018-01-23 19:05 UTC (permalink / raw)
  To: James.Bottomley, martin.petersen; +Cc: himanshu.madhani, linux-scsi

From: Quinn Tran <quinn.tran@cavium.com>

This patch fixes memory corrpution while performing
HBA Reset test.

Following stack trace is seen

[  466.397219] BUG: unable to handle kernel NULL pointer dereference at 0000000000000020
[  466.433669] IP: [<ffffffffc06f5dd0>] qlt_free_session_done+0x260/0x5f0 [qla2xxx]
[  466.467731] PGD 0
[  466.476718] Oops: 0000 [#1] SMP

Signed-off-by: Quinn Tran <quinn.tran@cavium.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
---
Hi Martin, 

This patch fixes the crash for HBA reset test. From core dump analysis,
memory corruption was discoverd during session cleanup. To prevent this
memory corruption, driver needs to wait for session to be deleted and 
all memory associated with the session released before it can relogin and 
create new session.

Please apply this patch to 4.16/scsi-queue at your earliest convenience.

Thanks,
Himanshu
---
 drivers/scsi/qla2xxx/qla_os.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 12ee6e02d146..afcb5567998a 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -3625,6 +3625,8 @@ qla2x00_remove_one(struct pci_dev *pdev)
 	}
 	qla2x00_wait_for_hba_ready(base_vha);
 
+	qla2x00_wait_for_sess_deletion(base_vha);
+
 	/*
 	 * if UNLOAD flag is already set, then continue unload,
 	 * where it was set first.
-- 
2.12.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-01-31  2:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-23 19:05 [PATCH] qla2xxx: Fix memory corruption during hba reset test Himanshu Madhani
2018-01-24  8:18 ` Johannes Thumshirn
2018-01-31  2:15 ` 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