[PATCH v2 0/7] mkimage: Detect FIT image load address overlaps and fix related test/DTS issues
Nishanth Menon
nm at ti.com
Wed Sep 24 13:37:33 CEST 2025
On 10:59-20250914, Aristo Chen wrote:
> This patch series enhances FIT image robustness by adding **memory
> region overlap detection** to `mkimage` and fixing existing overlaps
> in DTS files and `binman` tests.
>
> The primary goal is to prevent runtime memory corruption from
> conflicting load addresses in FIT images.
>
> Key Changes:
>
> 1. `mkimage` Overlap Detection: A new validation in
> `tools/fit_image.c` checks for overlapping load addresses
> within FIT configurations. `mkimage` now errors out with
> detailed info on conflicts, preventing bad FIT image creation.
>
> 2. New Test Case: A Python test verifies the new detection.
> It intentionally creates an overlap (kernel and FDT)
> to confirm correct error handling.
>
> 3. Fixes for Existing Overlaps:
> * Board DTS (k3-am6xx): Adjusted load addresses for TI
> firmware stubs to prevent conflicts. This resolves
> previously undetected overlaps.
> * `binman` Tests: Fixed several tests. U-Boot load
> addresses were shifted to avoid ATF conflicts. A new
> linker script for TEE ELF sections ensures distinct
> memory layouts.
>
> 4. Documentation: Added guidance for developers on how to
> determine ELF load addresses using readelf, linker scripts,
> and objdump when working with binman FIT images.
>
> Impact:
>
> This series improves FIT image reliability by catching overlaps
> at build time, helping developers resolve issues before runtime
> failures.
>
> ### Changes in v2:
> - Fixed typo in test case name (testFitSignNoSignatureNodes)
> - Added fixes for additional k3-am642 DTS files
> - Added comprehensive documentation for ELF load address determination
> - Enhanced copyright notice in elf_sections_tee.lds
>
> Aristo Chen (7):
> binman: Fix typo for the test case name
> binman: Fix FIT image overlap issues
> binman: Fix FIT image overlap issues for testFitSplitElf
> arm: dts: k3-am6xx: Fix FIT image memory overlap in binman
> configurations
> tools: mkimage: detect overlapping load regions in FIT configurations
> test: Add test case for FIT image load address overlap detection
> doc: binman: Add guidance for determining ELF load addresses
>
> arch/arm/dts/k3-am625-phycore-som-binman.dtsi | 22 ++---
> arch/arm/dts/k3-am625-sk-binman.dtsi | 16 ++--
> .../dts/k3-am625-verdin-wifi-dev-binman.dtsi | 16 ++--
> arch/arm/dts/k3-am62a-phycore-som-binman.dtsi | 10 +--
> arch/arm/dts/k3-am62a-sk-binman.dtsi | 4 +-
> arch/arm/dts/k3-am642-phycore-som-binman.dtsi | 6 +-
> test/py/tests/test_fit_mkimage_validate.py | 65 ++++++++++++++
> tools/binman/entries.rst | 18 ++++
> tools/binman/ftest.py | 4 +-
> .../test/276_fit_firmware_loadables.dts | 4 +-
> tools/binman/test/340_fit_signature.dts | 4 +-
> tools/binman/test/342_fit_signature.dts | 4 +-
> tools/binman/test/Makefile | 6 +-
> tools/binman/test/elf_sections_tee.c | 1 +
> tools/binman/test/elf_sections_tee.lds | 32 +++++++
> tools/fit_image.c | 90 ++++++++++++++++++-
> tools/mkimage.c | 3 +-
> 17 files changed, 257 insertions(+), 48 deletions(-)
> create mode 120000 tools/binman/test/elf_sections_tee.c
> create mode 100644 tools/binman/test/elf_sections_tee.lds
>
> --
> 2.43.0
>
Looks like i see a build regression in linux-next after this series.
https://gist.github.com/nmenon/b2fc9e7680cc296062c7dced94105f76
--
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3 1A34 DDB5 849D 1736 249D
https://ti.com/opensource
More information about the U-Boot
mailing list