Skip to content

wolfBoot hardening: PCI BAR restore, DICE zeroization, FIT bounds, and CT-compare fixes#823

Open
aidangarske wants to merge 5 commits into
wolfSSL:masterfrom
aidangarske:fenrir-defects
Open

wolfBoot hardening: PCI BAR restore, DICE zeroization, FIT bounds, and CT-compare fixes#823
aidangarske wants to merge 5 commits into
wolfSSL:masterfrom
aidangarske:fenrir-defects

Conversation

@aidangarske

Copy link
Copy Markdown
Member
F-6561, F-6568, F-6593, F-6562, F-6589

@aidangarske aidangarske self-assigned this Jul 10, 2026
Copilot AI review requested due to automatic review settings July 10, 2026 01:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Hardening-focused update across wolfBoot’s PCI enumeration, FIT image loading, DICE handling, and constant-time verification logic, with new unit tests to prevent regressions in key failure paths.

Changes:

  • Fix PCI 64-bit BAR failure cleanup to restore both BAR dwords (and add coverage for the non-“too much memory” failure path).
  • Add bounds enforcement for uncompressed FIT subimages copied into a caller-provided buffer (plus a regression unit test).
  • Reduce sensitive-data exposure risk via DICE digest/hash zeroization and a more optimization-resistant constant-time compare accumulator.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tools/unit-tests/unit-pci.c Adds a unit test ensuring 64-bit BAR upper dword is restored on a non-“too much memory” failure path.
tools/unit-tests/unit-fit-gzip.c Adds a unit test verifying oversized uncompressed (“none”) FIT subimages are rejected when exceeding out_max.
src/pci.c Restores 64-bit BAR high dword via unified restore_bar: path to avoid leaving probe masks behind.
src/fdt.c Enforces out_max bound for uncompressed payload memcpy to prevent overflow; improves failure behavior.
src/dice/dice.c Zeroizes hash contexts and derived digests after UEID derivation to reduce sensitive-data lifetime.
src/wolfhsm_flash_hal.c Uses a volatile accumulator in constant-time compare to reduce risk of compiler “helpfulness” altering behavior.
options.mk Emits a build-time warning when WOLFBOOT_SKIP_BOOT_VERIFY=1 is enabled, clarifying security impact.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tools/unit-tests/unit-fit-gzip.c
@aidangarske aidangarske marked this pull request as ready for review July 10, 2026 01:08
@aidangarske aidangarske requested a review from danielinux July 10, 2026 01:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants