diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2020-08-03 19:34:09 +0300 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2020-08-03 19:34:09 +0300 |
commit | 92b7e4923fdbeda9b86b1398127449d5353f9123 (patch) | |
tree | b5c59aaf0d436c19fe3f534bcba05c08105c7864 /include/linux | |
parent | c6fe44d96fc1536af5b11cd859686453d1b7bfd1 (diff) | |
parent | 85467f63a05c43364ba0b90d0c05bb89191543fa (diff) | |
download | linux-92b7e4923fdbeda9b86b1398127449d5353f9123.tar.xz |
Merge tag 'tpmdd-next-v5.9' of git://git.infradead.org/users/jjs/linux-tpmdd
Pull tpm updates from Jarkko Sakkinen:
"An issue was fixed with the TPM space buffer size. The buffer is used
to store in-TPM objects while swapped out of the TPM for a /dev/tpmrm0
session. The code incorrectly used PAGE_SIZE, which obviously can
vary. With these changes the buffer has a fixed size of 16 kB.
In addition, this contains support for acquiring TPM even log from
TPM2 ACPI table. This method is used by QEMU in particular"
* tag 'tpmdd-next-v5.9' of git://git.infradead.org/users/jjs/linux-tpmdd:
tpm: Add support for event log pointer found in TPM2 ACPI table
acpi: Extend TPM2 ACPI table with missing log fields
tpm: Unify the mismatching TPM space buffer sizes
tpm: Require that all digests are present in TCG_PCR_EVENT2 structures
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/tpm.h | 1 | ||||
-rw-r--r-- | include/linux/tpm_eventlog.h | 11 |
2 files changed, 10 insertions, 2 deletions
diff --git a/include/linux/tpm.h b/include/linux/tpm.h index 03e9b184411b..8f4ff39f51e7 100644 --- a/include/linux/tpm.h +++ b/include/linux/tpm.h @@ -96,6 +96,7 @@ struct tpm_space { u8 *context_buf; u32 session_tbl[3]; u8 *session_buf; + u32 buf_size; }; struct tpm_bios_log { diff --git a/include/linux/tpm_eventlog.h b/include/linux/tpm_eventlog.h index 64356b199e94..739ba9a03ec1 100644 --- a/include/linux/tpm_eventlog.h +++ b/include/linux/tpm_eventlog.h @@ -211,9 +211,16 @@ static inline int __calc_tpm2_event_size(struct tcg_pcr_event2_head *event, efispecid = (struct tcg_efi_specid_event_head *)event_header->event; - /* Check if event is malformed. */ + /* + * Perform validation of the event in order to identify malformed + * events. This function may be asked to parse arbitrary byte sequences + * immediately following a valid event log. The caller expects this + * function to recognize that the byte sequence is not a valid event + * and to return an event size of 0. + */ if (memcmp(efispecid->signature, TCG_SPECID_SIG, - sizeof(TCG_SPECID_SIG)) || count > efispecid->num_algs) { + sizeof(TCG_SPECID_SIG)) || + !efispecid->num_algs || count != efispecid->num_algs) { size = 0; goto out; } |