-
Notifications
You must be signed in to change notification settings - Fork 6
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
PCR event vs PCR extend #137
Comments
SummaryAfter reviewing the TPM Carte Blanche1 write-up shared by Luto and investigating what risks and concerns there might be with using TPM2_PCR_EVENT, I have come to the conclusion that it would be safe with one caveat. TPM Carte BlancheFirst, to address the TPM Carte Blanche attack, such an attack is not feasible against DRTM. The crux of the attack was two-fold:
Both of those conditions must be met to achieved, and most certainly the first will not occur for a DRTM launch, and guidance is given in the TXT spec as to which algorithms will be used in the launch. The reason the first will never happen is that when the DL Event occurs, the CPU will use the _TPM_Hash_Start/_TPM_Hash_Data/_TPM_Hash_End TPM2_PCR_EVENTThe approach of using TPM2_PCR_EVENT in mathematical form would be: From a meta-analysis standpoint, if one accepts the scenario is that the attackers only has the ability to manipulate the input data, the question becomes what must they do to create a dubious measurement result. The answer is that they must in fact find a pair of co-incidental collisions in both
With this understanding, it would hold that SHA2-512 would be the most resilient to either conditions. ConclusionThe TPM Carte Blanche attack is not a relevant factor that must be considered in regard to the issue raised around algorithm agility concerns. While it is not a valid concern with respect to algorithm agility, agility itself is worth a consideration, especially if the solution might reduce code size/complexity for the implementation. Based on the analysis provided above, only having to support SHA2-512 in the setup kernel and relying on TPM2_PCR_EVENT in the mainline kernel to ensure all PCR banks are extended is an acceptable approach. There does not appear to be any perceivable risks, and reduces the number of hash implementations required in the setup kernel. Footnotes |
libstb, used by OpenPOWER firmware, uses yet another approach: they calculate SHA2-512 and use first bytes (20 for SHA1, 32 for SHA2-256) of the result to extend SHA1 and SHA2-256 PCRs: https://github.com/open-power/skiboot/blob/bc7b85db1e7ef55c8fd0ec3d90c093572b02a153/libstb/trustedboot.c#L250-L257. This has the same advantage of requiring only one function for calculating the digest, but I'm unable to say if this is mathematically sound. |
This issue is to track the proposed work to switch from using PCR extend commands to PCR event commands per the request from the LKML community. One goal here is to get feedback on the idea in general and the proposed implementation.
For background, the on-list conversation has evolved from talking about SHA-1 to proposing a rather large change of how we handle the TPM events/PCRs in our Secure Launch feature. This came about with the submission of patch set v11 and v12 is dependent on this. We currently use the TPM in the manner that TXT calls performance mode where digests are calculated by software then sent to the TPM with extend calls (as the ACM does in this mode). The PCR_Event approach is like the TXT agile mode, where the raw data is send to the TPM and it internally computes the hash for all open banks. This latter approach is what is being proposed as a better approach than our current one.
The PCR_Event approach would require a number of changes. This is one idea of how this could be implemented:
There are a couple of downsides to doing this in general:
The final thing (and perhaps the most important one) is whether the TrenchBoot project members think this is a worthwhile undertaking. The current method we use is viable per the TXT specification though we could add SHA-384 and SM3 to bring the Secure Launch feature up to parity with the algorithms that recent ACMs support. The big issue here is can we make a convincing argument that the existing approach is reasonable, not insecure and works as we intended it to.
The text was updated successfully, but these errors were encountered: