-
Notifications
You must be signed in to change notification settings - Fork 100
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
az_snp_vtpm get_evidence report_data maximum length #909
Comments
cc: @mkulke This might be out of scope of guest-components. I guess the AA avoids this because it doesn't allow arbitrary use of the report_data. |
Thanks for that. Is the command |
yeah, so there's an issue in the tss library (which isn't fixable w/o a breaking change, afaik). internally the nonce buffer is of the size of the maximum PCR buffer size (and then +2). So since atm the max PCR bank on the vTPM is sha384, you'll end with 48+2 bytes as the maximum. |
interesting, I wasn't aware of the tool, I suppose it's for debugging. |
Mainly for debugging but could be useful for people building their own attestation protocols. |
Describe the bug
When calculating a TPM quote, there seems to be a discrepancy between the expected size of the buffer and the actual size of the buffer. This discrepancy is causing the TPM to return an error when the input size is larger than 50 bytes.
The maximum allowed size of the buffer for TPM quote qualification data for the
Tss2_Sys_Quote_Prepare
function seems determined by the TPM's maximum digest size. This is typically 32 bytes for SHA-256 and 64 bytes for SHA-512. However, this is not what we observe.Expected Behavior
Running the
evidence_getter
program with the following command should return the az-snp-vtpm evidence (a JSON object containing the TPM quote and the SNP report):Expected output (JSON object with the following format):
How to reproduce
Current Behavior
Running the same command as above returns the following error:
Steps to Reproduce
evidence_getter
program:cd guest-components/attestation-agent/attester cargo build --no-default-features --features bin,az-snp-vtpm-attester --bin evidence_getter
evidence_getter
program with the following command:Note the use of TSS2_LOG to log the internals of the tss2 lib execution. This shows that the error is not caught at the tss API level and is therefore deeper in the stack.
Context (Environment)
This is running on a Confidential Computing VM on Azure (DC-series/DC2as v5).
$ uname -a Linux test-attest-vm 6.8.0-1021-azure #25-Ubuntu SMP Wed Jan 15 20:45:09 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux $ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 24.04.2 LTS Release: 24.04 Codename: noble
NOTE: I have reproduced this issue using the tpm2_quote command on an Ubuntu laptop running Ubuntu 24.10 and also a QEMU VM running Ubuntu 24.04 LTS.
Workaround
A small workaround (that does not actually address the root cause of the issue) prevents the error from occurring. This fix is to reduce the size of the input buffer quote to 50 bytes. This is done by changing the following line in the
evidence_getter
program:guest-components/attestation-agent/attester/src/az_snp_vtpm/mod.rs
Line 36 in 3df6c41
CoCo version information
guest-component [v1.11]
What TEE are you seeing the problem on
AzSnpVtpm
Failing command and relevant log output
The text was updated successfully, but these errors were encountered: