linux/drivers/scsi/qla2xxx
Quinn Tran be079aa71a scsi: qla2xxx: Fix system crash due to bad pointer access
commit 19597cad64 upstream.

User experiences system crash when running AER error injection.  The
perturbation causes the abort-all-I/O path to trigger. The driver assumes
all I/O on this path is FCP only. If there is both NVMe & FCP traffic, a
system crash happens. Add additional check to see if I/O is FCP or not
before access.

PID: 999019  TASK: ff35d769f24722c0  CPU: 53  COMMAND: "kworker/53:1"
 0 [ff3f78b964847b58] machine_kexec at ffffffffae86973d
 1 [ff3f78b964847ba8] __crash_kexec at ffffffffae9be29d
 2 [ff3f78b964847c70] crash_kexec at ffffffffae9bf528
 3 [ff3f78b964847c78] oops_end at ffffffffae8282ab
 4 [ff3f78b964847c98] exc_page_fault at ffffffffaf2da502
 5 [ff3f78b964847cc0] asm_exc_page_fault at ffffffffaf400b62
   [exception RIP: qla2x00_abort_srb+444]
   RIP: ffffffffc07b5f8c  RSP: ff3f78b964847d78  RFLAGS: 00010046
   RAX: 0000000000000282  RBX: ff35d74a0195a200  RCX: ff35d76886fd03a0
   RDX: 0000000000000001  RSI: ffffffffc07c5ec8  RDI: ff35d74a0195a200
   RBP: ff35d76913d22080   R8: ff35d7694d103200   R9: ff35d7694d103200
   R10: 0000000100000000  R11: ffffffffb05d6630  R12: 0000000000010000
   R13: ff3f78b964847df8  R14: ff35d768d8754000  R15: ff35d768877248e0
   ORIG_RAX: ffffffffffffffff  CS: 0010  SS: 0018
 6 [ff3f78b964847d70] qla2x00_abort_srb at ffffffffc07b5f84 [qla2xxx]
 7 [ff3f78b964847de0] __qla2x00_abort_all_cmds at ffffffffc07b6238 [qla2xxx]
 8 [ff3f78b964847e38] qla2x00_abort_all_cmds at ffffffffc07ba635 [qla2xxx]
 9 [ff3f78b964847e58] qla2x00_terminate_rport_io at ffffffffc08145eb [qla2xxx]
10 [ff3f78b964847e70] fc_terminate_rport_io at ffffffffc045987e [scsi_transport_fc]
11 [ff3f78b964847e88] process_one_work at ffffffffae914f15
12 [ff3f78b964847ed0] worker_thread at ffffffffae9154c0
13 [ff3f78b964847f10] kthread at ffffffffae91c456
14 [ff3f78b964847f50] ret_from_fork at ffffffffae8036ef

Cc: stable@vger.kernel.org
Fixes: f45bca8c50 ("scsi: qla2xxx: Fix double scsi_done for abort path")
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Link: https://lore.kernel.org/r/20231030064912.37912-1-njavali@marvell.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-11-28 16:56:27 +00:00
..
Kconfig
Makefile
qla_attr.c scsi: qla2xxx: Remove unsupported ql2xenabledif option 2023-09-19 12:22:55 +02:00
qla_bsg.c scsi: qla2xxx: Pointer may be dereferenced 2023-07-23 13:47:58 +02:00
qla_bsg.h
qla_dbg.c scsi: qla2xxx: Remove unsupported ql2xenabledif option 2023-09-19 12:22:55 +02:00
qla_dbg.h
qla_def.h scsi: qla2xxx: Fix NULL pointer dereference in target mode 2023-10-06 13:18:20 +02:00
qla_devtbl.h
qla_dfs.c scsi: qla2xxx: Fix NULL vs IS_ERR() bug for debugfs_create_dir() 2023-09-23 11:10:01 +02:00
qla_dsd.h
qla_edif_bsg.h
qla_edif.c scsi: qla2xxx: Avoid fcport pointer dereference 2023-07-23 13:47:57 +02:00
qla_edif.h
qla_fw.h
qla_gbl.h scsi: qla2xxx: Adjust IOCB resource on qpair create 2023-09-19 12:22:54 +02:00
qla_gs.c
qla_init.c scsi: qla2xxx: Fix NULL pointer dereference in target mode 2023-10-06 13:18:20 +02:00
qla_inline.h scsi: qla2xxx: Fix NULL pointer dereference in target mode 2023-10-06 13:18:20 +02:00
qla_iocb.c scsi: qla2xxx: Fix command flush during TMF 2023-09-19 12:22:54 +02:00
qla_isr.c scsi: qla2xxx: Fix NULL pointer dereference in target mode 2023-10-06 13:18:20 +02:00
qla_mbx.c scsi: qla2xxx: Flush mailbox commands on chip reset 2023-09-19 12:22:55 +02:00
qla_mid.c
qla_mr.c
qla_mr.h
qla_nvme.c scsi: qla2xxx: Select qpair depending on which CPU post_cmd() gets called 2023-10-06 13:18:11 +02:00
qla_nvme.h
qla_nx2.c
qla_nx2.h
qla_nx.c
qla_nx.h
qla_os.c scsi: qla2xxx: Fix system crash due to bad pointer access 2023-11-28 16:56:27 +00:00
qla_settings.h
qla_sup.c
qla_target.c scsi: qla2xxx: Use raw_smp_processor_id() instead of smp_processor_id() 2023-10-06 13:18:11 +02:00
qla_target.h scsi: qla2xxx: Remove unused declarations for qla2xxx 2023-08-03 10:22:31 +02:00
qla_tmpl.c
qla_tmpl.h
qla_version.h
tcm_qla2xxx.c scsi: qla2xxx: Use raw_smp_processor_id() instead of smp_processor_id() 2023-10-06 13:18:11 +02:00
tcm_qla2xxx.h