James Hilliard 0b2939464f boot: fit: validate FDT/DTO payload before fdt_open_into()
boot_get_fdt_fit_into_buffer() calls fdt_open_into() for both the
base FDT and overlay DTO blobs loaded from a FIT image.

Those blobs come from FIT payload data. In the overlay path,
fit_image_load() is called with FIT_LOAD_IGNORED, so the IH_TYPE_FLATDT
header check in fit_image_load() is skipped. This leaves fdt_open_into()
to consume header-derived offsets/sizes from unvalidated input.

Validate the full blob against the payload length first with
fdt_check_full(fdtsrcbuf, srclen), then proceed with fdt_totalsize() and
fdt_open_into(). This fixes Coverity CID 644638 (TAINTED_SCALAR).

Fixes: 5ebf0c55a23 ("image: fit: Apply overlays using aligned writable FDT copies")
Link: https://lore.kernel.org/all/20260223195109.GG3233182@bill-the-cat/
Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2026-02-24 10:28:37 -06:00
..
2025-04-03 16:54:49 -06:00
2025-05-30 09:49:32 +01:00
2024-10-18 14:10:22 -06:00
2025-05-30 09:49:32 +01:00
2022-01-19 18:11:34 +01:00
2021-11-11 19:01:56 -05:00
2024-11-14 18:14:06 -06:00
2025-11-22 08:48:13 -06:00
2025-01-22 09:47:49 -06:00