[PATCH] scsi: message: fusion: use fc_lsc_work in mptfc_link_status_change()
From: Ziheng Wei
Date: Mon Nov 30 2026 - 05:21:31 EST
mptfc_probe() initializes ioc->fc_lsc_work with mptfc_link_status_change()
and queues it on MPI_EVENT_LINK_STATUS_CHANGE events, but
mptfc_link_status_change() recovers ioc using
container_of(work, MPT_ADAPTER, fc_rescan_work) instead of fc_lsc_work.
When a link status change event fires, the shifted ioc pointer causes
out-of-bounds reads before the MPT_ADAPTER object (e.g., ioc->name in
mptfc_GetFcPortPage0()) and corrupts the ioc->facts.NumberOfPorts bound.
Use fc_lsc_work in container_of().
Found by LLM-assisted static analysis and runtime-tested in QEMU+KASAN
(slab-out-of-bounds before the fix; 0 KASAN findings after).
Fixes: eb5329f40c13 ("[SCSI] mpt fusion: Link speed change display support")
Signed-off-by: Ziheng Wei <zihengw03@xxxxxxx>
---
drivers/message/fusion/mptfc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/message/fusion/mptfc.c b/drivers/message/fusion/mptfc.c
index bca050997..4665e010a 100644
--- a/drivers/message/fusion/mptfc.c
+++ b/drivers/message/fusion/mptfc.c
@@ -1105,7 +1105,7 @@ static void
mptfc_link_status_change(struct work_struct *work)
{
MPT_ADAPTER *ioc =
- container_of(work, MPT_ADAPTER, fc_rescan_work);
+ container_of(work, MPT_ADAPTER, fc_lsc_work);
int ii;
for (ii=0; ii < ioc->facts.NumberOfPorts; ii++)
base-commit: 97d73c8251226cf27cc6656b4c542869bb8c69fa
--
2.43.0