feat(attest): TSM provider detection and path overrides#782
Merged
Conversation
Detect TDX through configfs TSM providers as well as /dev/tdx_guest, and allow CCEL/RTMR/configfs paths to be overridden via environment variables. Also recognize tdx_guest* providers in dstack-prepare.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves guest attestation “platform detection” and configurability by recognizing TSM configfs providers (in addition to legacy devices) and by adding environment-variable overrides for key TDX/CCEL paths. It also exposes a helper to decode raw CCEL buffers and updates dstack-prepare to detect TDX/SEV via TSM providers.
Changes:
- Add TSM provider detection for TDX/SEV in
dstack-prepareand usetdx_attest::is_tdx_available()for mode selection indstack-attest. - Add/extend environment overrides for quote/configfs, RTMR sysfs base, and CCEL file path; add
decode_ccel()API and tests. - Add unit tests and supporting dev dependency (
tempfile) for configfs provider verification.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| os/common/rootfs/dstack-prepare.sh | Detects TDX/SEV via /dev/* or configfs TSM providers. |
| dstack/tdx-attest/src/linux.rs | Adds is_tdx_available(), configfs “authoritative override” behavior, and RTMR sysfs path override logic + tests. |
| dstack/tdx-attest/src/dummy.rs | Adds stub is_tdx_available() for non-linux/non-x86_64 targets. |
| dstack/tdx-attest/Cargo.toml | Adds tempfile for tests. |
| dstack/dstack-attest/src/attestation.rs | Uses tdx_attest::is_tdx_available() for mode detection. |
| dstack/cc-eventlog/src/tdx.rs | Exposes decode_ccel() and adds a test against bundled CCEL sample. |
| dstack/cc-eventlog/src/tcg.rs | Adds DSTACK_CCEL_FILE override support when reading CCEL. |
| dstack/Cargo.lock | Locks new dev dependency resolution. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
1 task
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.
Summary
Foundational guest attestation path improvements, independent of any simulator:
/dev/tdx_guestor atdx_guest*configfs TSM provider (tdx_attest::is_tdx_available)dstack-attestmode selectionDCAP_TDX_QUOTE_CONFIGFS_PATH(authoritative; no silent fallback)DCAP_TDX_RTMR_SYSFS_PATHDSTACK_CCEL_FILEcc_eventlog::tdx::decode_ccelfor decoding a raw CCEL bufferdstack-prepareto recognizetdx_guest*/sev_guest*TSM providers the same wayThese changes keep production device defaults unchanged and make the production guest path work correctly when TDX is only visible through TSM configfs (including a development-only FUSE provider).
Test plan
cargo test -p tdx-attest -p cc-eventlog -p dstack-attestbash -n os/common/rootfs/dstack-prepare.sh(syntax only; prepare logic is small)