-
Notifications
You must be signed in to change notification settings - Fork 17
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
preinstall: Add checks for platform firmware protections #316
Merged
chrisccoulson
merged 6 commits into
canonical:master
from
chrisccoulson:preinstall-add-check-fw-protection
Aug 20, 2024
Merged
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
de39165
preinstall: Add checks for platform firmware protections
chrisccoulson 2c66c8e
preinstall: Add an UnsupportedPlatformError type
chrisccoulson 893f028
preinstall: explain the check for SMX on Intel
chrisccoulson ea45bbc
preinstall: remove the flags result from checkPlatformFirmwareProtection
chrisccoulson 4cafa96
preinstall: fix a typo
chrisccoulson b353807
preinstall: move errors to their own file
chrisccoulson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -98,7 +98,19 @@ func checkPlatformFirmwareProtections(env internal_efi.HostEnvironment, log *tcg | |
return 0, fmt.Errorf("encountered an error when determining platform firmware protections using Intel MEI: %w", err) | ||
} | ||
if amd64Env.HasCPUIDFeature(cpuid.SMX) { | ||
// The Intel TXT spec says that locality 3 is only available to ACMs | ||
// The Intel TXT spec says that locality 4 is basically only avilable | ||
// to microcode, and is locked before handing over to an ACM which | ||
// has access to locality 3. Access to this is meant to be locked at the | ||
// hardware level before running non-Intel code, although I'm not sure if | ||
// this is only relevant in the D-CRTM case where the SINIT ACM has access | ||
//to locality 3, and it locks access to it, leaving access to localities 2 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. strange formatting There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks like this one was already fixed in a recent push I made |
||
// and 1 to the measured launch environment and dynamic OS respectively. We | ||
// rely on the property of locality 3 being protected somewhat in order to | ||
// attempt to mitigate discrete TPM reset attacks on Intel platforms (basically | ||
// by including PCR0 in the policy, even though it's otherwise useless to include | ||
// it, but locality 3 access is required in order to reconstruct PCR0 after a TPM | ||
// reset. Mark locality 3 as protected if we have the right instructions for | ||
// implementing a D-CRTM with Intel TXT (which I think is SMX). | ||
result |= platformFirmwareProtectionsTPMLocality3IsProtected | ||
} | ||
case cpuVendorAMD: | ||
|
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: available
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've fixed this now.