mirror of https://github.com/wolfSSL/wolfBoot.git
In the PT_LOAD range filter, segmentEnd was computed as p_paddr + p_memsz - 1 in uint64_t with no overflow check. Both fields come straight from the (possibly crafted) ELF64 program header. When p_paddr + p_memsz exceeds 2^64 the result wraps below p_paddr: the wrapped end can land back inside the requested range, so a segment whose true span lies entirely outside the range is spuriously included (and the converse can silently drop a valid segment). squashelf would then emit a squashed image that wolfBoot signs and boots. Detect the overflow before computing segmentEnd and treat such a segment as out-of-range. ELF32 cannot overflow a uint64 sum and is unaffected. Adds tools/squashelf/test-range-overflow.py (run via `make test`) which fails before the fix and passes after. |
||
|---|---|---|
| .. | ||
| bin-assemble | ||
| check_config | ||
| delta | ||
| efi | ||
| elf-parser | ||
| fdt-parser | ||
| keytools | ||
| lms | ||
| renode | ||
| 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 | ||