linux/drivers/scsi/mpt3sas
Ivy Lopez e0d26fe176 scsi: mpt3sas: Avoid out-of-bounds cpumask_of_node() call in _base_assign_reply_queues()
dev_to_node() can return NUMA_NO_NODE (-1) on systems without NUMA
topology information for the PCI device, such as single-socket boards
that don't expose device-to-node affinity. Passing -1 directly into
cpumask_of_node() indexes node_to_cpumask_map[-1], an out-of-bounds
array read caught by UBSAN:

  UBSAN: array-index-out-of-bounds in arch/x86/include/asm/topology.h:72:28
  index -1 is out of range for type 'cpumask *[1024]'

Fall back to cpu_online_mask when no NUMA node is available, rather than
assuming dev_to_node() always returns a valid node index.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=221294
Suggested-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Fixes: 728bbc6cbf ("scsi: mpt3sas: Affinity high iops queues IRQs to local node")
Signed-off-by: Ivy Lopez <skunkolee@gmail.com>
Reviewed-by: John Garry <john.g.garry@oracle.com>
Link: https://patch.msgid.link/20260825190313.24013-1-skunkolee@gmail.com
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
2026-09-01 22:22:23 -04:00
..
mpi SCSI misc on 20250326 2025-03-26 19:57:34 -07:00
Kconfig scsi: mpt3sas: Fix spelling mistake in Kconfig "compatiblity" -> "compatibility" 2021-01-05 23:25:07 -05:00
Makefile scsi: mpt3sas: Add hwmon support 2026-07-12 15:46:14 -04:00
mpt3sas_base.c scsi: mpt3sas: Avoid out-of-bounds cpumask_of_node() call in _base_assign_reply_queues() 2026-09-01 22:22:23 -04:00
mpt3sas_base.h scsi: mpt3sas: Add hwmon support 2026-07-12 15:46:14 -04:00
mpt3sas_config.c scsi: mpt3sas: Add IO Unit Page 7 config accessor 2026-07-12 15:46:14 -04:00
mpt3sas_ctl.c Convert remaining multi-line kmalloc_obj/flex GFP_KERNEL uses 2026-02-22 08:26:33 -08:00
mpt3sas_ctl.h scsi: mpt3sas: Report driver capability as part of IOCINFO command 2025-02-20 21:46:35 -05:00
mpt3sas_debug.h mpt2sas, mpt3sas: Remove SCSI_MPTXSAS_LOGGING entry from Kconfig 2015-11-11 18:31:14 -05:00
mpt3sas_debugfs.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
mpt3sas_hwmon.c scsi: mpt3sas: Add hwmon support 2026-07-12 15:46:14 -04:00
mpt3sas_scsih.c scsi: core: Protect host state changes with the host lock 2026-08-13 22:04:50 -04:00
mpt3sas_transport.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
mpt3sas_trigger_diag.c scsi: mpt3sas: Additional diagnostic buffer query interface 2021-02-08 22:02:07 -05:00
mpt3sas_trigger_diag.h scsi: mpt3sas: Fix spelling mistake 2020-06-15 23:28:46 -04:00
mpt3sas_trigger_pages.h scsi: mpt3sas: Fix typo of "TRIGGER" 2023-11-15 08:52:02 -05:00
mpt3sas_warpdrive.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00