Files
arm-trusted-firmware/services
Jayanth Dodderi ChidanandandManish V Badarkhe 85a78631bf fix(el3-spmc): prevent integer overflow in memory overlap validation
The overlap validation in overlapping_memory_regions() performed
page_count * PAGE_SIZE_4KB using 32-bit arithmetic, which could
overflow for large page_count values and result in incorrect
overlap detection.

This change:
- Casts page_count to uint64_t before multiplication to ensure
  correct 64-bit arithmetic.
- Adds explicit overflow guards for the multiplication.
- Uses check_u64_overflow() to detect wrap-around before computing
  region_end.

This prevents validation bypass due to integer overflow and
strengthens arithmetic robustness in EL3 SPMC memory transaction
handling.

Signed-off-by: Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com>
Change-Id: I7b16a3267f1fefafa3207b7d66fd6fb8aa30b417
(cherry picked from commit 6a4449471f)
2026-06-02 21:16:44 +01:00
..
2025-07-09 14:55:07 +01:00