arm-trusted-firmware/lib/psci
Olivier Deprez 66327414fb fix(psci): potential array overflow with cpu on
Fix coverity finding in psci_cpu_on, in which target_idx is directly
assigned the return value from plat_core_pos_by_mpidr. If the latter
returns a negative or large positive value, it can trigger an out of
bounds overflow for the psci_cpu_pd_nodes array.

>>>>    CID 382009:    (OVERRUN)
>>>>    Overrunning callee's array of size 8 by passing argument "target_idx" (which evaluates to 4294967295) in call to "psci_spin_lock_cpu".
> 80         psci_spin_lock_cpu(target_idx);

>>>>    CID 382009:    (OVERRUN)
>>>>    Overrunning callee's array of size 8 by passing argument "target_idx" (which evaluates to 4294967295) in call to "psci_spin_unlock_cpu".
> 160         psci_spin_unlock_cpu(target_idx);

Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
Change-Id: Ibc46934e9ca7fdcaeebd010e5c6954dcf2dcf8c7
2023-04-11 17:59:38 +02:00
..
aarch32 fix(psci): tighten psci_power_down_wfi behaviour 2023-01-23 17:25:40 +00:00
aarch64 fix(cpus): workaround for Cortex-A510 erratum 2684597 2023-01-25 09:40:33 +00:00
psci_common.c feat(psci): add support for OS-initiated mode 2023-03-20 22:20:35 -07:00
psci_lib.mk fix(cpus): workaround for Cortex-A510 erratum 2684597 2023-01-25 09:40:33 +00:00
psci_main.c fix(psci): remove unreachable switch/case blocks 2023-04-04 12:39:36 +02:00
psci_mem_protect.c Sanitise includes across codebase 2019-01-04 10:43:17 +00:00
psci_off.c refactor(psci): move psci_do_pwrdown_sequence() out of private header 2022-09-15 18:09:56 +05:30
psci_on.c fix(psci): potential array overflow with cpu on 2023-04-11 17:59:38 +02:00
psci_private.h feat(psci): add support for OS-initiated mode 2023-03-20 22:20:35 -07:00
psci_setup.c feat(psci): add support for PSCI_SET_SUSPEND_MODE 2023-03-20 22:20:35 -07:00
psci_stat.c Unify type of "cpu_idx" across PSCI module. 2020-01-10 17:11:51 +00:00
psci_suspend.c feat(psci): add support for OS-initiated mode 2023-03-20 22:20:35 -07:00
psci_system_off.c Don't return error information from console_flush 2020-10-09 10:21:50 -05:00