diff options
author | Aaron Durbin <adurbin@chromium.org> | 2017-03-08 11:23:11 -0600 |
---|---|---|
committer | Aaron Durbin <adurbin@chromium.org> | 2017-03-09 19:15:03 +0100 |
commit | eeb77379e03d868a52d42cd4f0dfba8d11c3d337 (patch) | |
tree | b9517f0bbaee0ebb310867e5b183dff8ad737a5f /src/vboot/secdata_tpm.c | |
parent | 1b9fc9e801d81fab7e26c0321c638dee83ca44a9 (diff) | |
download | coreboot-eeb77379e03d868a52d42cd4f0dfba8d11c3d337.tar.xz |
vboot/tpm2: enable nvmem commits on cr50 when writing firmware secdata
cr50 by default delays nvmem commits internally from the point of
reset to accumulate change state. However, the factory process can
put a board into dev mode through the recovery screen. This state
is stored in the TPM's nvmem space. When the factory process is
complete a disable_dev_request and battery_cutoff_request is performed.
This leads to disabling the dev mode in TPM, but the battery is
subsequently cut off so the nvmem contents never stick. Therefore,
whenever antirollback_write_space_firmware() is called we know there
was a change in secdata so request cr50 to immediately enable nvmem
commits going forward. This allows state changes to happen immediately.
The fallout from this is that when secdata is changed that current
boot will take longer because every transaction that writes to TPM
nvmem space will perform a write synchronously. All subsequent boots
do not have that effect.
It should also be noted that this approach to the implementation is
a pretty severe layering violation. However, the current TPM APIs
don't lend themselves well to extending commands or re-using code
outside of the current routines which inherently assume all knowledge
of every command (in conflict with vendor commands since those are
vendor-specific by definition).
BUG=b:35775104
BRANCH=reef
TEST=Confirmed disablement of dev mode sticks in the presence of:
crossystem disable_dev_request=1; crossystem
battery_cutoff_request=1; reboot;
Change-Id: I3395db9cbdfea45da1f5cb994c6570978593b944
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/18681
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Tested-by: build bot (Jenkins)
Diffstat (limited to 'src/vboot/secdata_tpm.c')
-rw-r--r-- | src/vboot/secdata_tpm.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/vboot/secdata_tpm.c b/src/vboot/secdata_tpm.c index 4c1e128797..c5d08ce27f 100644 --- a/src/vboot/secdata_tpm.c +++ b/src/vboot/secdata_tpm.c @@ -515,6 +515,8 @@ uint32_t antirollback_read_space_firmware(struct vb2_context *ctx) uint32_t antirollback_write_space_firmware(struct vb2_context *ctx) { + if (IS_ENABLED(CONFIG_CR50_IMMEDIATELY_COMMIT_FW_SECDATA)) + tlcl_cr50_enable_nvcommits(); return write_secdata(FIRMWARE_NV_INDEX, ctx->secdata, VB2_SECDATA_SIZE); } |