mirror of
https://github.com/torvalds/linux.git
synced 2026-10-16 21:00:02 +02:00
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:
|
||
|---|---|---|
| .. | ||
| mpi | ||
| Kconfig | ||
| Makefile | ||
| mpt3sas_base.c | ||
| mpt3sas_base.h | ||
| mpt3sas_config.c | ||
| mpt3sas_ctl.c | ||
| mpt3sas_ctl.h | ||
| mpt3sas_debug.h | ||
| mpt3sas_debugfs.c | ||
| mpt3sas_hwmon.c | ||
| mpt3sas_scsih.c | ||
| mpt3sas_transport.c | ||
| mpt3sas_trigger_diag.c | ||
| mpt3sas_trigger_diag.h | ||
| mpt3sas_trigger_pages.h | ||
| mpt3sas_warpdrive.c | ||