Skip to content

[rom_ext,dice] Add hash integrity check for DICE pages #27424

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: earlgrey_1.0.0
Choose a base branch
from

Conversation

sasdf
Copy link
Contributor

@sasdf sasdf commented Jun 12, 2025

This PR fixes:


This PR adds a hash digest to the end of the certificate info pages to ensure data integrity.

ROM_EXT verifies the hash digest during the boot process and clears the page if it is corrupted. This allows the ROM_EXT to regenerate a new certificate chain.

Implementing the integrity check in the mutable ROM_EXT keeps the immutable section simple and flexible. If a page is corrupted, the ROM_EXT triggers a reboot.

By default, this hash is added to the Factory and DICE pages, while the Ext0 and Ext1 pages have it disabled. SKU extensions can enable it if needed.


Since the e2e test requires imm_section skip signing when valid, this change is stacked over:

@sasdf sasdf marked this pull request as ready for review June 12, 2025 13:00
@sasdf sasdf requested a review from a team as a code owner June 12, 2025 13:00
Copy link
Contributor

@cfrantz cfrantz left a comment

Choose a reason for hiding this comment

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

This looks pretty good; just a few comments about handling the digest.

sasdf added 2 commits June 13, 2025 08:58
Change-Id: Ia980fc98dcf088500c179d746fc235de5b0db105
Signed-off-by: Yi-Hsuan Deng <yhdeng@google.com>
The UDS, now located on the dedicated Factory page for all SKUs (X509/CWT),
we no longer requires this skip.

Change-Id: I34f16b9db049cc71658116d06d07f545cf9f0d84
Signed-off-by: Yi-Hsuan Deng <yhdeng@google.com>
@sasdf sasdf force-pushed the mgT4d8106a7 branch 2 times, most recently from 646bfcd to b5b80a9 Compare June 13, 2025 02:50
Change-Id: Iea8c8d2315d466a396d5d1064b8b77a48fb28e30
Signed-off-by: Yi-Hsuan Deng <yhdeng@google.com>
@sasdf sasdf requested a review from cfrantz June 13, 2025 03:17
Copy link
Contributor

@cfrantz cfrantz left a comment

Choose a reason for hiding this comment

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

LGTM. @timothytrippel to review the perso changes.

sasdf added 4 commits June 14, 2025 01:58
Adds a hash to the CDI cache page to ensure its integrity after an update,
mitigating corruption risks from resets or partial write.

Change-Id: I163b994dd4b4c218a8791c5701e4c40341cda8fc
Signed-off-by: Yi-Hsuan Deng <yhdeng@google.com>
This change introduces a flash page hash checksum similar to the one in ROM_EXT,
applicable to both UDS and CDI pages.

Change-Id: Ic4764bc3bda79cecd5faef31f1efa562f1c758a1
Signed-off-by: Yi-Hsuan Deng <yhdeng@google.com>
This change validates the integrity hash of the CDI page and regenerates the
page if it is found to be corrupted.

Change-Id: Id5ab836cf1dd3e1a10dd27a19cd948d0b7c8abc4
Signed-off-by: Yi-Hsuan Deng <yhdeng@google.com>
Change-Id: I4d8106a7b8b80d8199766323cc0e1a152cf8276b
Signed-off-by: Yi-Hsuan Deng <yhdeng@google.com>
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.

2 participants