diff options
author | Ard Biesheuvel <ardb@kernel.org> | 2024-03-08 11:17:07 +0300 |
---|---|---|
committer | Ard Biesheuvel <ardb@kernel.org> | 2024-03-09 13:36:54 +0300 |
commit | 3e0b0f880e9e8f39f433dc6734cff035f9de2c8e (patch) | |
tree | 0c564081c054e8eb4a94dc2cf5e8a777d32a4517 /drivers/firmware/efi/libstub/efistub.h | |
parent | 841c35169323cd833294798e58b9bf63fa4fa1de (diff) | |
download | linux-3e0b0f880e9e8f39f433dc6734cff035f9de2c8e.tar.xz |
efi/libstub: Use TPM event typedefs from the TCG PC Client spec
Our efi_tcg2_tagged_event is not defined in the EFI spec, but it is not
a local invention either: it was taken from the TCG PC Client spec,
where it is called TCG_PCClientTaggedEvent.
Note that this spec also contains some guidance on how to populate it,
which is not being followed closely at the moment; it claims that the
event size should cover the TCG_PCClientTaggedEvent and its payload
only, but it currently covers the preceding efi_tcg2_event too.
However, this directly contradicts the TCG EFI protocol specification,
which states very clearly that the event size should cover the entire
data structure, including the leading efi_tcg2_event_t struct.
So rename the struct and document its provenance, but retain the
existing logic to populate the size field.
Link: https://lore.kernel.org/all/20240308085754.476197-8-ardb+git@google.com
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Diffstat (limited to 'drivers/firmware/efi/libstub/efistub.h')
-rw-r--r-- | drivers/firmware/efi/libstub/efistub.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/firmware/efi/libstub/efistub.h b/drivers/firmware/efi/libstub/efistub.h index c04b82ea40f2..043a3ff435f3 100644 --- a/drivers/firmware/efi/libstub/efistub.h +++ b/drivers/firmware/efi/libstub/efistub.h @@ -843,14 +843,14 @@ struct efi_tcg2_event { /* u8[] event follows here */ } __packed; -struct efi_tcg2_tagged_event { - u32 tagged_event_id; - u32 tagged_event_data_size; - /* u8 tagged event data follows here */ -} __packed; +/* from TCG PC Client Platform Firmware Profile Specification */ +typedef struct tdTCG_PCClientTaggedEvent { + u32 tagged_event_id; + u32 tagged_event_data_size; + u8 tagged_event_data[]; +} TCG_PCClientTaggedEvent; typedef struct efi_tcg2_event efi_tcg2_event_t; -typedef struct efi_tcg2_tagged_event efi_tcg2_tagged_event_t; typedef union efi_tcg2_protocol efi_tcg2_protocol_t; union efi_tcg2_protocol { |