On 2/8/26 11:37 PM, James Hilliard wrote:
boot_get_fdt_fit() relocates the base FDT with boot_relocate_fdt()
before applying overlays. That uses the bootm memory map and can
overlap with the FIT buffer when the FIT is loaded into RAM, corrupting
data needed to load the kernel and ramdisk.

Allocate a writable copy of the base FDT with memalign() and
fdt_open_into(), grow it as needed for each overlay, and apply the
overlays to this buffer. Also check fdt_pack() errors and free the
temporary overlay copy after each application.

Fixes: 881f0b77dc8c ("image: apply FDTOs on FDT node")
Signed-off-by: James Hilliard <[email protected]>
This code is starting to be super-convoluted. Can you please have a look at [1] and see if that can be somehow extended to cover this ? I think it should trim the complexity, but it likely needs a bit more work.

Thank you

[1] https://lore.kernel.org/u-boot/[email protected]/

Reply via email to