wolfBoot/tools
Daniele Lacamera 2765348e34 F-11035: size the final partial page from remaining bytes in hifive1 write
hal_flash_write() in hal/hifive1.c selected the page path and clamped
the partial-page length from the original total len instead of the
bytes still remaining (len - j). A page-aligned multi-page write that
ended in a partial page therefore took the full-page branch on the
last iteration: it read past the end of the caller's buffer and
programmed a full 256-byte page where only the remaining bytes were
requested, clobbering flash past the update range.

Compute remaining = len - j at the top of the loop and use it for both
the branch test and the rel_len clamp; j still advances only by the
bytes actually consumed (256 on the full-page path, rel_len on the
partial path).

unit-hifive1-flash-write runs the real extracted function against a
mock fespi model (FLASH_BASE points at a flash image buffer,
fespi_write_address/fespi_sw_tx program into it, and the RMW path
reads the image back through FLASH_BASE as on hardware). The
regression case is a 356-byte aligned write: the last page's tail must
stay erased, which fails pre-fix (the over-read bytes are programmed
instead).

Verification:
- Built: riscv-none-elf-gcc 15.2 -fsyntax-only -Wall with ARCH_RISCV:
  clean.
- Tested: unit-hifive1-flash-write 3/3; pre-fix the 356-byte case
  wrote non-erased bytes past offset 356 of the flash image.
  Unaligned single-page RMW and exact-full-page cases unchanged.
- Pitfalls: relative (sub-FLASH_BASE) addresses are accepted as-is by
  the function, which is what the test passes so the 32-bit address
  parameter never carries a 64-bit host pointer.
- Style: cstyle-check.sh flag count on hal/hifive1.c unchanged from
  the pre-change file; the new test trips only the uncrustify
  pointer-alignment class the sibling unit tests trip.
- Message: F-11035: prefix, no co-author trailers.
- Unverified: no HiFive1 board execution.
2026-08-25 08:51:09 +02:00
..
armclang Remove obvious/redundant comments 2026-07-31 16:00:14 +02:00
bin-assemble renesas-rx: fix build for GCC RX 8.3/14.2 2026-07-30 15:32:31 +02:00
check_config Preparing release v2.8.0 + update copyright 2026-04-16 13:11:56 +02:00
ci PolarFire SoC: LPDDR4 DDR init for MPFS250T Video Kit (M-Mode) 2026-08-03 12:27:22 +02:00
delta tools/delta: check pwrite result in bmpatch 2026-07-02 17:01:28 +02:00
efi efi: sign the x86_64_efi reference kernel with an authenticated HDR_CMDLINE 2026-08-10 21:03:50 +02:00
elf-parser Preparing release v2.8.0 + update copyright 2026-04-16 13:11:56 +02:00
fdt-parser Add wolfBoot FIT support for loading bitstream 2026-06-09 15:30:27 +02:00
keytools F-6762: compare the TLV field budget in a 32-bit domain 2026-08-21 08:52:59 +02:00
lms Addressed copilot's comments 2026-04-29 13:15:52 +02:00
openocd Support for MAX32666 2026-07-31 14:33:56 +02:00
renode Addressed copilot's comments 2026-04-28 15:22:41 +02:00
sbom sbom: re-vendor wolfGlass at b44ae8d 2026-08-20 15:22:16 +02:00
scripts c2000: add wolfBoot TI C28x (TMS320F28P550SJ) secure-boot XIP port 2026-08-25 00:01:33 +02:00
squashelf add O_BINARY flag for msys2/windows builds 2026-08-11 08:35:12 -06:00
test-expect-version Fix NRF52 UART DMA and Renode test infrastructure 2026-04-28 15:04:35 +02:00
test-update-server
tpm Address Copilot review comments 2026-06-09 15:52:07 +02:00
uart-flash-server F-5675: fix signed-overflow UB from uint8_t<<24 in serve_update version assembly 2026-06-11 18:53:49 +02:00
unit-tests F-11035: size the final partial page from remaining bytes in hifive1 write 2026-08-25 08:51:09 +02:00
xmss Zeroize XMSS key readback buffer 2026-04-29 12:31:21 +02:00
config.mk Add support for auxillary algorithms and cert chain/TPM usage 2026-07-22 11:47:16 +02:00
test-delta.mk
test-enc.mk
test-renode.mk review: add additional RSA PSS test and bench coverage 2026-04-28 15:02:57 +02:00
test.mk lib/wolfssl: bump to ti_c25 merge (e71b086fc) for CHAR_BIT!=8 wide-byte support 2026-08-25 00:01:33 +02:00
wolfboot-rpi-devicetree.diff