[PATCH 1/1] image: fit: Apply overlays on a writable FDT copy

Marek Vasut marek.vasut at mailbox.org
Mon Feb 9 00:19:08 CET 2026


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 <james.hilliard1 at gmail.com>
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/9e498de5-d114-485e-840e-1395e153edc3@mailbox.org/



More information about the U-Boot mailing list