mirror of https://github.com/wolfSSL/wolfBoot.git
fdt_get_string() bounded stroffset against size_dt_strings but formed the string-table pointer from off_dt_strings without ever validating either header field against totalsize; a DTB declaring a large off_dt_strings with a small size_dt_strings made every property lookup (fdt_getprop -> fdt_get_string) scan far outside the blob. Validate the structural layout in fdt_check_header() for finalized (FDT_MAGIC) blobs: the reservation map, structure block and string table must sit inside the blob and not overlap, checked in 64-bit so the size fields cannot wrap. fdt_get_string() now requires a valid header before forming the pointer. The SW_MAGIC (in-progress edit) state keeps its existing check, since its layout is different. Test fixtures are adjusted to the validated layout: the two pre-existing fdt_get_string fixtures now set the header fields the lookup relies on, the compatible-test builder sets the magic word and points the reservation map at the canonical empty list right after the header (it pointed into the string table before). |
||
|---|---|---|
| .. | ||
| armclang | ||
| bin-assemble | ||
| check_config | ||
| ci | ||
| delta | ||
| efi | ||
| elf-parser | ||
| fdt-parser | ||
| keytools | ||
| lms | ||
| openocd | ||
| renode | ||
| sbom | ||
| scripts | ||
| squashelf | ||
| test-expect-version | ||
| test-update-server | ||
| tpm | ||
| uart-flash-server | ||
| unit-tests | ||
| xmss | ||
| config.mk | ||
| test-delta.mk | ||
| test-enc.mk | ||
| test-renode.mk | ||
| test.mk | ||
| wolfboot-rpi-devicetree.diff | ||