FreeRTOS-Kernel/portable/RVDS
Corentin Pane b4972f4093 Mask MPU region base addresses when writing to MPU_RBAR on ARM_CM3/4
Bits 0-4 are reserved for VALID and REGION, while ADDR  spans at most bits 5-31 (bits 5-7 are sometimes reserved and not assigned to ADDR field). Masking ensures that a misaligned base address cannot modify less significant bits in the attribute reserved for other use. Failing to mask the address may allow a malicious user to pass in misaligned addresses in a user-defined region or as stack buffer which could in turn override the settings for higher-priority kernel-defined regions.

This change doesn't guarantee that only properly aligned addresses are written to the ADDR field of the register, and doesn't ensure that reserved field from bits 5-7 are not written to, but protects the VALID and REGION fields.
2026-08-31 16:34:46 +02:00
..
ARM7_LPC21xx Use Regex for Copyright Year in Header Check (#1002) 2024-02-26 09:26:42 -08:00
ARM_CA9 Move configASSERT default definition above before including portable.h. (#1185) 2024-11-04 16:35:52 +05:30
ARM_CM0 Use Regex for Copyright Year in Header Check (#1002) 2024-02-26 09:26:42 -08:00
ARM_CM3 Move configASSERT default definition above before including portable.h. (#1185) 2024-11-04 16:35:52 +05:30
ARM_CM4_MPU Mask MPU region base addresses when writing to MPU_RBAR on ARM_CM3/4 2026-08-31 16:34:46 +02:00
ARM_CM4F Move configASSERT default definition above before including portable.h. (#1185) 2024-11-04 16:35:52 +05:30
ARM_CM7 Move configASSERT default definition above before including portable.h. (#1185) 2024-11-04 16:35:52 +05:30