WSL2-Linux-Kernel/drivers/scsi/qla2xxx
Nilesh Javali cde43031df scsi: qla2xxx: validate nvme_local_port correctly
commit eb1d4ce2609584eeb7694866f34d4b213caa3af9 upstream.

The driver load failed with error message,

qla2xxx [0000:04:00.0]-ffff:0: register_localport failed: ret=ffffffef

and with a kernel crash,

	BUG: unable to handle kernel NULL pointer dereference at 0000000000000070
	Workqueue: events_unbound qla_register_fcport_fn [qla2xxx]
	RIP: 0010:nvme_fc_register_remoteport+0x16/0x430 [nvme_fc]
	RSP: 0018:ffffaaa040eb3d98 EFLAGS: 00010282
	RAX: 0000000000000000 RBX: ffff9dfb46b78c00 RCX: 0000000000000000
	RDX: ffff9dfb46b78da8 RSI: ffffaaa040eb3e08 RDI: 0000000000000000
	RBP: ffff9dfb612a0a58 R08: ffffffffaf1d6270 R09: 3a34303a30303030
	R10: 34303a303030305b R11: 2078787832616c71 R12: ffff9dfb46b78dd4
	R13: ffff9dfb46b78c24 R14: ffff9dfb41525300 R15: ffff9dfb46b78da8
	FS:  0000000000000000(0000) GS:ffff9dfc67c00000(0000) knlGS:0000000000000000
	CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
	CR2: 0000000000000070 CR3: 000000018da10004 CR4: 00000000000206f0
	Call Trace:
	qla_nvme_register_remote+0xeb/0x1f0 [qla2xxx]
	? qla2x00_dfs_create_rport+0x231/0x270 [qla2xxx]
	qla2x00_update_fcport+0x2a1/0x3c0 [qla2xxx]
	qla_register_fcport_fn+0x54/0xc0 [qla2xxx]

Exit the qla_nvme_register_remote() function when qla_nvme_register_hba()
fails and correctly validate nvme_local_port.

Cc: stable@vger.kernel.org
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Link: https://lore.kernel.org/r/20240710171057.35066-3-njavali@marvell.com
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-08-19 05:45:18 +02:00
..
Kconfig
Makefile
qla_attr.c scsi: qla2xxx: Delay I/O Abort on PCI error 2024-04-10 16:19:34 +02:00
qla_bsg.c scsi: qla2xxx: Use QP lock to search for bsg 2024-08-19 05:45:18 +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: Unable to act on RSCN for port online 2024-08-19 05:45:18 +02:00
qla_devtbl.h
qla_dfs.c scsi: qla2xxx: Fix debugfs output for fw_resource_count 2024-06-16 13:39:24 +02:00
qla_dsd.h
qla_edif.c scsi: qla2xxx: Fix off by one in qla_edif_app_getstats() 2024-04-17 11:15:14 +02:00
qla_edif.h scsi: qla2xxx: edif: Fix session thrash 2022-08-17 14:23:43 +02:00
qla_edif_bsg.h scsi: qla2xxx: edif: Synchronize NPIV deletion with authentication application 2022-08-17 14:23:39 +02:00
qla_fw.h scsi: qla2xxx: edif: Send LOGO for unexpected IKE message 2022-08-17 14:23:42 +02:00
qla_gbl.h scsi: qla2xxx: Fix N2N stuck connection 2024-04-10 16:19:33 +02:00
qla_gs.c scsi: qla2xxx: Unable to act on RSCN for port online 2024-08-19 05:45:18 +02:00
qla_init.c scsi: qla2xxx: Fix flash read failure 2024-08-19 05:45:18 +02:00
qla_inline.h scsi: qla2xxx: Unable to act on RSCN for port online 2024-08-19 05:45:18 +02:00
qla_iocb.c scsi: qla2xxx: Fix double free of fcport 2024-04-10 16:19:34 +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: Change debug message during driver unload 2024-04-10 16:19:34 +02:00
qla_mid.c scsi: qla2xxx: During vport delete send async logout explicitly 2024-08-19 05:45:17 +02:00
qla_mr.c scsi: qla2xxx: Replace all non-returning strlcpy() with strscpy() 2024-06-16 13:39:43 +02:00
qla_mr.h
qla_nvme.c scsi: qla2xxx: validate nvme_local_port correctly 2024-08-19 05:45:18 +02:00
qla_nvme.h
qla_nx.c
qla_nx.h
qla_nx2.c
qla_nx2.h
qla_os.c scsi: qla2xxx: Complete command early within lock 2024-08-19 05:45:18 +02:00
qla_settings.h
qla_sup.c scsi: qla2xxx: Fix flash read failure 2024-08-19 05:45:18 +02:00
qla_target.c scsi: qla2xxx: Fix command flush on cable pull 2024-04-10 16:19:34 +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