← Documents Documentation/security/tpm/tpm_event_log.rst GitHub 원문 ↗

Linux 6.18.37 · Security

TPM Event Log

PCR measurement event log의 attestation 역할과 EFI stub custom table·UEFI final events table 결합 과정을 설명합니다.

Source pathDocumentation/security/tpm/tpm_event_log.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약·해설

tpm_event_log.rst:1-55

PCR measurement event log의 attestation 역할과 EFI stub custom table·UEFI final events table 결합 과정을 설명합니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 .. SPDX-License-Identifier: GPL-2.0
2
3 =============
4 TPM Event Log
5 =============
6
7 This document briefly describes what TPM log is and how it is handed
8 over from the preboot firmware to the operating system.
9
10 Introduction
11 ============
12
13 The preboot firmware maintains an event log that gets new entries every
14 time something gets hashed by it to any of the PCR registers. The events
15 are segregated by their type and contain the value of the hashed PCR
16 register. Typically, the preboot firmware will hash the components to
17 who execution is to be handed over or actions relevant to the boot
18 process.
19
20 The main application for this is remote attestation and the reason why
21 it is useful is nicely put in the very first section of [1]:
22
23 "Attestation is used to provide information about the platform’s state
24 to a challenger. However, PCR contents are difficult to interpret;
25 therefore, attestation is typically more useful when the PCR contents
26 are accompanied by a measurement log. While not trusted on their own,
27 the measurement log contains a richer set of information than do the PCR
28 contents. The PCR contents are used to provide the validation of the
29 measurement log."
30
31 UEFI event log
32 ==============
33
34 UEFI provided event log has a few somewhat weird quirks.
35
36 Before calling ExitBootServices() Linux EFI stub copies the event log to
37 a custom configuration table defined by the stub itself. Unfortunately,
38 the events generated by ExitBootServices() don't end up in the table.
39
40 The firmware provides so called final events configuration table to sort
41 out this issue. Events gets mirrored to this table after the first time
42 EFI_TCG2_PROTOCOL.GetEventLog() gets called.
43
44 This introduces another problem: nothing guarantees that it is not called
45 before the Linux EFI stub gets to run. Thus, it needs to calculate and save the
46 final events table size while the stub is still running to the custom
47 configuration table so that the TPM driver can later on skip these events when
48 concatenating two halves of the event log from the custom configuration table
49 and the final events table.
50
51 References
52 ==========
53
54 - [1] https://trustedcomputinggroup.org/resource/pc-client-specific-platform-firmware-profile-specification/
55 - [2] The final concatenation is done in drivers/char/tpm/eventlog/efi.c
56

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

Event log 전달 개요

1-9

이 문서는 TPM log가 무엇이며 preboot firmware에서 operating system으로 어떻게 전달되는지 간단히 설명한다. 원문은 GPL-2.0 SPDX 식별자를 포함한다.

TPM event log 전달
Preboot firmware가 component 측정PCR에 hash 반영Event log entry 작성EFI stub가 log 보존OS TPM driver가 log 공개

부팅 전 측정 기록을 operating system의 TPM driver로 넘긴다.

.. SPDX-License-Identifier: GPL-2.0

=============
TPM Event Log
=============

This document briefly describes what TPM log is and how it is handed
over from the preboot firmware to the operating system.

PCR 측정 기록과 remote attestation

10-30

Preboot firmware는 어떤 항목을 PCR register에 hash할 때마다 새 entry를 event log에 추가한다. Event는 type별로 구분되며 hash가 반영된 PCR register 값을 담는다. 보통 실행을 넘겨받을 component나 boot 과정과 관련된 action을 측정한다.

주요 용도는 remote attestation이다. PCR content만으로는 의미를 해석하기 어렵지만 measurement log를 함께 제공하면 platform state에 관한 풍부한 정보를 challenger에게 전달할 수 있다.

