Skip to content

Fixes 20260415 - fix finding from static analysis#751

Merged
dgarske merged 10 commits intowolfSSL:masterfrom
danielinux:fixes-20260415
Apr 16, 2026
Merged

Fixes 20260415 - fix finding from static analysis#751
dgarske merged 10 commits intowolfSSL:masterfrom
danielinux:fixes-20260415

Conversation

@danielinux
Copy link
Copy Markdown
Member

F/2278 - Zeroize PolicySign key buffer before free (61731ca)
F/2589 - keygen_lms: zero LmsKey after free (91e0b16)
F/2254 - Block rollback fallback in non-flash update paths (1359aac)
F/1896 - tools/tpm: write policy output in binary mode (d4f062a)

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Addresses multiple static analysis findings and hardens update paths against rollback to older firmware versions, while improving key material handling and TPM policy file output correctness.

Changes:

  • Add “no downgrade” enforcement across RAM, disk, and HW-swap boot/update selection logic (when ALLOW_DOWNGRADE is not defined).
  • Zeroize sensitive key buffers/structures before freeing (TPM PolicySign buffer; LMS key struct).
  • Write TPM policy output files in binary mode and update unit tests to expect panic/deny behavior for rollback scenarios.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tools/unit-tests/unit-update-ram.c Updates RAM update unit tests to expect rollback denial/panic; renames rollback test.
tools/unit-tests/unit-update-ram-nofixed.c Renames and updates “nofixed” RAM test to expect rollback denial/panic.
tools/unit-tests/unit-update-disk.c Adds a disk update test for rollback denial after higher-version failure; adds mock failure injection.
tools/tpm/policy_sign.c Zeroizes PolicySign temp buffer before free; writes policy output in binary mode.
tools/tpm/policy_create.c Writes policy output in binary mode.
tools/keytools/keygen.c Zeroizes LMS key struct after freeing key internals.
src/update_ram.c Blocks selecting a lower-version partition when a higher version exists (unless ALLOW_DOWNGRADE).
src/update_flash_hwswap.c Adds rollback-denial check in HW-swap start path (unless ALLOW_DOWNGRADE).
src/update_disk.c Adds rollback-denial check in disk start path (unless ALLOW_DOWNGRADE).
src/libwolfboot.c Prevents TESTING fallback to a lower version (unless ALLOW_DOWNGRADE).

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

Comment thread src/update_flash_hwswap.c
Comment thread src/libwolfboot.c
Comment thread tools/unit-tests/unit-update-ram.c
Comment thread tools/unit-tests/unit-update-ram-nofixed.c Outdated
Comment thread src/update_ram.c Outdated
Copilot AI review requested due to automatic review settings April 15, 2026 16:32
Copy link
Copy Markdown

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Choose a reason for hiding this comment

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

Fenrir Automated Review — PR #751

Scan targets checked: wolfboot-bugs, wolfboot-consttime, wolfboot-defaults, wolfboot-mutation, wolfboot-proptest, wolfboot-src, wolfboot-zeroize

Findings: 4
4 finding(s) posted as inline comments (see file-level comments below)

This review was generated automatically by Fenrir. Findings are non-blocking.

Comment thread src/update_disk.c
Comment thread src/libwolfboot.c
Comment thread src/update_flash_hwswap.c
Comment thread tools/unit-tests/unit-update-disk.c
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated 6 comments.


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

Comment thread src/update_ram.c Outdated
Comment thread src/update_flash_hwswap.c Outdated
Comment thread src/update_flash_hwswap.c Outdated
Comment thread src/update_disk.c Outdated
Comment thread tools/unit-tests/unit-update-ram-nofixed.c Outdated
Comment thread src/update_ram.c Outdated
Copilot AI review requested due to automatic review settings April 15, 2026 17:01
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated 6 comments.


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

Comment thread src/update_disk.c Outdated
Comment thread src/libwolfboot.c Outdated
Comment thread tools/unit-tests/unit-update-ram-nofixed.c Outdated
Comment thread tools/unit-tests/unit-update-ram-nofixed.c Outdated
Comment thread src/update_ram.c Outdated
Comment thread src/update_ram.c
Copilot AI review requested due to automatic review settings April 15, 2026 21:21
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated 4 comments.


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

Comment thread tools/unit-tests/unit-update-ram-nofixed.c
Comment thread src/update_flash_hwswap.c
Comment thread src/update_ram.c
Comment thread .github/workflows/test-sunnyday-simulator.yml
@dgarske dgarske merged commit 053d169 into wolfSSL:master Apr 16, 2026
373 checks passed
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.

5 participants