| 1e2714bb | 26-Jan-2023 |
Eddie James <[email protected]> |
tpm: Add reserved memory event log
Some platforms may desire to pass the event log up to Linux in the form of a reserved memory region. In particular, this is desirable for embedded systems or baseb
tpm: Add reserved memory event log
Some platforms may desire to pass the event log up to Linux in the form of a reserved memory region. In particular, this is desirable for embedded systems or baseboard management controllers (BMCs) booting with U-Boot. IBM OpenBMC BMCs will be the first user. Add support for the reserved memory in the TPM core to find the region and map it.
Signed-off-by: Eddie James <[email protected]> [jarkko: removed spurious dev_info()'s from tpm_read_log_memory_region()] Reviewed-by: Jarkko Sakkinen <[email protected]> [yang: return -ENOMEM when devm_memremap() fails] Signed-off-by: Yang Yingliang <[email protected]> Signed-off-by: Jarkko Sakkinen <[email protected]>
show more ...
|
| 9716ac65 | 10-Mar-2021 |
Stefan Berger <[email protected]> |
tpm: vtpm_proxy: Avoid reading host log when using a virtual device
Avoid allocating memory and reading the host log when a virtual device is used since this log is of no use to that driver. A virtu
tpm: vtpm_proxy: Avoid reading host log when using a virtual device
Avoid allocating memory and reading the host log when a virtual device is used since this log is of no use to that driver. A virtual device can be identified through the flag TPM_CHIP_FLAG_VIRTUAL, which is only set for the tpm_vtpm_proxy driver.
Cc: [email protected] Fixes: 6f99612e2500 ("tpm: Proxy driver for supporting multiple emulated TPMs") Signed-off-by: Stefan Berger <[email protected]> Reviewed-by: Jarkko Sakkinen <[email protected]> Signed-off-by: Jarkko Sakkinen <[email protected]>
show more ...
|
| 3dcd1566 | 10-Mar-2021 |
Stefan Berger <[email protected]> |
tpm: acpi: Check eventlog signature before using it
Check the eventlog signature before using it. This avoids using an empty log, as may be the case when QEMU created the ACPI tables, rather than pr
tpm: acpi: Check eventlog signature before using it
Check the eventlog signature before using it. This avoids using an empty log, as may be the case when QEMU created the ACPI tables, rather than probing the EFI log next. This resolves an issue where the EFI log was empty since an empty ACPI log was used.
Cc: [email protected] Fixes: 85467f63a05c ("tpm: Add support for event log pointer found in TPM2 ACPI table") Signed-off-by: Stefan Berger <[email protected]> Reviewed-by: Jarkko Sakkinen <[email protected]> Signed-off-by: Jarkko Sakkinen <[email protected]>
show more ...
|
| 5cb2ace9 | 12-Mar-2020 |
Stefan Berger <[email protected]> |
tpm: of: Handle IBM,vtpm20 case when getting log parameters
A vTPM 2.0 is identified by 'IBM,vtpm20' in the 'compatible' node in the device tree. Handle it in the same way as 'IBM,vtpm'.
The vTPM 2
tpm: of: Handle IBM,vtpm20 case when getting log parameters
A vTPM 2.0 is identified by 'IBM,vtpm20' in the 'compatible' node in the device tree. Handle it in the same way as 'IBM,vtpm'.
The vTPM 2.0's log is written in little endian format so that for this aspect we can rely on existing code.
Signed-off-by: Stefan Berger <[email protected]> Acked-by: Nayna Jain <[email protected]> Tested-by: Nayna Jain <[email protected]> Reviewed-by: Jarkko Sakkinen <[email protected]> Signed-off-by: Jarkko Sakkinen <[email protected]>
show more ...
|
| f9bf8adb | 25-Feb-2020 |
Vasily Averin <[email protected]> |
tpm: tpm2_bios_measurements_next should increase position index
If .next function does not change position index, following .show function will repeat output related to current position index.
For
tpm: tpm2_bios_measurements_next should increase position index
If .next function does not change position index, following .show function will repeat output related to current position index.
For /sys/kernel/security/tpm0/binary_bios_measurements: 1) read after lseek beyound end of file generates whole last line. 2) read after lseek to middle of last line generates expected end of last line and unexpected whole last line once again.
Cc: [email protected] # 4.19.x Fixes: 1f4aace60b0e ("fs/seq_file.c: simplify seq_file iteration code ...") Link: https://bugzilla.kernel.org/show_bug.cgi?id=206283 Signed-off-by: Vasily Averin <[email protected]> Reviewed-by: Jarkko Sakkinen <[email protected]> Signed-off-by: Jarkko Sakkinen <[email protected]>
show more ...
|
| d7a47b96 | 25-Feb-2020 |
Vasily Averin <[email protected]> |
tpm: tpm1_bios_measurements_next should increase position index
If .next function does not change position index, following .show function will repeat output related to current position index.
In c
tpm: tpm1_bios_measurements_next should increase position index
If .next function does not change position index, following .show function will repeat output related to current position index.
In case of /sys/kernel/security/tpm0/ascii_bios_measurements and binary_bios_measurements: 1) read after lseek beyound end of file generates whole last line. 2) read after lseek to middle of last line generates expected end of last line and unexpected whole last line once again.
Cc: [email protected] # 4.19.x Fixes: 1f4aace60b0e ("fs/seq_file.c: simplify seq_file iteration code ...") Link: https://bugzilla.kernel.org/show_bug.cgi?id=206283 Signed-off-by: Vasily Averin <[email protected]> Reviewed-by: Jarkko Sakkinen <[email protected]> Signed-off-by: Jarkko Sakkinen <[email protected]>
show more ...
|
| 166a2809 | 07-Jun-2019 |
Matthew Garrett <[email protected]> |
tpm: Don't duplicate events from the final event log in the TCG2 log
After the first call to GetEventLog() on UEFI systems using the TCG2 crypto agile log format, any further log events (other than
tpm: Don't duplicate events from the final event log in the TCG2 log
After the first call to GetEventLog() on UEFI systems using the TCG2 crypto agile log format, any further log events (other than those triggered by ExitBootServices()) will be logged in both the main log and also in the Final Events Log. While the kernel only calls GetEventLog() immediately before ExitBootServices(), we can't control whether earlier parts of the boot process have done so. This will result in log entries that exist in both logs, and so the current approach of simply appending the Final Event Log to the main log will result in events being duplicated.
We can avoid this problem by looking at the size of the Final Event Log just before we call ExitBootServices() and exporting this to the main kernel. The kernel can then skip over all events that occured before ExitBootServices() and only append events that were not also logged to the main log.
Signed-off-by: Matthew Garrett <[email protected]> Reported-by: Joe Richey <[email protected]> Suggested-by: Joe Richey <[email protected]> Acked-by: Ard Biesheuvel <[email protected]> Reviewed-by: Jarkko Sakkinen <[email protected]> Tested-by: Jarkko Sakkinen <[email protected]> Signed-off-by: Jarkko Sakkinen <[email protected]>
show more ...
|
| fe7eb023 | 20-May-2019 |
Matthew Garrett <[email protected]> |
tpm: Append the final event log to the TPM event log
Any events that are logged after GetEventsLog() is called are logged to the EFI Final Events table. These events are defined as being in the cryp
tpm: Append the final event log to the TPM event log
Any events that are logged after GetEventsLog() is called are logged to the EFI Final Events table. These events are defined as being in the crypto agile log format, so we can just append them directly to the existing log if it's in the same format. In theory we can also construct old-style SHA1 log entries for devices that only return logs in that format, but EDK2 doesn't generate the final event log in that case so it doesn't seem worth it at the moment.
Signed-off-by: Matthew Garrett <[email protected]> Reviewed-by: Bartosz Szczepanek <[email protected]> Tested-by: Bartosz Szczepanek <[email protected]> Reviewed-by: Jarkko Sakkinen <[email protected]> Tested-by: Jarkko Sakkinen <[email protected]> Signed-off-by: Jarkko Sakkinen <[email protected]>
show more ...
|
| c46f3405 | 20-May-2019 |
Matthew Garrett <[email protected]> |
tpm: Reserve the TPM final events table
UEFI systems provide a boot services protocol for obtaining the TPM event log, but this is unusable after ExitBootServices() is called. Unfortunately ExitBoot
tpm: Reserve the TPM final events table
UEFI systems provide a boot services protocol for obtaining the TPM event log, but this is unusable after ExitBootServices() is called. Unfortunately ExitBootServices() itself triggers additional TPM events that then can't be obtained using this protocol. The platform provides a mechanism for the OS to obtain these events by recording them to a separate UEFI configuration table which the OS can then map.
Unfortunately this table isn't self describing in terms of providing its length, so we need to parse the events inside it to figure out how long it is. Since the table isn't mapped at this point, we need to extend the length calculation function to be able to map the event as it goes along.
(Fixes by Bartosz Szczepanek <[email protected]>)
Signed-off-by: Matthew Garrett <[email protected]> Acked-by: Ard Biesheuvel <[email protected]> Reviewed-by: Bartosz Szczepanek <[email protected]> Tested-by: Bartosz Szczepanek <[email protected]> Reviewed-by: Jarkko Sakkinen <[email protected]> Tested-by: Jarkko Sakkinen <[email protected]> Signed-off-by: Jarkko Sakkinen <[email protected]>
show more ...
|