]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
mailbox: mchp-ipc-sbi: fix out-of-bounds access in mchp_ipc_get_cluster_aggr_irq()
authorValentina Fernandez <valentina.fernandezalanis@microchip.com>
Thu, 13 Nov 2025 13:49:22 +0000 (13:49 +0000)
committerJassi Brar <jassisinghbrar@gmail.com>
Sun, 18 Jan 2026 20:19:11 +0000 (14:19 -0600)
commitf7c330a8c83c9b0332fd524097eaf3e69148164d
treec146a0dbbc813c41e2956970e81c5b65b4bf02ce
parentd96ebba37b7d08a4d7d5f4b992b4400e6e7b8fa1
mailbox: mchp-ipc-sbi: fix out-of-bounds access in mchp_ipc_get_cluster_aggr_irq()

The cluster_cfg array is dynamically allocated to hold per-CPU
configuration structures, with its size based on the number of online
CPUs. Previously, this array was indexed using hartid, which may be
non-contiguous or exceed the bounds of the array, leading to
out-of-bounds access.
Switch to using cpuid as the index, as it is guaranteed to be within
the valid range provided by for_each_online_cpu().

Signed-off-by: Valentina Fernandez <valentina.fernandezalanis@microchip.com>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Jassi Brar <jassisinghbrar@gmail.com>
drivers/mailbox/mailbox-mchp-ipc-sbi.c