cypress: make the security counter stub fail closed - #2795
Open
flaviens wants to merge 1 commit into
Open
Conversation
The example backend returned a fixed counter value and discarded updates while reporting success. A build that enables MCUBOOT_HW_ROLLBACK_PROT picks this file up automatically, so it linked and ran with a rollback floor that never advanced, with no error at build or boot time. Return errors instead, and document that a persistent platform backend is required before enabling MCUBOOT_HW_ROLLBACK_PROT. Signed-off-by: Flavien Solt <flavien@nus.edu.sg>
There was a problem hiding this comment.
Pull request overview
This PR updates the Cypress example security counter backend to “fail closed” when MCUBOOT_HW_ROLLBACK_PROT is enabled, preventing builds from silently operating with a non-advancing rollback floor due to a non-persistent stub implementation.
Changes:
- Make the Cypress
cy_security_cnt.cstub return failures instead of returning a fixed counter value and reporting success. - Document in the Cypress MCUboot app README that a persistent, monotonic, power-fail-safe backend is required before enabling
MCUBOOT_HW_ROLLBACK_PROT. - Add a release note entry describing the behavioral change.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| docs/release-notes.d/cypress-security-counter-fail-closed.md | Adds a release note explaining the Cypress security counter backend now fails closed. |
| boot/cypress/MCUBootApp/README.md | Documents that the bundled security counter backend is non-persistent and must be replaced before enabling rollback protection. |
| boot/cypress/MCUBootApp/cy_security_cnt.c | Changes the example backend to return errors (fail closed) rather than returning a fixed value and succeeding. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
de-nordic
approved these changes
Jul 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi!
The example backend returned a fixed counter value and discarded updates while reporting success. It linked and ran with a rollback floor that never advanced with no error at build or boot time because a build that enables MCUBOOT_HW_ROLLBACK_PROT picks this file up automatically.
This PR proposes to return errors instead and document that a persistent platform backend is required before enabling MCUBOOT_HW_ROLLBACK_PROT.
Thanks!
Flavien