Measurement log 자체는 단독으로 신뢰하지 않는다. 대신 PCR content가 log의 validation 근거가 된다. 즉 상세 event 기록과 TPM이 보호한 누적 PCR 값을 함께 대조해 측정 이력을 검증한다.

Attestation 자료
자료장점신뢰 역할
PCR contentsTPM이 보호한 누적 측정값measurement log 검증
Measurement logcomponent·event별 상세 정보PCR과 일치할 때 해석 가능

PCR과 measurement log가 서로 보완하는 역할을 정리한다.

Introduction
============

The preboot firmware maintains an event log that gets new entries every
time something gets hashed by it to any of the PCR registers. The events
are segregated by their type and contain the value of the hashed PCR
register. Typically, the preboot firmware will hash the components to
who execution is to be handed over or actions relevant to the boot
process.

The main application for this is remote attestation and the reason why
it is useful is nicely put in the very first section of [1]:

"Attestation is used to provide information about the platform’s state
to a challenger. However, PCR contents are difficult to interpret;
therefore, attestation is typically more useful when the PCR contents
are accompanied by a measurement log. While not trusted on their own,
the measurement log contains a richer set of information than do the PCR
contents. The PCR contents are used to provide the validation of the
measurement log."

UEFI log와 final events 결합

31-50

UEFI event log에는 특이한 동작이 있다. Linux EFI stub는 `ExitBootServices()`를 호출하기 전에 event log를 stub가 정의한 custom configuration table로 복사하지만, `ExitBootServices()` 자체가 만든 event는 이 table에 들어가지 않는다.

Firmware는 이를 보완하려고 final events configuration table을 제공한다. `EFI_TCG2_PROTOCOL.GetEventLog()`가 처음 호출된 뒤 발생한 event는 이 final table에도 mirror된다.

하지만 Linux EFI stub보다 먼저 다른 주체가 `GetEventLog()`를 호출하지 않았다는 보장이 없다. Stub는 실행 중 final events table의 당시 크기를 계산해 custom configuration table에 저장해야 한다. 이후 TPM driver가 custom table과 final table이라는 log의 두 절반을 이어 붙일 때 이미 포함된 event를 건너뛰어 중복을 피한다.

UEFI event log 결합
GetEventLog 최초 호출 가능Final events mirroring 시작EFI stub가 현재 final table 크기 저장ExitBootServices event가 final table에 기록TPM driver가 custom table 읽기저장한 크기만큼 final table을 skip나머지 final events 연결

두 table에 겹친 event를 크기 기준으로 건너뛰고 하나의 log로 만든다.

UEFI event log
==============

UEFI provided event log has a few somewhat weird quirks.

Before calling ExitBootServices() Linux EFI stub copies the event log to
a custom configuration table defined by the stub itself. Unfortunately,
the events generated by ExitBootServices() don't end up in the table.

The firmware provides so called final events configuration table to sort
out this issue. Events gets mirrored to this table after the first time
EFI_TCG2_PROTOCOL.GetEventLog() gets called.

This introduces another problem: nothing guarantees that it is not called
before the Linux EFI stub gets to run. Thus, it needs to calculate and save the
final events table size while the stub is still running to the custom
configuration table so that the TPM driver can later on skip these events when
concatenating two halves of the event log from the custom configuration table
and the final events table.

사양과 구현 위치

51-55

Remote attestation과 firmware event log 정의는 TCG PC Client Specific Platform Firmware Profile Specification을 참조한다. 두 log 부분의 최종 결합 구현은 `drivers/char/tpm/eventlog/efi.c`에 있다.

Event log 참고 자료
자료내용
TCG firmware profilePCR measurement log와 attestation 정의
drivers/char/tpm/eventlog/efi.ccustom·final event table 결합

사양과 kernel 구현 위치를 구분한다.

References
==========

- [1] https://trustedcomputinggroup.org/resource/pc-client-specific-platform-firmware-profile-specification/
- [2] The final concatenation is done in drivers/char/tpm/eventlog/efi.c