]> git.ipfire.org Git - thirdparty/u-boot.git/commit
fdt_region: Check return value of fdt_get_property_by_offset() calls
authorAnton Ivanov <anton@binarly.io>
Tue, 2 Jun 2026 18:30:17 +0000 (19:30 +0100)
committerTom Rini <trini@konsulko.com>
Fri, 12 Jun 2026 21:35:56 +0000 (15:35 -0600)
commit7304d569e61521e04625bfbded894f2e5fbe4409
treee264c33b824c3152e55530527074bd557f57f1bd
parente73328612534e81b41d0363fad9a7b4385cd3d39
fdt_region: Check return value of fdt_get_property_by_offset() calls

fdt_get_property_by_offset() returns NULL for FDT with version
less than 0x10. fdt_find_regions() dereferences the result without
checking, leading to a NULL pointer dereference during signature
verification of an untrusted FIT. fdt_add_alias_regions() and
fdt_next_region() also lack validation.

Add NULL checks before accessing the returned property pointer.
Also add a missing NULL check for fdt_string() in
fdt_add_alias_regions() and fdt_next_region().

Signed-off-by: Anton Ivanov <anton@binarly.io>
boot/fdt_region.c