Skip to content

PCR event vs PCR extend #137

@rossphilipson

Description

@rossphilipson

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:

  • Have the early SL stub code in the setup kernel use a hash algorithm (e.g, SHA 512) to hash all the items in the policy specified (command line, boot params, initramfs, etc).
  • Modify the SLRT policy to have an updatable field for storing this hash. The SL early stub code would no longer update the DRTM log as it does.
  • Modify the slmodule event processing code to send all the hashes from the policy to the TPM using TPM_Event which in turn will return all the digests that it produced.
  • After the updates, the slmodule would append the DRTM log with each event and its digest ID.
  • Add TPM_Event support to the existing TPM Linux driver.

There are a couple of downsides to doing this in general:

  • The PCR events will be based off of hashes of the data not the original data. Taking hashes of hashes increases the likelihood of collisions.
  • There are significant code changes to achieve this. In addition, the SLRT interface would need to change to accommodate this.
  • It is not clear how to handle TPM 1.2 platforms since they don't have a PCR_Event command. The same method could be used (i.e. take an early SHA 512 hash) or the data can be hashed/extended directly using SHA-1. In either case, the SHA-1 patch would still be needed it seems.
  • Adding support for doing PCR_Event to the Linux TPM driver is not trivial and this will mean more TPM patches that the TPM maintainers have to sign off on.
  • Hashing anything using hardware support in the TPM is a slow process.
  • It is not clear if there are any issues with AMD/SKINIT and this approach.

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.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions