-
Notifications
You must be signed in to change notification settings - Fork 94
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
AzTdxVtpm get_evidence report_data maximum length #765
Comments
It seems like this is related to this PR. Azure vTPM has a different max size for the report data, but it should still significantly larger than 11 bytes |
cc @mkulke |
I'm a bit confused because by default the trustee report data is a sha384 digest. this is being tested e.g. here with real tdx hardware. so, it should be able to accept larger report_data than 11 bytes? it doesn't accept 64 bytes due to issues in libtss, but maybe there is an issue with exactly 12 bytes... would 48 bytes work? In any case the attester is merely calling the relevant crate's function, can you open an issue upstream? |
Interesting. In the default case we pass This could be about parallelism. Does it work with something like:
|
I opened an issue upstream - kinvolk/azure-cvm-tooling#61 Inside that issue are some more thoughts on what might be happening. TLDR it seems like there is some tpm statefulness that isn't accounted for, and running |
thanks for pointing this out. I think the problem is indeed that the nv_index is not found, then allocated with a certain buffer size initially (11 bytes) and then on the 2nd attempt we do find the nv_index and attempt to write 12 bytes to it. this might or might not be fixable without introducing state, let's see. In general fetching multiple attestation report in quick succession will get us into trouble, since you might get a stale report. new attestation reports take up to 3s to be generated and in the meantime you could retrieve stale reports with outdated reportdata. we probably have to protect this with a mutex or something. note: the report_data you pass into get_evidence will not end up 1:1 in an azure td/snp report, it will be mixed w/ vm metadata and hashed. In trustee's attestation service we don't verify report_data in a td report in the az-tdx-vtpm verifier (it is relevant for ITA, an alternative attestation-service that can be integrated w/ trustee). the report_data is also passed as a nonce to the tpm quote, and we verify that one. I think a workaround for the time being would be to use a fixed size/padded report_data buffer across invocations of get_evidence(). would that work for you? |
Thank you for the extra advice regarding fetching reports in quick succession and how report data is used. For now the workaround you mentioned is good enough. The main reason this was blocking was the very first time I ran the code a while ago I picked the input randomly, and since the first input was only 11 bytes I couldn't transition to a 32 byte hash. Now that I know how to clear buffer I should be unblocked. Though fixing the bug would help future users who might hit the same pitfall |
yup, this should get fixed and I think there's a fix. but I think in the scope of this repo we can close this issue, since we use fixed report_data sizes. agree? |
Describe the bug
It seems like the AzTdxVtpmAttester has an issue with its get_evidence function where it can only take 11 bytes of report_data. However, based on the TDX_REPORT_DATA_SIZE constant it should be able to take 64 bytes.
How to reproduce
Running the following tests in attestation-agent/attester/src/az_tdx_vtpm/mod.rs will reproduce the error.
Only attest_11_bytes will pass
CoCo version information
guest-components v0.10.0
What TEE are you seeing the problem on
AzTdxVtpm
Failing command and relevant log output
The text was updated successfully, but these errors were encountered: