Skip to content

Improve U-Boot's TPM handling in the non-EFI case

Ludwig Nussel u-boot 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest6 patches 6 repliesIn review
  2. v33 patches 1 replySuperseded
  3. v23 patches 21 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v13 patches4 repliesSuperseded

Changes in v4 from the cover letter

- reword commit message
- include Ilias' patches for unifying event logs in the series

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6test: include mapmem.h explicitlytest/boot/measurement.c+1 -00 replies
2/6tpm: print all PCRs from pcr_readcmd/tpm-v2.c test/py/tests/test_tpm2.py+53 -252 replies
3/6tpm: allocate tpm event log if missingboot/bootm.c boot/image-fdt.c include/tpm-common.h +3 more+188 -411 reply
4/6tpm: unify the tcg2 eventlog structuresinclude/tpm_tcg2.h lib/efi_loader/efi_tcg2.c+34 -411 reply
5/6tpm: unify the eventlog initializationinclude/tpm_tcg2.h lib/efi_loader/efi_tcg2.c lib/tpm_tcg2.c+21 -560 replies
6/6Fix tcg2_measurement_init calllib/efi_loader/efi_tcg2.c+2 -52 replies

Reviews trailers per patch

2 of 6 patches have a Reviewed-by or Acked-by.

PatchSimon GlassIlias Apalodimas
1/6R-b
2/6A-b
3/6
4/6
5/6
6/6

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH v4 0/6] Improve U-Boot's TPM handling in the non-EFI case

With EFI U-Boot always allocates a buffer for the TPM event log. If a previous bootloader stage started an event log, U-Boot would copy the entries to that allocated buffer.

Without EFI U-Boot wants to reuse the event log memory from a previous bootloader stage instead. If U-Boot is first component to start the event log, e.g. when used in qemu there would be no memory allocated for the event log.

So allocate memory in tcg2_log_prepare_buffer() if no event log was found and no buffer was allocated already.
Also copy the address of the event log into the device tree for the kernel so the event log is accessible from Linux userspace too.

Changes in v4:
- reword commit message
- include Ilias' patches for unifying event logs in the series

Changes in v3:
- fix test failure
- sync description with cover letter

Changes in v2:
- fix return value handling
- imply DEVRES in config TPM
- use fdt_getprop for reading property
- don't wrap #include in #if
- fix memory leak in error case of tcg2_log_prepare_buffer
- handle NULL elog parameter in tcg2_measurement_term
- use CONFIG_TPM2_EVENT_LOG_SIZE
- pass log_size instead of position in dt

Ilias Apalodimas (2):
tpm: unify the tcg2 eventlog structures
tpm: unify the eventlog initialization

Ludwig Nussel (4):
test: include mapmem.h explicitly
tpm: print all PCRs from pcr_read
tpm: allocate tpm event log if missing
Fix tcg2_measurement_init call

 boot/bootm.c               |  18 ++---
 boot/image-fdt.c           |  69 +++++++++++++++++
 cmd/tpm-v2.c               |  69 ++++++++++++-----
 include/tpm-common.h       |   2 +
 include/tpm_tcg2.h         |  44 +++++------
 lib/Kconfig                |   1 +
 lib/efi_loader/efi_tcg2.c  |  97 +++++-------------------
 lib/tpm_tcg2.c             | 151 ++++++++++++++++++++++++++++++-------
 test/boot/measurement.c    |   1 +
 test/py/tests/test_tpm2.py |   9 +--
 10 files changed, 296 insertions(+), 165 deletions(-)
Signature · 4 lines
2.43.0

base-commit: 3cdce049f90d77c3f9221f1eb73922384c8972c3
branch: us-tpm4