Skip to content

fix(attest): require absolute env path overrides#784

Merged
kvinwang merged 3 commits into
masterfrom
fix/absolute-env-path-overrides
Jul 16, 2026
Merged

fix(attest): require absolute env path overrides#784
kvinwang merged 3 commits into
masterfrom
fix/absolute-env-path-overrides

Conversation

@kvinwang

Copy link
Copy Markdown
Collaborator

Summary

Follow-up to #782 for the Copilot review that landed after the PR was merged:

  • require non-empty absolute paths for DCAP_TDX_QUOTE_CONFIGFS_PATH, DCAP_TDX_RTMR_SYSFS_PATH, and DSTACK_CCEL_FILE
  • invalid configfs overrides do not make is_tdx_available() return true via a relative cwd path
  • RTMR overrides can no longer silently write digests under the process working directory

Test plan

  • cargo test -p tdx-attest -p cc-eventlog

Reject empty and relative values for configfs, RTMR, and CCEL path
overrides so misconfiguration cannot silently use the process cwd.
Copilot AI review requested due to automatic review settings July 16, 2026 02:38
@kvinwang
kvinwang enabled auto-merge July 16, 2026 02:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Tightens attestation-related environment path overrides to require non-empty absolute paths, preventing relative values from accidentally resolving against the process working directory (notably for TDX ConfigFS detection and RTMR sysfs extension paths, and CCEL file decoding).

Changes:

  • Added a shared helper to validate environment path overrides as non-empty and absolute, and applied it to DCAP_TDX_QUOTE_CONFIGFS_PATH and DCAP_TDX_RTMR_SYSFS_PATH.
  • Made is_tdx_available() ignore invalid (e.g., relative) ConfigFS overrides instead of potentially validating against the current working directory.
  • Added DSTACK_CCEL_FILE resolution with explicit rejection of empty/relative overrides, plus targeted unit tests.

Reviewed changes

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

File Description
dstack/tdx-attest/src/linux.rs Adds absolute-path validation for ConfigFS/RTMR env overrides; prevents relative overrides from influencing TDX availability and RTMR behavior; adds tests.
dstack/cc-eventlog/src/tcg.rs Introduces ccel_file_path() to enforce absolute CCEL override paths and adds tests for override/default behavior.

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

Comment thread dstack/cc-eventlog/src/tcg.rs
Comment thread dstack/cc-eventlog/src/tcg.rs
@kvinwang
kvinwang disabled auto-merge July 16, 2026 02:47
kvinwang and others added 2 commits July 16, 2026 10:47
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@kvinwang
kvinwang enabled auto-merge July 16, 2026 02:47
@kvinwang
kvinwang merged commit daea817 into master Jul 16, 2026
15 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.

2 participants