← Documents Documentation/ABI/stable/sysfs-class-tpm GitHub 원문 ↗

Linux 6.18.37 · ABI / stable

TPM class stable sysfs ABI

TPM active·enabled·owned 상태, command cancel, capability·duration·timeout, PCR snapshot·hash bank, endorsement key와 TCG major version을 설명합니다.

Source pathDocumentation/ABI/stable/sysfs-class-tpm
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

TPM state와 capability

sysfs-class-tpm:1-84

Chip command 수락 상태, vendor cancel, manufacturer·version, command duration, OS visibility와 ownership을 다룹니다.

PCR과 public endorsement key

sysfs-class-tpm:86-159

TPM 1.x PCR snapshot과 manufacture-time endorsement key의 RSA parameter·modulus 형식을 다룹니다.

Temporary state, timeout과 TPM 2 PCR

sysfs-class-tpm:161-210

Temporary deactivation, interface timeout, TCG major version과 hash bank별 compact PCR 값을 다룹니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 What: /sys/class/tpm/tpmX/device/
2 Date: April 2005
3 KernelVersion: 2.6.12
5 Description: The device/ directory under a specific TPM instance exposes
6 the properties of that TPM chip
7
8
9 What: /sys/class/tpm/tpmX/device/active
10 Date: April 2006
11 KernelVersion: 2.6.17
13 Description: The "active" property prints a '1' if the TPM chip is accepting
14 commands. An inactive TPM chip still contains all the state of
15 an active chip (Storage Root Key, NVRAM, etc), and can be
16 visible to the OS, but will only accept a restricted set of
17 commands. See the TPM Main Specification part 2, Structures,
18 section 17 for more information on which commands are
19 available.
20
21 What: /sys/class/tpm/tpmX/device/cancel
22 Date: June 2005
23 KernelVersion: 2.6.13
25 Description: The "cancel" property allows you to cancel the currently
26 pending TPM command. Writing any value to cancel will call the
27 TPM vendor specific cancel operation.
28
29 What: /sys/class/tpm/tpmX/device/caps
30 Date: April 2005
31 KernelVersion: 2.6.12
33 Description: The "caps" property contains TPM manufacturer and version info.
34
35 Example output::
36
37 Manufacturer: 0x53544d20
38 TCG version: 1.2
39 Firmware version: 8.16
40
41 Manufacturer is a hex dump of the 4 byte manufacturer info
42 space in a TPM. TCG version shows the TCG TPM spec level that
43 the chip supports. Firmware version is that of the chip and
44 is manufacturer specific.
45
46 What: /sys/class/tpm/tpmX/device/durations
47 Date: March 2011
48 KernelVersion: 3.1
50 Description: The "durations" property shows the 3 vendor-specific values
51 used to wait for a short, medium and long TPM command. All
52 TPM commands are categorized as short, medium or long in
53 execution time, so that the driver doesn't have to wait
54 any longer than necessary before starting to poll for a
55 result.
56
57 Example output::
58
59 3015000 4508000 180995000 [original]
60
61 Here the short, medium and long durations are displayed in
62 usecs. "[original]" indicates that the values are displayed
63 unmodified from when they were queried from the chip.
64 Durations can be modified in the case where a buggy chip
65 reports them in msec instead of usec and they need to be
66 scaled to be displayed in usecs. In this case "[adjusted]"
67 will be displayed in place of "[original]".
68
69 What: /sys/class/tpm/tpmX/device/enabled
70 Date: April 2006
71 KernelVersion: 2.6.17
73 Description: The "enabled" property prints a '1' if the TPM chip is enabled,
74 meaning that it should be visible to the OS. This property
75 may be visible but produce a '0' after some operation that
76 disables the TPM.
77
78 What: /sys/class/tpm/tpmX/device/owned
79 Date: April 2006
80 KernelVersion: 2.6.17
82 Description: The "owned" property produces a '1' if the TPM_TakeOwnership
83 ordinal has been executed successfully in the chip. A '0'
84 indicates that ownership hasn't been taken.
85
86 What: /sys/class/tpm/tpmX/device/pcrs
87 Date: April 2005
88 KernelVersion: 2.6.12
90 Description: The "pcrs" property will dump the current value of all Platform
91 Configuration Registers in the TPM. Note that since these
92 values may be constantly changing, the output is only valid
93 for a snapshot in time.
94
95 Example output::
96
97 PCR-00: 3A 3F 78 0F 11 A4 B4 99 69 FC AA 80 CD 6E 39 57 C3 3B 22 75
98 PCR-01: 3A 3F 78 0F 11 A4 B4 99 69 FC AA 80 CD 6E 39 57 C3 3B 22 75
99 PCR-02: 3A 3F 78 0F 11 A4 B4 99 69 FC AA 80 CD 6E 39 57 C3 3B 22 75
100 PCR-03: 3A 3F 78 0F 11 A4 B4 99 69 FC AA 80 CD 6E 39 57 C3 3B 22 75
101 PCR-04: 3A 3F 78 0F 11 A4 B4 99 69 FC AA 80 CD 6E 39 57 C3 3B 22 75
102 ...
103
104 The number of PCRs and hex bytes needed to represent a PCR
105 value will vary depending on TPM chip version. For TPM 1.1 and
106 1.2 chips, PCRs represent SHA-1 hashes, which are 20 bytes
107 long. Use the "caps" property to determine TPM version.
108
109 What: /sys/class/tpm/tpmX/device/pubek
110 Date: April 2005
111 KernelVersion: 2.6.12
113 Description: The "pubek" property will return the TPM's public endorsement
114 key if possible. If the TPM has had ownership established and
115 is version 1.2, the pubek will not be available without the
116 owner's authorization. Since the TPM driver doesn't store any
117 secrets, it can't authorize its own request for the pubek,
118 making it unaccessible. The public endorsement key is gener-
119 ated at TPM manufacture time and exists for the life of the
120 chip.
121
122 Example output::
123
124 Algorithm: 00 00 00 01
125 Encscheme: 00 03
126 Sigscheme: 00 01
127 Parameters: 00 00 08 00 00 00 00 02 00 00 00 00
128 Modulus length: 256
129 Modulus:
130 B4 76 41 82 C9 20 2C 10 18 40 BC 8B E5 44 4C 6C
131 3A B2 92 0C A4 9B 2A 83 EB 5C 12 85 04 48 A0 B6
132 1E E4 81 84 CE B2 F2 45 1C F0 85 99 61 02 4D EB
133 86 C4 F7 F3 29 60 52 93 6B B2 E5 AB 8B A9 09 E3
134 D7 0E 7D CA 41 BF 43 07 65 86 3C 8C 13 7A D0 8B
135 82 5E 96 0B F8 1F 5F 34 06 DA A2 52 C1 A9 D5 26
136 0F F4 04 4B D9 3F 2D F2 AC 2F 74 64 1F 8B CD 3E
137 1E 30 38 6C 70 63 69 AB E2 50 DF 49 05 2E E1 8D
138 6F 78 44 DA 57 43 69 EE 76 6C 38 8A E9 8E A3 F0
139 A7 1F 3C A8 D0 12 15 3E CA 0E BD FA 24 CD 33 C6
140 47 AE A4 18 83 8E 22 39 75 93 86 E6 FD 66 48 B6
141 10 AD 94 14 65 F9 6A 17 78 BD 16 53 84 30 BF 70
142 E0 DC 65 FD 3C C6 B0 1E BF B9 C1 B5 6C EF B1 3A
143 F8 28 05 83 62 26 11 DC B4 6B 5A 97 FF 32 26 B6
144 F7 02 71 CF 15 AE 16 DD D1 C1 8E A8 CF 9B 50 7B
145 C3 91 FF 44 1E CF 7C 39 FE 17 77 21 20 BD CE 9B
146
147 Possible values::
148
149 Algorithm: TPM_ALG_RSA (1)
150 Encscheme: TPM_ES_RSAESPKCSv15 (2)
151 TPM_ES_RSAESOAEP_SHA1_MGF1 (3)
152 Sigscheme: TPM_SS_NONE (1)
153 Parameters, a byte string of 3 u32 values:
154 Key Length (bits): 00 00 08 00 (2048)
155 Num primes: 00 00 00 02 (2)
156 Exponent Size: 00 00 00 00 (0 means the
157 default exp)
158 Modulus Length: 256 (bytes)
159 Modulus: The 256 byte Endorsement Key modulus
160
161 What: /sys/class/tpm/tpmX/device/temp_deactivated
162 Date: April 2006
163 KernelVersion: 2.6.17
165 Description: The "temp_deactivated" property returns a '1' if the chip has
166 been temporarily deactivated, usually until the next power
167 cycle. Whether a warm boot (reboot) will clear a TPM chip
168 from a temp_deactivated state is platform specific.
169
170 What: /sys/class/tpm/tpmX/device/timeouts
171 Date: March 2011
172 KernelVersion: 3.1
174 Description: The "timeouts" property shows the 4 vendor-specific values
175 for the TPM's interface spec timeouts. The use of these
176 timeouts is defined by the TPM interface spec that the chip
177 conforms to.
178
179 Example output::
180
181 750000 750000 750000 750000 [original]
182
183 The four timeout values are shown in usecs, with a trailing
184 "[original]" or "[adjusted]" depending on whether the values
185 were scaled by the driver to be reported in usec from msecs.
186
187 What: /sys/class/tpm/tpmX/tpm_version_major
188 Date: October 2019
189 KernelVersion: 5.5
191 Description: The "tpm_version_major" property shows the TCG spec major version
192 implemented by the TPM device.
193
194 Example output::
195
196 2
197
198 What: /sys/class/tpm/tpmX/pcr-<H>/<N>
199 Date: March 2021
200 KernelVersion: 5.12
202 Description: produces output in compact hex representation for PCR
203 number N from hash bank H. N is the numeric value of
204 the PCR number and H is the crypto string
205 representation of the hash
206
207 Example output::
208
209 cat /sys/class/tpm/tpm0/pcr-sha256/7
210 2ED93F199692DC6788EFA6A1FE74514AB9760B2A6CEEAEF6C808C13E4ABB0D42
211

