android_kernel_samsung_sm8650/drivers/scsi/qla2xxx
Gleb Chesnokov 1d7bc76b58 scsi: qla2xxx: Fix NULL pointer dereference in target mode
[ Upstream commit d54820b22e404b06b2b65877ff802cc7b31688bc ]

When target mode is enabled, the pci_irq_get_affinity() function may return
a NULL value in qla_mapq_init_qp_cpu_map() due to the qla24xx_enable_msix()
code that handles IRQ settings for target mode. This leads to a crash due
to a NULL pointer dereference.

This patch fixes the issue by adding a check for the NULL value returned by
pci_irq_get_affinity() and introducing a 'cpu_mapped' boolean flag to the
qla_qpair structure, ensuring that the qpair's CPU affinity is updated when
it has not been mapped to a CPU.

Fixes: 1d201c81d4cc ("scsi: qla2xxx: Select qpair depending on which CPU post_cmd() gets called")
Signed-off-by: Gleb Chesnokov <gleb.chesnokov@scst.dev>
Link: https://lore.kernel.org/r/56b416f2-4e0f-b6cf-d6d5-b7c372e3c6a2@scst.dev
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-10-06 14:56:59 +02:00
..
Kconfig
Makefile
qla_attr.c scsi: qla2xxx: Remove unsupported ql2xenabledif option 2023-09-19 12:27:55 +02:00
qla_bsg.c scsi: qla2xxx: Pointer may be dereferenced 2023-07-23 13:49:49 +02:00
qla_bsg.h scsi: qla2xxx: Add NVMe parameters support in Auxiliary Image Status 2022-09-01 00:30:55 -04:00
qla_dbg.c scsi: qla2xxx: Remove unsupported ql2xenabledif option 2023-09-19 12:27:55 +02:00
qla_dbg.h scsi: qla2xxx: Enhance driver tracing with separate tunable and more 2022-09-01 00:30:55 -04:00
qla_def.h scsi: qla2xxx: Fix NULL pointer dereference in target mode 2023-10-06 14:56:59 +02:00
qla_devtbl.h
qla_dfs.c scsi: qla2xxx: Fix NULL vs IS_ERR() bug for debugfs_create_dir() 2023-09-23 11:11:09 +02:00
qla_dsd.h
qla_edif_bsg.h scsi: qla2xxx: edif: Fix clang warning 2023-03-10 09:33:12 +01:00
qla_edif.c scsi: qla2xxx: Avoid fcport pointer dereference 2023-07-23 13:49:48 +02:00
qla_edif.h scsi: qla2xxx: edif: Fix session thrash 2022-06-10 13:04:04 -04:00
qla_fw.h scsi: qla2xxx: Add NVMe parameters support in Auxiliary Image Status 2022-09-01 00:30:55 -04:00
qla_gbl.h scsi: qla2xxx: Adjust IOCB resource on qpair create 2023-09-19 12:27:55 +02:00
qla_gs.c scsi: qla2xxx: Update manufacturer details 2022-07-18 22:33:04 -04:00
qla_init.c scsi: qla2xxx: Fix NULL pointer dereference in target mode 2023-10-06 14:56:59 +02:00
qla_inline.h scsi: qla2xxx: Fix NULL pointer dereference in target mode 2023-10-06 14:56:59 +02:00
qla_iocb.c scsi: qla2xxx: Fix command flush during TMF 2023-09-19 12:27:55 +02:00
qla_isr.c scsi: qla2xxx: Fix NULL pointer dereference in target mode 2023-10-06 14:56:59 +02:00
qla_mbx.c scsi: qla2xxx: Flush mailbox commands on chip reset 2023-09-19 12:27:55 +02:00
qla_mid.c scsi: qla2xxx: edif: Synchronize NPIV deletion with authentication application 2022-06-07 21:50:10 -04:00
qla_mr.c
qla_mr.h
qla_nvme.c scsi: qla2xxx: Select qpair depending on which CPU post_cmd() gets called 2023-10-06 14:56:45 +02:00
qla_nvme.h
qla_nx2.c
qla_nx2.h
qla_nx.c
qla_nx.h
qla_os.c scsi: qla2xxx: Select qpair depending on which CPU post_cmd() gets called 2023-10-06 14:56:45 +02: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 14:56:45 +02:00
qla_target.h scsi: qla2xxx: Remove unused declarations for qla2xxx 2022-09-15 21:46:46 -04:00
qla_tmpl.c
qla_tmpl.h
qla_version.h scsi: qla2xxx: Update version to 10.02.07.900-k 2022-09-01 00:30:56 -04:00
tcm_qla2xxx.c scsi: qla2xxx: Use raw_smp_processor_id() instead of smp_processor_id() 2023-10-06 14:56:45 +02:00
tcm_qla2xxx.h