3. 한국어 전문 번역

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

TPM instance, active와 command cancel

1-27

모든 attribute의 contact는 [email protected]다. /sys/class/tpm/tpmX/device/는 2005년 4월 kernel 2.6.12에 도입됐으며 특정 TPM chip의 속성을 노출한다.

경로도입의미
.../device/active2006년 4월 · kernel 2.6.17TPM chip이 command를 받으면 1이다. Inactive chip도 Storage Root Key, NVRAM 등 active chip의 모든 state를 보유하고 OS에 보일 수 있지만 제한된 command만 받는다. 가능한 command는 TPM Main Specification part 2 Structures section 17을 참조한다.
.../device/cancel2005년 6월 · kernel 2.6.13현재 pending TPM command를 취소한다. 임의 값을 쓰면 vendor별 cancel operation을 호출한다.

Manufacturer capability와 command duration

29-67

caps는 2005년 4월 kernel 2.6.12에 도입됐고 TPM manufacturer와 version 정보를 제공한다.

Manufacturer: 0x53544d20
TCG version: 1.2
Firmware version: 8.16

Manufacturer는 TPM의 4-byte manufacturer information space를 hex dump한 값이다. TCG version은 chip이 지원하는 TCG TPM specification level이고 firmware version은 manufacturer별 chip version이다.

durations는 2011년 3월 kernel 3.1에 도입됐으며 short, medium, long TPM command를 기다리는 vendor별 세 값을 표시한다. 모든 TPM command는 실행 시간에 따라 세 종류로 분류되어 driver가 필요 이상 기다리지 않고 result polling을 시작할 수 있다.

3015000 4508000 180995000 [original]

세 duration은 microsecond다. original은 chip에서 조회한 값을 수정하지 않았다는 뜻이다. Buggy chip이 microsecond 대신 millisecond로 보고해 microsecond 표시를 위해 scale하면 adjusted가 표시된다.

Enabled와 ownership

69-84
경로도입의미
.../device/enabled2006년 4월 · kernel 2.6.17TPM chip이 enabled되어 OS에 보여야 하면 1이다. TPM을 disable하는 operation 뒤에도 property는 보이면서 0을 출력할 수 있다.
.../device/owned2006년 4월 · kernel 2.6.17Chip에서 TPM_TakeOwnership ordinal을 성공적으로 실행했으면 1, ownership을 얻지 않았으면 0이다.

TPM 1.x PCR snapshot

86-107

pcrs는 2005년 4월 kernel 2.6.12에 도입됐으며 TPM의 모든 Platform Configuration Register 현재 값을 dump한다. 값은 계속 변할 수 있어 출력은 한 시점의 snapshot으로만 유효하다.

PCR-00: 3A 3F 78 0F 11 A4 B4 99 69 FC AA 80 CD 6E 39 57 C3 3B 22 75
PCR-01: 3A 3F 78 0F 11 A4 B4 99 69 FC AA 80 CD 6E 39 57 C3 3B 22 75
PCR-02: 3A 3F 78 0F 11 A4 B4 99 69 FC AA 80 CD 6E 39 57 C3 3B 22 75
PCR-03: 3A 3F 78 0F 11 A4 B4 99 69 FC AA 80 CD 6E 39 57 C3 3B 22 75
PCR-04: 3A 3F 78 0F 11 A4 B4 99 69 FC AA 80 CD 6E 39 57 C3 3B 22 75
...

PCR 수와 PCR 하나를 나타내는 hex byte 수는 TPM chip version에 따라 다르다. TPM 1.1과 1.2의 PCR은 길이 20 byte인 SHA-1 hash다. TPM version은 caps로 확인한다.

Public endorsement key

109-159

pubek는 가능한 경우 TPM public endorsement key를 반환한다. TPM 1.2에서 ownership이 설정된 경우 owner authorization 없이는 사용할 수 없다. TPM driver는 secret을 저장하지 않으므로 자체 request를 authorize할 수 없어 pubek에 접근할 수 없다. Public endorsement key는 TPM 제조 때 생성되고 chip 수명 동안 존재한다.

Algorithm: 00 00 00 01
Encscheme: 00 03
Sigscheme: 00 01
Parameters: 00 00 08 00 00 00 00 02 00 00 00 00
Modulus length: 256
Modulus:
B4 76 41 82 C9 20 2C 10 18 40 BC 8B E5 44 4C 6C
3A B2 92 0C A4 9B 2A 83 EB 5C 12 85 04 48 A0 B6
1E E4 81 84 CE B2 F2 45 1C F0 85 99 61 02 4D EB
86 C4 F7 F3 29 60 52 93 6B B2 E5 AB 8B A9 09 E3
D7 0E 7D CA 41 BF 43 07 65 86 3C 8C 13 7A D0 8B
82 5E 96 0B F8 1F 5F 34 06 DA A2 52 C1 A9 D5 26
0F F4 04 4B D9 3F 2D F2 AC 2F 74 64 1F 8B CD 3E
1E 30 38 6C 70 63 69 AB E2 50 DF 49 05 2E E1 8D
6F 78 44 DA 57 43 69 EE 76 6C 38 8A E9 8E A3 F0
A7 1F 3C A8 D0 12 15 3E CA 0E BD FA 24 CD 33 C6
47 AE A4 18 83 8E 22 39 75 93 86 E6 FD 66 48 B6
10 AD 94 14 65 F9 6A 17 78 BD 16 53 84 30 BF 70
E0 DC 65 FD 3C C6 B0 1E BF B9 C1 B5 6C EF B1 3A
F8 28 05 83 62 26 11 DC B4 6B 5A 97 FF 32 26 B6
F7 02 71 CF 15 AE 16 DD D1 C1 8E A8 CF 9B 50 7B
C3 91 FF 44 1E CF 7C 39 FE 17 77 21 20 BD CE 9B
Field가능한 값·구조
AlgorithmTPM_ALG_RSA (1)
EncschemeTPM_ES_RSAESPKCSv15 (2) 또는 TPM_ES_RSAESOAEP_SHA1_MGF1 (3)
SigschemeTPM_SS_NONE (1)
Parameters세 u32 byte string: Key Length 00 00 08 00(2048 bit), Num primes 00 00 00 02(2), Exponent Size 00 00 00 00(0은 default exponent)
Modulus Length256 byte
Modulus256-byte Endorsement Key modulus

Temporary deactivation과 interface timeout

161-185

temp_deactivated는 2006년 4월 kernel 2.6.17에 도입됐다. Chip이 보통 다음 power cycle까지 임시 비활성화됐으면 1이다. Warm boot가 이 상태를 지우는지는 platform마다 다르다.

timeouts는 2011년 3월 kernel 3.1에 도입됐으며 TPM interface specification timeout 네 개의 vendor별 값을 표시한다. 사용 방법은 chip이 따르는 TPM interface specification이 정의한다.

750000 750000 750000 750000 [original]

네 값은 microsecond이며, driver가 millisecond 값을 microsecond로 scale했는지에 따라 끝에 original 또는 adjusted가 붙는다.

TCG major version과 hash bank PCR

187-210

tpm_version_major는 2019년 10월 kernel 5.5에 도입됐으며 TPM device가 구현한 TCG specification major version을 표시한다. 예시는 2다.

/sys/class/tpm/tpmX/pcr-<H>/<N>은 2021년 3월 kernel 5.12에 도입됐다. Hash bank H의 PCR number N을 compact hexadecimal로 출력한다. N은 PCR number의 숫자 값이고 H는 hash를 나타내는 crypto 문자열이다.

cat /sys/class/tpm/tpm0/pcr-sha256/7
2ED93F199692DC6788EFA6A1FE74514AB9760B2A6CEEAEF6C808C13E4ABB0D42