← Documents Documentation/admin-guide/device-mapper/dm-ima.rst GitHub 원문 ↗

Linux 6.18.37 · Administration / Device Mapper

Device Mapper IMA measurements

Device Mapper lifecycle과 target security attribute를 IMA CRITICAL_DATA event로 측정해 runtime attestation에 사용하는 형식과 예제입니다.

Source pathDocumentation/admin-guide/device-mapper/dm-ima.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

Trust와 공통 record

dm-ima.rst:1-87

외부 attestation을 위한 DM measurement 목적, IMA policy와 ASCII record 형식을 설명합니다.

Device lifecycle event

dm-ima.rst:88-324

Table load, resume, remove, clear, rename event의 metadata·hash·capacity payload를 정리합니다.

지원 target attribute

dm-ima.rst:325-715

cache, crypt, integrity, linear, mirror, multipath, raid, snapshot, striped, verity의 측정 field와 log 예를 설명합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 ======
2 dm-ima
3 ======
4
5 For a given system, various external services/infrastructure tools
6 (including the attestation service) interact with it - both during the
7 setup and during rest of the system run-time. They share sensitive data
8 and/or execute critical workload on that system. The external services
9 may want to verify the current run-time state of the relevant kernel
10 subsystems before fully trusting the system with business-critical
11 data/workload.
12
13 Device mapper plays a critical role on a given system by providing
14 various important functionalities to the block devices using various
15 target types like crypt, verity, integrity etc. Each of these target
16 types’ functionalities can be configured with various attributes.
17 The attributes chosen to configure these target types can significantly
18 impact the security profile of the block device, and in-turn, of the
19 system itself. For instance, the type of encryption algorithm and the
20 key size determines the strength of encryption for a given block device.
21
22 Therefore, verifying the current state of various block devices as well
23 as their various target attributes is crucial for external services before
24 fully trusting the system with business-critical data/workload.
25
26 IMA kernel subsystem provides the necessary functionality for
27 device mapper to measure the state and configuration of
28 various block devices -
29
30 - by device mapper itself, from within the kernel,
31 - in a tamper resistant way,
32 - and re-measured - triggered on state/configuration change.
33
34 Setting the IMA Policy:
35 =======================
36 For IMA to measure the data on a given system, the IMA policy on the
37 system needs to be updated to have following line, and the system needs
38 to be restarted for the measurements to take effect.
39
40 ::
41
42 /etc/ima/ima-policy
43 measure func=CRITICAL_DATA label=device-mapper template=ima-buf
44
45 The measurements will be reflected in the IMA logs, which are located at:
46
47 ::
48
49 /sys/kernel/security/integrity/ima/ascii_runtime_measurements
50 /sys/kernel/security/integrity/ima/binary_runtime_measurements
51
52 Then IMA ASCII measurement log has the following format:
53
54 ::
55
56 <PCR> <TEMPLATE_DATA_DIGEST> <TEMPLATE_NAME> <TEMPLATE_DATA>
57
58 PCR := Platform Configuration Register, in which the values are registered.
59 This is applicable if TPM chip is in use.
60
61 TEMPLATE_DATA_DIGEST := Template data digest of the IMA record.
62 TEMPLATE_NAME := Template name that registered the integrity value (e.g. ima-buf).
63
64 TEMPLATE_DATA := <ALG> ":" <EVENT_DIGEST> <EVENT_NAME> <EVENT_DATA>
65 It contains data for the specific event to be measured,
66 in a given template data format.
67
68 ALG := Algorithm to compute event digest
69 EVENT_DIGEST := Digest of the event data
70 EVENT_NAME := Description of the event (e.g. 'dm_table_load').
71 EVENT_DATA := The event data to be measured.
72
73 |
74
75 | *NOTE #1:*
76 | The DM target data measured by IMA subsystem can alternatively
77 be queried from userspace by setting DM_IMA_MEASUREMENT_FLAG with
78 DM_TABLE_STATUS_CMD.
79
80 |
81
82 | *NOTE #2:*
83 | The Kernel configuration CONFIG_IMA_DISABLE_HTABLE allows measurement of duplicate records.
84 | To support recording duplicate IMA events in the IMA log, the Kernel needs to be configured with
85 CONFIG_IMA_DISABLE_HTABLE=y.
86
87 Supported Device States:
88 ========================
89 Following device state changes will trigger IMA measurements:
90
91 1. Table load
92 #. Device resume
93 #. Device remove
94 #. Table clear
95 #. Device rename
96
97 1. Table load:
98 ---------------
99 When a new table is loaded in a device's inactive table slot,
100 the device information and target specific details from the
101 targets in the table are measured.
102
103 The IMA measurement log has the following format for 'dm_table_load':
104
105 ::
106
107 EVENT_NAME := "dm_table_load"
108 EVENT_DATA := <dm_version_str> ";" <device_metadata> ";" <table_load_data>
109
110 dm_version_str := "dm_version=" <N> "." <N> "." <N>
111 Same as Device Mapper driver version.
112 device_metadata := <device_name> "," <device_uuid> "," <device_major> "," <device_minor> ","
113 <minor_count> "," <num_device_targets> ";"
114
115 device_name := "name=" <dm-device-name>
116 device_uuid := "uuid=" <dm-device-uuid>
117 device_major := "major=" <N>
118 device_minor := "minor=" <N>
119 minor_count := "minor_count=" <N>
120 num_device_targets := "num_targets=" <N>
121 dm-device-name := Name of the device. If it contains special characters like '\', ',', ';',
122 they are prefixed with '\'.
123 dm-device-uuid := UUID of the device. If it contains special characters like '\', ',', ';',
124 they are prefixed with '\'.
125
126 table_load_data := <target_data>
127 Represents the data (as name=value pairs) from various targets in the table,
128 which is being loaded into the DM device's inactive table slot.
129 target_data := <target_data_row> | <target_data><target_data_row>
130
131 target_data_row := <target_index> "," <target_begin> "," <target_len> "," <target_name> ","
132 <target_version> "," <target_attributes> ";"
133 target_index := "target_index=" <N>
134 Represents nth target in the table (from 0 to N-1 targets specified in <num_device_targets>)
135 If all the data for N targets doesn't fit in the given buffer - then the data that fits
136 in the buffer (say from target 0 to x) is measured in a given IMA event.
137 The remaining data from targets x+1 to N-1 is measured in the subsequent IMA events,
138 with the same format as that of 'dm_table_load'
139 i.e. <dm_version_str> ";" <device_metadata> ";" <table_load_data>.
140
141 target_begin := "target_begin=" <N>
142 target_len := "target_len=" <N>
143 target_name := Name of the target. 'linear', 'crypt', 'integrity' etc.
144 The targets that are supported for IMA measurements are documented below in the
145 'Supported targets' section.
146 target_version := "target_version=" <N> "." <N> "." <N>
147 target_attributes := Data containing comma separated list of name=value pairs of target specific attributes.
148
149 For instance, if a linear device is created with the following table entries,
150 # dmsetup create linear1
151 0 2 linear /dev/loop0 512
152 2 2 linear /dev/loop0 512
153 4 2 linear /dev/loop0 512
154 6 2 linear /dev/loop0 512
155
156 Then IMA ASCII measurement log will have the following entry:
157 (converted from ASCII to text for readability)
158
159 10 a8c5ff755561c7a28146389d1514c318592af49a ima-buf sha256:4d73481ecce5eadba8ab084640d85bb9ca899af4d0a122989252a76efadc5b72
160 dm_table_load
161 dm_version=4.45.0;
162 name=linear1,uuid=,major=253,minor=0,minor_count=1,num_targets=4;
163 target_index=0,target_begin=0,target_len=2,target_name=linear,target_version=1.4.0,device_name=7:0,start=512;
164 target_index=1,target_begin=2,target_len=2,target_name=linear,target_version=1.4.0,device_name=7:0,start=512;
165 target_index=2,target_begin=4,target_len=2,target_name=linear,target_version=1.4.0,device_name=7:0,start=512;
166 target_index=3,target_begin=6,target_len=2,target_name=linear,target_version=1.4.0,device_name=7:0,start=512;
167
168 2. Device resume:
169 ------------------
170 When a suspended device is resumed, the device information and the hash of the
171 data from previous load of an active table are measured.
172
173 The IMA measurement log has the following format for 'dm_device_resume':
174
175 ::
176
177 EVENT_NAME := "dm_device_resume"
178 EVENT_DATA := <dm_version_str> ";" <device_metadata> ";" <active_table_hash> ";" <current_device_capacity> ";"
179
180 dm_version_str := As described in the 'Table load' section above.
181 device_metadata := As described in the 'Table load' section above.
182 active_table_hash := "active_table_hash=" <table_hash_alg> ":" <table_hash>
183 Rerpresents the hash of the IMA data being measured for the
184 active table for the device.
185 table_hash_alg := Algorithm used to compute the hash.
186 table_hash := Hash of the (<dm_version_str> ";" <device_metadata> ";" <table_load_data> ";")
187 as described in the 'dm_table_load' above.
188 Note: If the table_load data spans across multiple IMA 'dm_table_load'
189 events for a given device, the hash is computed combining all the event data
190 i.e. (<dm_version_str> ";" <device_metadata> ";" <table_load_data> ";")
191 across all those events.
192 current_device_capacity := "current_device_capacity=" <N>
193
194 For instance, if a linear device is resumed with the following command,
195 #dmsetup resume linear1
196
197 then IMA ASCII measurement log will have an entry with:
198 (converted from ASCII to text for readability)
199
200 10 56c00cc062ffc24ccd9ac2d67d194af3282b934e ima-buf sha256:e7d12c03b958b4e0e53e7363a06376be88d98a1ac191fdbd3baf5e4b77f329b6
201 dm_device_resume
202 dm_version=4.45.0;
203 name=linear1,uuid=,major=253,minor=0,minor_count=1,num_targets=4;
204 active_table_hash=sha256:4d73481ecce5eadba8ab084640d85bb9ca899af4d0a122989252a76efadc5b72;current_device_capacity=8;
205
206 3. Device remove:
207 ------------------
208 When a device is removed, the device information and a sha256 hash of the
209 data from an active and inactive table are measured.
210
211 The IMA measurement log has the following format for 'dm_device_remove':
212
213 ::
214
215 EVENT_NAME := "dm_device_remove"
216 EVENT_DATA := <dm_version_str> ";" <device_active_metadata> ";" <device_inactive_metadata> ";"
217 <active_table_hash> "," <inactive_table_hash> "," <remove_all> ";" <current_device_capacity> ";"
218
219 dm_version_str := As described in the 'Table load' section above.
220 device_active_metadata := Device metadata that reflects the currently loaded active table.
221 The format is same as 'device_metadata' described in the 'Table load' section above.
222 device_inactive_metadata := Device metadata that reflects the inactive table.
223 The format is same as 'device_metadata' described in the 'Table load' section above.
224 active_table_hash := Hash of the currently loaded active table.
225 The format is same as 'active_table_hash' described in the 'Device resume' section above.
226 inactive_table_hash := Hash of the inactive table.
227 The format is same as 'active_table_hash' described in the 'Device resume' section above.
228 remove_all := "remove_all=" <yes_no>
229 yes_no := "y" | "n"
230 current_device_capacity := "current_device_capacity=" <N>
231
232 For instance, if a linear device is removed with the following command,
233 #dmsetup remove l1
234
235 then IMA ASCII measurement log will have the following entry:
236 (converted from ASCII to text for readability)
237
238 10 790e830a3a7a31590824ac0642b3b31c2d0e8b38 ima-buf sha256:ab9f3c959367a8f5d4403d6ce9c3627dadfa8f9f0e7ec7899299782388de3840
239 dm_device_remove
240 dm_version=4.45.0;
241 device_active_metadata=name=l1,uuid=,major=253,minor=2,minor_count=1,num_targets=2;
242 device_inactive_metadata=name=l1,uuid=,major=253,minor=2,minor_count=1,num_targets=1;
243 active_table_hash=sha256:4a7e62efaebfc86af755831998b7db6f59b60d23c9534fb16a4455907957953a,
244 inactive_table_hash=sha256:9d79c175bc2302d55a183e8f50ad4bafd60f7692fd6249e5fd213e2464384b86,remove_all=n;
245 current_device_capacity=2048;
246
247 4. Table clear:
248 ----------------
249 When an inactive table is cleared from the device, the device information and a sha256 hash of the
250 data from an inactive table are measured.
251
252 The IMA measurement log has the following format for 'dm_table_clear':
253
254 ::
255
256 EVENT_NAME := "dm_table_clear"
257 EVENT_DATA := <dm_version_str> ";" <device_inactive_metadata> ";" <inactive_table_hash> ";" <current_device_capacity> ";"
258
259 dm_version_str := As described in the 'Table load' section above.
260 device_inactive_metadata := Device metadata that was captured during the load time inactive table being cleared.
261 The format is same as 'device_metadata' described in the 'Table load' section above.
262 inactive_table_hash := Hash of the inactive table being cleared from the device.
263 The format is same as 'active_table_hash' described in the 'Device resume' section above.
264 current_device_capacity := "current_device_capacity=" <N>
265
266 For instance, if a linear device's inactive table is cleared,
267 #dmsetup clear l1
268
269 then IMA ASCII measurement log will have an entry with:
270 (converted from ASCII to text for readability)
271
272 10 77d347408f557f68f0041acb0072946bb2367fe5 ima-buf sha256:42f9ca22163fdfa548e6229dece2959bc5ce295c681644240035827ada0e1db5
273 dm_table_clear
274 dm_version=4.45.0;
275 name=l1,uuid=,major=253,minor=2,minor_count=1,num_targets=1;
276 inactive_table_hash=sha256:75c0dc347063bf474d28a9907037eba060bfe39d8847fc0646d75e149045d545;current_device_capacity=1024;
277
278 5. Device rename:
279 ------------------
280 When an device's NAME or UUID is changed, the device information and the new NAME and UUID
281 are measured.
282
283 The IMA measurement log has the following format for 'dm_device_rename':
284
285 ::
286
287 EVENT_NAME := "dm_device_rename"
288 EVENT_DATA := <dm_version_str> ";" <device_active_metadata> ";" <new_device_name> "," <new_device_uuid> ";" <current_device_capacity> ";"
289
290 dm_version_str := As described in the 'Table load' section above.
291 device_active_metadata := Device metadata that reflects the currently loaded active table.
292 The format is same as 'device_metadata' described in the 'Table load' section above.
293 new_device_name := "new_name=" <dm-device-name>
294 dm-device-name := Same as <dm-device-name> described in 'Table load' section above
295 new_device_uuid := "new_uuid=" <dm-device-uuid>
296 dm-device-uuid := Same as <dm-device-uuid> described in 'Table load' section above
297 current_device_capacity := "current_device_capacity=" <N>
298
299 E.g 1: if a linear device's name is changed with the following command,
300 #dmsetup rename linear1 --setuuid 1234-5678
301
302 then IMA ASCII measurement log will have an entry with:
303 (converted from ASCII to text for readability)
304
305 10 8b0423209b4c66ac1523f4c9848c9b51ee332f48 ima-buf sha256:6847b7258134189531db593e9230b257c84f04038b5a18fd2e1473860e0569ac
306 dm_device_rename
307 dm_version=4.45.0;
308 name=linear1,uuid=,major=253,minor=2,minor_count=1,num_targets=1;new_name=linear1,new_uuid=1234-5678;
309 current_device_capacity=1024;
310
311 E.g 2: if a linear device's name is changed with the following command,
312 # dmsetup rename linear1 linear=2
313
314 then IMA ASCII measurement log will have an entry with:
315 (converted from ASCII to text for readability)
316
317 10 bef70476b99c2bdf7136fae033aa8627da1bf76f ima-buf sha256:8c6f9f53b9ef9dc8f92a2f2cca8910e622543d0f0d37d484870cb16b95111402
318 dm_device_rename
319 dm_version=4.45.0;
320 name=linear1,uuid=1234-5678,major=253,minor=2,minor_count=1,num_targets=1;
321 new_name=linear\=2,new_uuid=1234-5678;
322 current_device_capacity=1024;
323
324 Supported targets:
325 ==================
326
327 Following targets are supported to measure their data using IMA:
328
329 1. cache
330 #. crypt
331 #. integrity
332 #. linear
333 #. mirror
334 #. multipath
335 #. raid
336 #. snapshot
337 #. striped
338 #. verity
339
340 1. cache
341 ---------
342 The 'target_attributes' (described as part of EVENT_DATA in 'Table load'
343 section above) has the following data format for 'cache' target.
344
345 ::
346
347 target_attributes := <target_name> "," <target_version> "," <metadata_mode> "," <cache_metadata_device> ","
348 <cache_device> "," <cache_origin_device> "," <writethrough> "," <writeback> ","
349 <passthrough> "," <no_discard_passdown> ";"
350
351 target_name := "target_name=cache"
352 target_version := "target_version=" <N> "." <N> "." <N>
353 metadata_mode := "metadata_mode=" <cache_metadata_mode>
354 cache_metadata_mode := "fail" | "ro" | "rw"
355 cache_device := "cache_device=" <cache_device_name_string>
356 cache_origin_device := "cache_origin_device=" <cache_origin_device_string>
357 writethrough := "writethrough=" <yes_no>
358 writeback := "writeback=" <yes_no>
359 passthrough := "passthrough=" <yes_no>
360 no_discard_passdown := "no_discard_passdown=" <yes_no>
361 yes_no := "y" | "n"
362
363 E.g.
364 When a 'cache' target is loaded, then IMA ASCII measurement log will have an entry
365 similar to the following, depicting what 'cache' attributes are measured in EVENT_DATA
366 for 'dm_table_load' event.
367 (converted from ASCII to text for readability)
368
369 dm_version=4.45.0;name=cache1,uuid=cache_uuid,major=253,minor=2,minor_count=1,num_targets=1;
370 target_index=0,target_begin=0,target_len=28672,target_name=cache,target_version=2.2.0,metadata_mode=rw,
371 cache_metadata_device=253:4,cache_device=253:3,cache_origin_device=253:5,writethrough=y,writeback=n,
372 passthrough=n,metadata2=y,no_discard_passdown=n;
373
374
375 2. crypt
376 ---------
377 The 'target_attributes' (described as part of EVENT_DATA in 'Table load'
378 section above) has the following data format for 'crypt' target.
379
380 ::
381
382 target_attributes := <target_name> "," <target_version> "," <allow_discards> "," <same_cpu_crypt> ","
383 <submit_from_crypt_cpus> "," <no_read_workqueue> "," <no_write_workqueue> ","
384 <iv_large_sectors> "," <iv_large_sectors> "," [<integrity_tag_size> ","] [<cipher_auth> ","]
385 [<sector_size> ","] [<cipher_string> ","] <key_size> "," <key_parts> ","
386 <key_extra_size> "," <key_mac_size> ";"
387
388 target_name := "target_name=crypt"
389 target_version := "target_version=" <N> "." <N> "." <N>
390 allow_discards := "allow_discards=" <yes_no>
391 same_cpu_crypt := "same_cpu_crypt=" <yes_no>
392 submit_from_crypt_cpus := "submit_from_crypt_cpus=" <yes_no>
393 no_read_workqueue := "no_read_workqueue=" <yes_no>
394 no_write_workqueue := "no_write_workqueue=" <yes_no>
395 iv_large_sectors := "iv_large_sectors=" <yes_no>
396 integrity_tag_size := "integrity_tag_size=" <N>
397 cipher_auth := "cipher_auth=" <string>
398 sector_size := "sector_size=" <N>
399 cipher_string := "cipher_string="
400 key_size := "key_size=" <N>
401 key_parts := "key_parts=" <N>
402 key_extra_size := "key_extra_size=" <N>
403 key_mac_size := "key_mac_size=" <N>
404 yes_no := "y" | "n"
405
406 E.g.
407 When a 'crypt' target is loaded, then IMA ASCII measurement log will have an entry
408 similar to the following, depicting what 'crypt' attributes are measured in EVENT_DATA
409 for 'dm_table_load' event.
410 (converted from ASCII to text for readability)
411
412 dm_version=4.45.0;
413 name=crypt1,uuid=crypt_uuid1,major=253,minor=0,minor_count=1,num_targets=1;
414 target_index=0,target_begin=0,target_len=1953125,target_name=crypt,target_version=1.23.0,
415 allow_discards=y,same_cpu=n,submit_from_crypt_cpus=n,no_read_workqueue=n,no_write_workqueue=n,
416 iv_large_sectors=n,cipher_string=aes-xts-plain64,key_size=32,key_parts=1,key_extra_size=0,key_mac_size=0;
417
418 3. integrity
419 -------------
420 The 'target_attributes' (described as part of EVENT_DATA in 'Table load'
421 section above) has the following data format for 'integrity' target.
422
423 ::
424
425 target_attributes := <target_name> "," <target_version> "," <dev_name> "," <start>
426 <tag_size> "," <mode> "," [<meta_device> ","] [<block_size> ","] <recalculate> ","
427 <allow_discards> "," <fix_padding> "," <fix_hmac> "," <legacy_recalculate> ","
428 <journal_sectors> "," <interleave_sectors> "," <buffer_sectors> ";"
429
430 target_name := "target_name=integrity"
431 target_version := "target_version=" <N> "." <N> "." <N>
432 dev_name := "dev_name=" <device_name_str>
433 start := "start=" <N>
434 tag_size := "tag_size=" <N>
435 mode := "mode=" <integrity_mode_str>
436 integrity_mode_str := "J" | "B" | "D" | "R"
437 meta_device := "meta_device=" <meta_device_str>
438 block_size := "block_size=" <N>
439 recalculate := "recalculate=" <yes_no>
440 allow_discards := "allow_discards=" <yes_no>
441 fix_padding := "fix_padding=" <yes_no>
442 fix_hmac := "fix_hmac=" <yes_no>
443 legacy_recalculate := "legacy_recalculate=" <yes_no>
444 journal_sectors := "journal_sectors=" <N>
445 interleave_sectors := "interleave_sectors=" <N>
446 buffer_sectors := "buffer_sectors=" <N>
447 yes_no := "y" | "n"
448
449 E.g.
450 When a 'integrity' target is loaded, then IMA ASCII measurement log will have an entry
451 similar to the following, depicting what 'integrity' attributes are measured in EVENT_DATA
452 for 'dm_table_load' event.
453 (converted from ASCII to text for readability)
454
455 dm_version=4.45.0;
456 name=integrity1,uuid=,major=253,minor=1,minor_count=1,num_targets=1;
457 target_index=0,target_begin=0,target_len=7856,target_name=integrity,target_version=1.10.0,
458 dev_name=253:0,start=0,tag_size=32,mode=J,recalculate=n,allow_discards=n,fix_padding=n,
459 fix_hmac=n,legacy_recalculate=n,journal_sectors=88,interleave_sectors=32768,buffer_sectors=128;
460
461
462 4. linear
463 ----------
464 The 'target_attributes' (described as part of EVENT_DATA in 'Table load'
465 section above) has the following data format for 'linear' target.
466
467 ::
468
469 target_attributes := <target_name> "," <target_version> "," <device_name> <,> <start> ";"
470
471 target_name := "target_name=linear"
472 target_version := "target_version=" <N> "." <N> "." <N>
473 device_name := "device_name=" <linear_device_name_str>
474 start := "start=" <N>
475
476 E.g.
477 When a 'linear' target is loaded, then IMA ASCII measurement log will have an entry
478 similar to the following, depicting what 'linear' attributes are measured in EVENT_DATA
479 for 'dm_table_load' event.
480 (converted from ASCII to text for readability)
481
482 dm_version=4.45.0;
483 name=linear1,uuid=linear_uuid1,major=253,minor=2,minor_count=1,num_targets=1;
484 target_index=0,target_begin=0,target_len=28672,target_name=linear,target_version=1.4.0,
485 device_name=253:1,start=2048;
486
487 5. mirror
488 ----------
489 The 'target_attributes' (described as part of EVENT_DATA in 'Table load'
490 section above) has the following data format for 'mirror' target.
491
492 ::
493
494 target_attributes := <target_name> "," <target_version> "," <nr_mirrors> ","
495 <mirror_device_data> "," <handle_errors> "," <keep_log> "," <log_type_status> ";"
496
497 target_name := "target_name=mirror"
498 target_version := "target_version=" <N> "." <N> "." <N>
499 nr_mirrors := "nr_mirrors=" <NR>
500 mirror_device_data := <mirror_device_row> | <mirror_device_data><mirror_device_row>
501 mirror_device_row is repeated <NR> times - for <NR> described in <nr_mirrors>.
502 mirror_device_row := <mirror_device_name> "," <mirror_device_status>
503 mirror_device_name := "mirror_device_" <X> "=" <mirror_device_name_str>
504 where <X> ranges from 0 to (<NR> -1) - for <NR> described in <nr_mirrors>.
505 mirror_device_status := "mirror_device_" <X> "_status=" <mirror_device_status_char>
506 where <X> ranges from 0 to (<NR> -1) - for <NR> described in <nr_mirrors>.
507 mirror_device_status_char := "A" | "F" | "D" | "S" | "R" | "U"
508 handle_errors := "handle_errors=" <yes_no>
509 keep_log := "keep_log=" <yes_no>
510 log_type_status := "log_type_status=" <log_type_status_str>
511 yes_no := "y" | "n"
512
513 E.g.
514 When a 'mirror' target is loaded, then IMA ASCII measurement log will have an entry
515 similar to the following, depicting what 'mirror' attributes are measured in EVENT_DATA
516 for 'dm_table_load' event.
517 (converted from ASCII to text for readability)
518
519 dm_version=4.45.0;
520 name=mirror1,uuid=mirror_uuid1,major=253,minor=6,minor_count=1,num_targets=1;
521 target_index=0,target_begin=0,target_len=2048,target_name=mirror,target_version=1.14.0,nr_mirrors=2,
522 mirror_device_0=253:4,mirror_device_0_status=A,
523 mirror_device_1=253:5,mirror_device_1_status=A,
524 handle_errors=y,keep_log=n,log_type_status=;
525
526 6. multipath
527 -------------
528 The 'target_attributes' (described as part of EVENT_DATA in 'Table load'
529 section above) has the following data format for 'multipath' target.
530
531 ::
532
533 target_attributes := <target_name> "," <target_version> "," <nr_priority_groups>
534 ["," <pg_state> "," <priority_groups> "," <priority_group_paths>] ";"
535
536 target_name := "target_name=multipath"
537 target_version := "target_version=" <N> "." <N> "." <N>
538 nr_priority_groups := "nr_priority_groups=" <NPG>
539 priority_groups := <priority_groups_row>|<priority_groups_row><priority_groups>
540 priority_groups_row := "pg_state_" <X> "=" <pg_state_str> "," "nr_pgpaths_" <X> "=" <NPGP> ","
541 "path_selector_name_" <X> "=" <string> "," <priority_group_paths>
542 where <X> ranges from 0 to (<NPG> -1) - for <NPG> described in <nr_priority_groups>.
543 pg_state_str := "E" | "A" | "D"
544 <priority_group_paths> := <priority_group_paths_row> | <priority_group_paths_row><priority_group_paths>
545 priority_group_paths_row := "path_name_" <X> "_" <Y> "=" <string> "," "is_active_" <X> "_" <Y> "=" <is_active_str>
546 "fail_count_" <X> "_" <Y> "=" <N> "," "path_selector_status_" <X> "_" <Y> "=" <path_selector_status_str>
547 where <X> ranges from 0 to (<NPG> -1) - for <NPG> described in <nr_priority_groups>,
548 and <Y> ranges from 0 to (<NPGP> -1) - for <NPGP> described in <priority_groups_row>.
549 is_active_str := "A" | "F"
550
551 E.g.
552 When a 'multipath' target is loaded, then IMA ASCII measurement log will have an entry
553 similar to the following, depicting what 'multipath' attributes are measured in EVENT_DATA
554 for 'dm_table_load' event.
555 (converted from ASCII to text for readability)
556
557 dm_version=4.45.0;
558 name=mp,uuid=,major=253,minor=0,minor_count=1,num_targets=1;
559 target_index=0,target_begin=0,target_len=2097152,target_name=multipath,target_version=1.14.0,nr_priority_groups=2,
560 pg_state_0=E,nr_pgpaths_0=2,path_selector_name_0=queue-length,
561 path_name_0_0=8:16,is_active_0_0=A,fail_count_0_0=0,path_selector_status_0_0=,
562 path_name_0_1=8:32,is_active_0_1=A,fail_count_0_1=0,path_selector_status_0_1=,
563 pg_state_1=E,nr_pgpaths_1=2,path_selector_name_1=queue-length,
564 path_name_1_0=8:48,is_active_1_0=A,fail_count_1_0=0,path_selector_status_1_0=,
565 path_name_1_1=8:64,is_active_1_1=A,fail_count_1_1=0,path_selector_status_1_1=;
566
567 7. raid
568 --------
569 The 'target_attributes' (described as part of EVENT_DATA in 'Table load'
570 section above) has the following data format for 'raid' target.
571
572 ::
573
574 target_attributes := <target_name> "," <target_version> "," <raid_type> "," <raid_disks> "," <raid_state>
575 <raid_device_status> ["," journal_dev_mode] ";"
576
577 target_name := "target_name=raid"
578 target_version := "target_version=" <N> "." <N> "." <N>
579 raid_type := "raid_type=" <raid_type_str>
580 raid_disks := "raid_disks=" <NRD>
581 raid_state := "raid_state=" <raid_state_str>
582 raid_state_str := "frozen" | "reshape" |"resync" | "check" | "repair" | "recover" | "idle" |"undef"
583 raid_device_status := <raid_device_status_row> | <raid_device_status_row><raid_device_status>
584 <raid_device_status_row> is repeated <NRD> times - for <NRD> described in <raid_disks>.
585 raid_device_status_row := "raid_device_" <X> "_status=" <raid_device_status_str>
586 where <X> ranges from 0 to (<NRD> -1) - for <NRD> described in <raid_disks>.
587 raid_device_status_str := "A" | "D" | "a" | "-"
588 journal_dev_mode := "journal_dev_mode=" <journal_dev_mode_str>
589 journal_dev_mode_str := "writethrough" | "writeback" | "invalid"
590
591 E.g.
592 When a 'raid' target is loaded, then IMA ASCII measurement log will have an entry
593 similar to the following, depicting what 'raid' attributes are measured in EVENT_DATA
594 for 'dm_table_load' event.
595 (converted from ASCII to text for readability)
596
597 dm_version=4.45.0;
598 name=raid_LV1,uuid=uuid_raid_LV1,major=253,minor=12,minor_count=1,num_targets=1;
599 target_index=0,target_begin=0,target_len=2048,target_name=raid,target_version=1.15.1,
600 raid_type=raid10,raid_disks=4,raid_state=idle,
601 raid_device_0_status=A,
602 raid_device_1_status=A,
603 raid_device_2_status=A,
604 raid_device_3_status=A;
605
606
607 8. snapshot
608 ------------
609 The 'target_attributes' (described as part of EVENT_DATA in 'Table load'
610 section above) has the following data format for 'snapshot' target.
611
612 ::
613
614 target_attributes := <target_name> "," <target_version> "," <snap_origin_name> ","
615 <snap_cow_name> "," <snap_valid> "," <snap_merge_failed> "," <snapshot_overflowed> ";"
616
617 target_name := "target_name=snapshot"
618 target_version := "target_version=" <N> "." <N> "." <N>
619 snap_origin_name := "snap_origin_name=" <string>
620 snap_cow_name := "snap_cow_name=" <string>
621 snap_valid := "snap_valid=" <yes_no>
622 snap_merge_failed := "snap_merge_failed=" <yes_no>
623 snapshot_overflowed := "snapshot_overflowed=" <yes_no>
624 yes_no := "y" | "n"
625
626 E.g.
627 When a 'snapshot' target is loaded, then IMA ASCII measurement log will have an entry
628 similar to the following, depicting what 'snapshot' attributes are measured in EVENT_DATA
629 for 'dm_table_load' event.
630 (converted from ASCII to text for readability)
631
632 dm_version=4.45.0;
633 name=snap1,uuid=snap_uuid1,major=253,minor=13,minor_count=1,num_targets=1;
634 target_index=0,target_begin=0,target_len=4096,target_name=snapshot,target_version=1.16.0,
635 snap_origin_name=253:11,snap_cow_name=253:12,snap_valid=y,snap_merge_failed=n,snapshot_overflowed=n;
636
637 9. striped
638 -----------
639 The 'target_attributes' (described as part of EVENT_DATA in 'Table load'
640 section above) has the following data format for 'striped' target.
641
642 ::
643
644 target_attributes := <target_name> "," <target_version> "," <stripes> "," <chunk_size> ","
645 <stripe_data> ";"
646
647 target_name := "target_name=striped"
648 target_version := "target_version=" <N> "." <N> "." <N>
649 stripes := "stripes=" <NS>
650 chunk_size := "chunk_size=" <N>
651 stripe_data := <stripe_data_row>|<stripe_data><stripe_data_row>
652 stripe_data_row := <stripe_device_name> "," <stripe_physical_start> "," <stripe_status>
653 stripe_device_name := "stripe_" <X> "_device_name=" <stripe_device_name_str>
654 where <X> ranges from 0 to (<NS> -1) - for <NS> described in <stripes>.
655 stripe_physical_start := "stripe_" <X> "_physical_start=" <N>
656 where <X> ranges from 0 to (<NS> -1) - for <NS> described in <stripes>.
657 stripe_status := "stripe_" <X> "_status=" <stripe_status_str>
658 where <X> ranges from 0 to (<NS> -1) - for <NS> described in <stripes>.
659 stripe_status_str := "D" | "A"
660
661 E.g.
662 When a 'striped' target is loaded, then IMA ASCII measurement log will have an entry
663 similar to the following, depicting what 'striped' attributes are measured in EVENT_DATA
664 for 'dm_table_load' event.
665 (converted from ASCII to text for readability)
666
667 dm_version=4.45.0;
668 name=striped1,uuid=striped_uuid1,major=253,minor=5,minor_count=1,num_targets=1;
669 target_index=0,target_begin=0,target_len=640,target_name=striped,target_version=1.6.0,stripes=2,chunk_size=64,
670 stripe_0_device_name=253:0,stripe_0_physical_start=2048,stripe_0_status=A,
671 stripe_1_device_name=253:3,stripe_1_physical_start=2048,stripe_1_status=A;
672
673 10. verity
674 ----------
675 The 'target_attributes' (described as part of EVENT_DATA in 'Table load'
676 section above) has the following data format for 'verity' target.
677
678 ::
679
680 target_attributes := <target_name> "," <target_version> "," <hash_failed> "," <verity_version> ","
681 <data_device_name> "," <hash_device_name> "," <verity_algorithm> "," <root_digest> ","
682 <salt> "," <ignore_zero_blocks> "," <check_at_most_once> ["," <root_hash_sig_key_desc>]
683 ["," <verity_mode>] ";"
684
685 target_name := "target_name=verity"
686 target_version := "target_version=" <N> "." <N> "." <N>
687 hash_failed := "hash_failed=" <hash_failed_str>
688 hash_failed_str := "C" | "V"
689 verity_version := "verity_version=" <verity_version_str>
690 data_device_name := "data_device_name=" <data_device_name_str>
691 hash_device_name := "hash_device_name=" <hash_device_name_str>
692 verity_algorithm := "verity_algorithm=" <verity_algorithm_str>
693 root_digest := "root_digest=" <root_digest_str>
694 salt := "salt=" <salt_str>
695 salt_str := "-" <verity_salt_str>
696 ignore_zero_blocks := "ignore_zero_blocks=" <yes_no>
697 check_at_most_once := "check_at_most_once=" <yes_no>
698 root_hash_sig_key_desc := "root_hash_sig_key_desc="
699 verity_mode := "verity_mode=" <verity_mode_str>
700 verity_mode_str := "ignore_corruption" | "restart_on_corruption" | "panic_on_corruption" | "invalid"
701 yes_no := "y" | "n"
702
703 E.g.
704 When a 'verity' target is loaded, then IMA ASCII measurement log will have an entry
705 similar to the following, depicting what 'verity' attributes are measured in EVENT_DATA
706 for 'dm_table_load' event.
707 (converted from ASCII to text for readability)
708
709 dm_version=4.45.0;
710 name=test-verity,uuid=,major=253,minor=2,minor_count=1,num_targets=1;
711 target_index=0,target_begin=0,target_len=1953120,target_name=verity,target_version=1.8.0,hash_failed=V,
712 verity_version=1,data_device_name=253:1,hash_device_name=253:0,verity_algorithm=sha256,
713 root_digest=29cb87e60ce7b12b443ba6008266f3e41e93e403d7f298f8e3f316b29ff89c5e,
714 salt=e48da609055204e89ae53b655ca2216dd983cf3cb829f34f63a297d106d53e2d,
715 ignore_zero_blocks=n,check_at_most_once=n;
716

3. 한국어 전문 번역

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

Device Mapper state의 attestation

1-34

Attestation service를 포함한 외부 service와 infrastructure tool은 system setup과 runtime 동안 system과 상호작용합니다. Sensitive data를 공유하거나 critical workload를 실행하므로 business-critical data와 workload를 맡기기 전에 관련 kernel subsystem의 현재 runtime state를 검증하려 할 수 있습니다.

Device Mapper는 `crypt`, `verity`, `integrity` 등 여러 target type으로 block device에 중요한 기능을 제공합니다. 각 target의 attribute 설정은 block device와 system의 security profile에 큰 영향을 줍니다. 예를 들어 encryption algorithm 종류와 key size가 block device의 encryption strength를 결정합니다.

따라서 외부 service가 system을 완전히 신뢰하기 전에 block device의 현재 상태와 target attribute를 검증하는 것이 중요합니다.

IMA kernel subsystem은 Device Mapper가 kernel 내부에서 직접, tamper-resistant 방식으로 block device 상태와 설정을 measure하게 합니다. State 또는 configuration이 바뀌면 다시 measurement합니다.

Device Mapper IMA trust 흐름
DM target state/configurationDevice Mapper emits CRITICAL_DATAIMA measures with ima-bufTPM PCR and IMA logExternal attestation verifies system

Kernel이 DM state를 측정하고 외부 attestation service가 runtime security configuration을 검증합니다.

IMA policy와 measurement record

35-87

System에서 IMA가 Device Mapper data를 measure하려면 IMA policy에 다음 line을 추가하고 system을 restart해야 합니다.

 /etc/ima/ima-policy
    measure func=CRITICAL_DATA label=device-mapper template=ima-buf

Measurement는 다음 ASCII와 binary IMA log에 기록됩니다.

 /sys/kernel/security/integrity/ima/ascii_runtime_measurements
 /sys/kernel/security/integrity/ima/binary_runtime_measurements

IMA ASCII measurement record의 공통 형식은 다음과 같습니다.

 <PCR> <TEMPLATE_DATA_DIGEST> <TEMPLATE_NAME> <TEMPLATE_DATA>
IMA ASCII record field
Field설명
`PCR`값을 register할 Platform Configuration Register; TPM chip을 사용할 때 적용
`TEMPLATE_DATA_DIGEST`IMA record의 template data digest
`TEMPLATE_NAME`Integrity 값을 등록한 template 이름, 예: `ima-buf`
`ALG`Event digest 계산 algorithm
`EVENT_DIGEST`Event data digest
`EVENT_NAME`Event 설명, 예: `dm_table_load`
`EVENT_DATA`주어진 template 형식으로 measure할 event data

Record header와 template data가 event 이름·digest·payload를 묶습니다.

IMA subsystem이 measure한 DM target data는 user space에서 `DM_TABLE_STATUS_CMD`와 함께 `DM_IMA_MEASUREMENT_FLAG`를 설정해 조회할 수도 있습니다.

Kernel option `CONFIG_IMA_DISABLE_HTABLE`은 duplicate record measurement를 허용합니다. 중복 IMA event를 log에 기록하려면 kernel을 `CONFIG_IMA_DISABLE_HTABLE=y`로 구성해야 합니다.

Measurement 접근 방법
DM state changeIMA eventascii_runtime_measurements / binary_runtime_measurements
Userspace queryDM_TABLE_STATUS_CMD + DM_IMA_MEASUREMENT_FLAGMeasured target data

Persistent IMA log와 DM table-status query 두 경로를 제공합니다.

dm_table_load event

88-167

IMA measurement를 발생시키는 device state change는 table load, device resume, device remove, table clear, device rename의 다섯 가지입니다.

새 table이 device의 inactive table slot에 load되면 device 정보와 table 안 target들의 target-specific detail을 measure합니다. `dm_table_load`의 grammar는 다음과 같습니다.

 EVENT_NAME := "dm_table_load"
 EVENT_DATA := <dm_version_str> ";" <device_metadata> ";" <table_load_data>

 dm_version_str := "dm_version=" <N> "." <N> "." <N>
                  Same as Device Mapper driver version.
 device_metadata := <device_name> "," <device_uuid> "," <device_major> "," <device_minor> ","
                   <minor_count> "," <num_device_targets> ";"

 device_name := "name=" <dm-device-name>
 device_uuid := "uuid=" <dm-device-uuid>
 device_major := "major=" <N>
 device_minor := "minor=" <N>
 minor_count := "minor_count=" <N>
 num_device_targets := "num_targets=" <N>
 dm-device-name := Name of the device. If it contains special characters like '\', ',', ';',
                   they are prefixed with '\'.
 dm-device-uuid := UUID of the device. If it contains special characters like '\', ',', ';',
                   they are prefixed with '\'.

 table_load_data := <target_data>
                    Represents the data (as name=value pairs) from various targets in the table,
                    which is being loaded into the DM device's inactive table slot.
 target_data := <target_data_row> | <target_data><target_data_row>

 target_data_row := <target_index> "," <target_begin> "," <target_len> "," <target_name> ","
                    <target_version> "," <target_attributes> ";"
 target_index := "target_index=" <N>
                 Represents nth target in the table (from 0 to N-1 targets specified in <num_device_targets>)
                 If all the data for N targets doesn't fit in the given buffer - then the data that fits
                 in the buffer (say from target 0 to x) is measured in a given IMA event.
                 The remaining data from targets x+1 to N-1 is measured in the subsequent IMA events,
                 with the same format as that of 'dm_table_load'
                 i.e. <dm_version_str> ";" <device_metadata> ";" <table_load_data>.

 target_begin := "target_begin=" <N>
 target_len := "target_len=" <N>
 target_name := Name of the target. 'linear', 'crypt', 'integrity' etc.
                The targets that are supported for IMA measurements are documented below in the
                'Supported targets' section.
 target_version := "target_version=" <N> "." <N> "." <N>
 target_attributes := Data containing comma separated list of name=value pairs of target specific attributes.
dm_table_load 구성
구성내용
`dm_version_str`Device Mapper driver version `N.N.N`
`device_metadata`name, uuid, major, minor, minor_count, num_targets
`table_load_data`Inactive table에 load되는 target별 name=value data
`target_data_row`target_index, begin, length, name, version, attributes
undefinedundefined
undefinedundefined

Driver version, device metadata와 각 target row를 semicolon으로 연결합니다.

`target_index`는 0부터 `num_device_targets - 1`까지의 table 내 순서입니다. `target_begin`과 `target_len`은 target 범위이며 `target_name`은 `linear`, `crypt`, `integrity` 같은 target 이름입니다. 지원 target은 뒤에서 설명합니다. `target_attributes`는 target-specific name=value pair의 comma-separated list입니다.

다음 예는 `linear1`에 네 개의 linear table entry를 만들고, 이에 대응하는 IMA ASCII record를 사람이 읽기 좋은 text로 변환해 보여 줍니다.

 For instance, if a linear device is created with the following table entries,
  # dmsetup create linear1
  0 2 linear /dev/loop0 512
  2 2 linear /dev/loop0 512
  4 2 linear /dev/loop0 512
  6 2 linear /dev/loop0 512

 Then IMA ASCII measurement log will have the following entry:
 (converted from ASCII to text for readability)

 10 a8c5ff755561c7a28146389d1514c318592af49a ima-buf sha256:4d73481ecce5eadba8ab084640d85bb9ca899af4d0a122989252a76efadc5b72
 dm_table_load
 dm_version=4.45.0;
 name=linear1,uuid=,major=253,minor=0,minor_count=1,num_targets=4;
 target_index=0,target_begin=0,target_len=2,target_name=linear,target_version=1.4.0,device_name=7:0,start=512;
 target_index=1,target_begin=2,target_len=2,target_name=linear,target_version=1.4.0,device_name=7:0,start=512;
 target_index=2,target_begin=4,target_len=2,target_name=linear,target_version=1.4.0,device_name=7:0,start=512;
 target_index=3,target_begin=6,target_len=2,target_name=linear,target_version=1.4.0,device_name=7:0,start=512;
Table-load event 분할
Inactive table loadSerialize target rows 0..N-1Fill event bufferMeasure rows 0..xContinue rows x+1..N-1 in later events

Target row가 buffer를 넘으면 같은 device metadata를 가진 여러 event로 나눕니다.

dm_device_resume event

168-205

Suspend된 device를 resume하면 device 정보와 이전 active table load data의 hash를 measure합니다.

 EVENT_NAME := "dm_device_resume"
 EVENT_DATA := <dm_version_str> ";" <device_metadata> ";" <active_table_hash> ";" <current_device_capacity> ";"

 dm_version_str := As described in the 'Table load' section above.
 device_metadata := As described in the 'Table load' section above.
 active_table_hash := "active_table_hash=" <table_hash_alg> ":" <table_hash>
                      Rerpresents the hash of the IMA data being measured for the
                      active table for the device.
 table_hash_alg := Algorithm used to compute the hash.
 table_hash := Hash of the (<dm_version_str> ";" <device_metadata> ";" <table_load_data> ";")
               as described in the 'dm_table_load' above.
               Note: If the table_load data spans across multiple IMA 'dm_table_load'
               events for a given device, the hash is computed combining all the event data
               i.e. (<dm_version_str> ";" <device_metadata> ";" <table_load_data> ";")
               across all those events.
 current_device_capacity := "current_device_capacity=" <N>

`active_table_hash`는 active table의 IMA data hash이며 algorithm과 hash를 함께 기록합니다. Hash input은 `dm_version_str`, `device_metadata`, `table_load_data`를 semicolon으로 연결한 값입니다.

한 device의 table-load data가 여러 `dm_table_load` event에 걸쳤다면 모든 event의 해당 data를 결합해 table hash를 계산합니다. `current_device_capacity`도 함께 기록합니다.

다음 예는 `dmsetup resume linear1` 명령과 그 결과인 resume measurement입니다.

 For instance, if a linear device is resumed with the following command,
 #dmsetup resume linear1

 then IMA ASCII measurement log will have an entry with:
 (converted from ASCII to text for readability)

 10 56c00cc062ffc24ccd9ac2d67d194af3282b934e ima-buf sha256:e7d12c03b958b4e0e53e7363a06376be88d98a1ac191fdbd3baf5e4b77f329b6
 dm_device_resume
 dm_version=4.45.0;
 name=linear1,uuid=,major=253,minor=0,minor_count=1,num_targets=4;
 active_table_hash=sha256:4d73481ecce5eadba8ab084640d85bb9ca899af4d0a122989252a76efadc5b72;current_device_capacity=8;
Resume measurement
Resume suspended deviceCollect all active dm_table_load event dataCompute table_hash_alg:table_hashAdd current_device_capacityEmit dm_device_resume

여러 table-load event를 하나의 active-table hash로 결합해 현재 capacity와 함께 측정합니다.

dm_device_remove event

206-246

Device를 remove하면 active·inactive table의 device 정보와 data SHA-256 hash를 measure합니다.

 EVENT_NAME := "dm_device_remove"
 EVENT_DATA := <dm_version_str> ";" <device_active_metadata> ";" <device_inactive_metadata> ";"
               <active_table_hash> "," <inactive_table_hash> "," <remove_all> ";" <current_device_capacity> ";"

 dm_version_str := As described in the 'Table load' section above.
 device_active_metadata := Device metadata that reflects the currently loaded active table.
                           The format is same as 'device_metadata' described in the 'Table load' section above.
 device_inactive_metadata := Device metadata that reflects the inactive table.
                             The format is same as 'device_metadata' described in the 'Table load' section above.
 active_table_hash := Hash of the currently loaded active table.
                      The format is same as 'active_table_hash' described in the 'Device resume' section above.
 inactive_table_hash :=  Hash of the inactive table.
                         The format is same as 'active_table_hash' described in the 'Device resume' section above.
 remove_all := "remove_all=" <yes_no>
 yes_no := "y" | "n"
 current_device_capacity := "current_device_capacity=" <N>
dm_device_remove payload
Field설명
`device_active_metadata`현재 load된 active table의 device metadata
`device_inactive_metadata`Inactive table의 device metadata
`active_table_hash`현재 active table hash
`inactive_table_hash`Inactive table hash
`remove_all`모두 remove하면 `y`, 아니면 `n`
`current_device_capacity`현재 device capacity

두 table slot의 metadata와 hash, remove 범위와 capacity를 기록합니다.

다음 예는 `dmsetup remove l1`과 active/inactive metadata, 두 hash, `remove_all=n`, capacity 2048을 담은 record입니다.

 For instance, if a linear device is removed with the following command,
  #dmsetup remove l1

 then IMA ASCII measurement log will have the following entry:
 (converted from ASCII to text for readability)

 10 790e830a3a7a31590824ac0642b3b31c2d0e8b38 ima-buf sha256:ab9f3c959367a8f5d4403d6ce9c3627dadfa8f9f0e7ec7899299782388de3840
 dm_device_remove
 dm_version=4.45.0;
 device_active_metadata=name=l1,uuid=,major=253,minor=2,minor_count=1,num_targets=2;
 device_inactive_metadata=name=l1,uuid=,major=253,minor=2,minor_count=1,num_targets=1;
 active_table_hash=sha256:4a7e62efaebfc86af755831998b7db6f59b60d23c9534fb16a4455907957953a,
 inactive_table_hash=sha256:9d79c175bc2302d55a183e8f50ad4bafd60f7692fd6249e5fd213e2464384b86,remove_all=n;
 current_device_capacity=2048;

dm_table_clear event

247-277

Inactive table을 device에서 clear하면 device 정보와 inactive table data의 SHA-256 hash를 measure합니다.

 EVENT_NAME := "dm_table_clear"
 EVENT_DATA := <dm_version_str> ";" <device_inactive_metadata> ";" <inactive_table_hash> ";" <current_device_capacity> ";"

 dm_version_str := As described in the 'Table load' section above.
 device_inactive_metadata := Device metadata that was captured during the load time inactive table being cleared.
                             The format is same as 'device_metadata' described in the 'Table load' section above.
 inactive_table_hash := Hash of the inactive table being cleared from the device.
                        The format is same as 'active_table_hash' described in the 'Device resume' section above.
 current_device_capacity := "current_device_capacity=" <N>

`device_inactive_metadata`는 clear할 inactive table을 load할 때 capture한 metadata이고, `inactive_table_hash`는 그 table의 hash입니다. 현재 device capacity도 기록합니다.

다음 예는 `dmsetup clear l1`과 inactive table hash, capacity 1024를 담은 measurement입니다.

 For instance, if a linear device's inactive table is cleared,
  #dmsetup clear l1

 then IMA ASCII measurement log will have an entry with:
 (converted from ASCII to text for readability)

 10 77d347408f557f68f0041acb0072946bb2367fe5 ima-buf sha256:42f9ca22163fdfa548e6229dece2959bc5ce295c681644240035827ada0e1db5
 dm_table_clear
 dm_version=4.45.0;
 name=l1,uuid=,major=253,minor=2,minor_count=1,num_targets=1;
 inactive_table_hash=sha256:75c0dc347063bf474d28a9907037eba060bfe39d8847fc0646d75e149045d545;current_device_capacity=1024;
Inactive table clear
Inactive table existsdmsetup clearRetrieve load-time inactive metadataAdd inactive table hash and capacityEmit dm_table_clear

Load 시 capture한 inactive metadata와 hash를 clear 시점에 증명합니다.

dm_device_rename event

278-324

Device의 NAME 또는 UUID가 바뀌면 현재 active metadata와 새 NAME·UUID를 measure합니다.

 EVENT_NAME := "dm_device_rename"
 EVENT_DATA := <dm_version_str> ";" <device_active_metadata> ";" <new_device_name> "," <new_device_uuid> ";" <current_device_capacity> ";"

 dm_version_str := As described in the 'Table load' section above.
 device_active_metadata := Device metadata that reflects the currently loaded active table.
                           The format is same as 'device_metadata' described in the 'Table load' section above.
 new_device_name := "new_name=" <dm-device-name>
 dm-device-name := Same as <dm-device-name> described in 'Table load' section above
 new_device_uuid := "new_uuid=" <dm-device-uuid>
 dm-device-uuid := Same as <dm-device-uuid> described in 'Table load' section above
 current_device_capacity := "current_device_capacity=" <N>

`new_device_name`과 `new_device_uuid`는 table-load에서 정의한 device name·UUID 규칙을 사용하고 현재 capacity를 함께 기록합니다.

첫 예는 `linear1`의 UUID를 `1234-5678`로 바꾸고 새 name과 UUID를 record합니다.

 E.g 1: if a linear device's name is changed with the following command,
  #dmsetup rename linear1 --setuuid 1234-5678

 then IMA ASCII measurement log will have an entry with:
 (converted from ASCII to text for readability)

 10 8b0423209b4c66ac1523f4c9848c9b51ee332f48 ima-buf sha256:6847b7258134189531db593e9230b257c84f04038b5a18fd2e1473860e0569ac
 dm_device_rename
 dm_version=4.45.0;
 name=linear1,uuid=,major=253,minor=2,minor_count=1,num_targets=1;new_name=linear1,new_uuid=1234-5678;
 current_device_capacity=1024;

두 번째 예는 device name을 `linear=2`로 바꿉니다. Measurement의 `new_name=linear\=2`처럼 특수 문자 `=`가 backslash로 escape됩니다.

 E.g 2:  if a linear device's name is changed with the following command,
  # dmsetup rename linear1 linear=2

 then IMA ASCII measurement log will have an entry with:
 (converted from ASCII to text for readability)

 10 bef70476b99c2bdf7136fae033aa8627da1bf76f ima-buf sha256:8c6f9f53b9ef9dc8f92a2f2cca8910e622543d0f0d37d484870cb16b95111402
 dm_device_rename
 dm_version=4.45.0;
 name=linear1,uuid=1234-5678,major=253,minor=2,minor_count=1,num_targets=1;
 new_name=linear\=2,new_uuid=1234-5678;
 current_device_capacity=1024;
Rename measurement
Change NAME or UUIDCapture active device metadataEscape special charactersRecord new_name and new_uuidEmit dm_device_rename

기존 active metadata를 새 identity와 연결해 rename 이력을 측정합니다.

cache target attribute

325-374

IMA measurement가 지원하는 target은 cache, crypt, integrity, linear, mirror, multipath, raid, snapshot, striped, verity의 열 가지입니다.

`cache` target의 `target_attributes` grammar와 field 정의는 다음과 같습니다.

 target_attributes := <target_name> "," <target_version> "," <metadata_mode> "," <cache_metadata_device> ","
                      <cache_device> "," <cache_origin_device> "," <writethrough> "," <writeback> ","
                      <passthrough> "," <no_discard_passdown> ";"

 target_name := "target_name=cache"
 target_version := "target_version=" <N> "." <N> "." <N>
 metadata_mode := "metadata_mode=" <cache_metadata_mode>
 cache_metadata_mode := "fail" | "ro" | "rw"
 cache_device := "cache_device=" <cache_device_name_string>
 cache_origin_device := "cache_origin_device=" <cache_origin_device_string>
 writethrough := "writethrough=" <yes_no>
 writeback := "writeback=" <yes_no>
 passthrough := "passthrough=" <yes_no>
 no_discard_passdown := "no_discard_passdown=" <yes_no>
 yes_no := "y" | "n"
cache measurement field
Field
`target_name` / `target_version``cache`, target version
`metadata_mode``fail`, `ro`, `rw`
`cache_metadata_device`Cache metadata device
`cache_device`Cached data device
`cache_origin_device`Origin device
`writethrough` / `writeback` / `passthrough``y` 또는 `n`
`no_discard_passdown``y` 또는 `n`

Metadata mode, 세 device와 cache write/discard mode를 기록합니다.

예제 record는 `cache1`의 metadata mode `rw`, metadata/cache/origin device, `writethrough=y`, `writeback=n`, `passthrough=n`, `metadata2=y`, `no_discard_passdown=n`을 보여 줍니다.

 E.g.
 When a 'cache' target is loaded, then IMA ASCII measurement log will have an entry
 similar to the following, depicting what 'cache' attributes are measured in EVENT_DATA
 for 'dm_table_load' event.
 (converted from ASCII to text for readability)

 dm_version=4.45.0;name=cache1,uuid=cache_uuid,major=253,minor=2,minor_count=1,num_targets=1;
 target_index=0,target_begin=0,target_len=28672,target_name=cache,target_version=2.2.0,metadata_mode=rw,
 cache_metadata_device=253:4,cache_device=253:3,cache_origin_device=253:5,writethrough=y,writeback=n,
 passthrough=n,metadata2=y,no_discard_passdown=n;

crypt target attribute

375-417

`crypt` target의 grammar에는 discard·CPU/workqueue·large-sector flag와 선택적 integrity/cipher 정보, key size와 parts가 포함됩니다.

 target_attributes := <target_name> "," <target_version> "," <allow_discards> "," <same_cpu_crypt> ","
                      <submit_from_crypt_cpus> "," <no_read_workqueue> "," <no_write_workqueue> ","
                      <iv_large_sectors> "," <iv_large_sectors> "," [<integrity_tag_size> ","] [<cipher_auth> ","]
                      [<sector_size> ","] [<cipher_string> ","] <key_size> "," <key_parts> ","
                      <key_extra_size> "," <key_mac_size> ";"

 target_name := "target_name=crypt"
 target_version := "target_version=" <N> "." <N> "." <N>
 allow_discards := "allow_discards=" <yes_no>
 same_cpu_crypt := "same_cpu_crypt=" <yes_no>
 submit_from_crypt_cpus := "submit_from_crypt_cpus=" <yes_no>
 no_read_workqueue := "no_read_workqueue=" <yes_no>
 no_write_workqueue := "no_write_workqueue=" <yes_no>
 iv_large_sectors := "iv_large_sectors=" <yes_no>
 integrity_tag_size := "integrity_tag_size=" <N>
 cipher_auth := "cipher_auth=" <string>
 sector_size := "sector_size="  <N>
 cipher_string := "cipher_string="
 key_size := "key_size="  <N>
 key_parts := "key_parts="  <N>
 key_extra_size := "key_extra_size="  <N>
 key_mac_size := "key_mac_size="  <N>
 yes_no := "y" | "n"
crypt measurement field
Field group내용
I/O option`allow_discards`, `same_cpu_crypt`, `submit_from_crypt_cpus`, `no_read_workqueue`, `no_write_workqueue`
IV`iv_large_sectors`
Optional integrity/cipher`integrity_tag_size`, `cipher_auth`, `sector_size`, `cipher_string`
Key shape`key_size`, `key_parts`, `key_extra_size`, `key_mac_size`

Encryption execution option과 key 구조를 secret key 자체 없이 측정합니다.

예제는 `crypt1`의 AES-XTS plain64, 32-byte key, 1 key part와 option 상태를 보여 줍니다. 원문 grammar에는 `iv_large_sectors`가 두 번 나열되며 예제 field는 `same_cpu=n`으로 출력됩니다.

 E.g.
 When a 'crypt' target is loaded, then IMA ASCII measurement log will have an entry
 similar to the following, depicting what 'crypt' attributes are measured in EVENT_DATA
 for 'dm_table_load' event.
 (converted from ASCII to text for readability)

 dm_version=4.45.0;
 name=crypt1,uuid=crypt_uuid1,major=253,minor=0,minor_count=1,num_targets=1;
 target_index=0,target_begin=0,target_len=1953125,target_name=crypt,target_version=1.23.0,
 allow_discards=y,same_cpu=n,submit_from_crypt_cpus=n,no_read_workqueue=n,no_write_workqueue=n,
 iv_large_sectors=n,cipher_string=aes-xts-plain64,key_size=32,key_parts=1,key_extra_size=0,key_mac_size=0;

integrity target attribute

418-461

`integrity` target은 data와 optional metadata device, tag·block size, mode와 repair/discard option, journal layout을 측정합니다.

 target_attributes := <target_name> "," <target_version> "," <dev_name> "," <start>
                      <tag_size> "," <mode> "," [<meta_device> ","] [<block_size> ","] <recalculate> ","
                      <allow_discards> "," <fix_padding> "," <fix_hmac> "," <legacy_recalculate> ","
                      <journal_sectors> "," <interleave_sectors> "," <buffer_sectors> ";"

 target_name := "target_name=integrity"
 target_version := "target_version=" <N> "." <N> "." <N>
 dev_name := "dev_name=" <device_name_str>
 start := "start=" <N>
 tag_size := "tag_size=" <N>
 mode := "mode=" <integrity_mode_str>
 integrity_mode_str := "J" | "B" | "D" | "R"
 meta_device := "meta_device=" <meta_device_str>
 block_size := "block_size=" <N>
 recalculate := "recalculate=" <yes_no>
 allow_discards := "allow_discards=" <yes_no>
 fix_padding := "fix_padding=" <yes_no>
 fix_hmac := "fix_hmac=" <yes_no>
 legacy_recalculate := "legacy_recalculate=" <yes_no>
 journal_sectors := "journal_sectors=" <N>
 interleave_sectors := "interleave_sectors=" <N>
 buffer_sectors := "buffer_sectors=" <N>
 yes_no := "y" | "n"
integrity measurement field
Field group내용
Device layout`dev_name`, `start`, optional `meta_device`, `block_size`
Integrity`tag_size`, mode `J|B|D|R`, `recalculate`
Option`allow_discards`, `fix_padding`, `fix_hmac`, `legacy_recalculate`
Journal layout`journal_sectors`, `interleave_sectors`, `buffer_sectors`

Integrity mode와 metadata layout 및 compatibility option을 기록합니다.

예제 `integrity1`은 tag size 32, journal mode `J`, option은 모두 `n`, journal 88 sector, interleave 32768 sector, buffer 128 sector입니다.

 E.g.
 When a 'integrity' target is loaded, then IMA ASCII measurement log will have an entry
 similar to the following, depicting what 'integrity' attributes are measured in EVENT_DATA
 for 'dm_table_load' event.
 (converted from ASCII to text for readability)

 dm_version=4.45.0;
 name=integrity1,uuid=,major=253,minor=1,minor_count=1,num_targets=1;
 target_index=0,target_begin=0,target_len=7856,target_name=integrity,target_version=1.10.0,
 dev_name=253:0,start=0,tag_size=32,mode=J,recalculate=n,allow_discards=n,fix_padding=n,
 fix_hmac=n,legacy_recalculate=n,journal_sectors=88,interleave_sectors=32768,buffer_sectors=128;

linear와 mirror target attribute

462-525

`linear` target은 target name·version, backing `device_name`과 physical `start`를 기록합니다.

 target_attributes := <target_name> "," <target_version> "," <device_name> <,> <start> ";"

 target_name := "target_name=linear"
 target_version := "target_version=" <N> "." <N> "." <N>
 device_name := "device_name=" <linear_device_name_str>
 start := "start=" <N>

예제 `linear1`은 device `253:1`의 start 2048을 map합니다.

 E.g.
 When a 'linear' target is loaded, then IMA ASCII measurement log will have an entry
 similar to the following, depicting what 'linear' attributes are measured in EVENT_DATA
 for 'dm_table_load' event.
 (converted from ASCII to text for readability)

 dm_version=4.45.0;
 name=linear1,uuid=linear_uuid1,major=253,minor=2,minor_count=1,num_targets=1;
 target_index=0,target_begin=0,target_len=28672,target_name=linear,target_version=1.4.0,
 device_name=253:1,start=2048;

`mirror` target은 mirror 수와 각 mirror device name·status, error handling과 log 설정을 기록합니다.

 target_attributes := <target_name> "," <target_version> "," <nr_mirrors> ","
                      <mirror_device_data> "," <handle_errors> "," <keep_log> "," <log_type_status> ";"

 target_name := "target_name=mirror"
 target_version := "target_version=" <N> "." <N> "." <N>
 nr_mirrors := "nr_mirrors=" <NR>
 mirror_device_data := <mirror_device_row> | <mirror_device_data><mirror_device_row>
                       mirror_device_row is repeated <NR> times - for <NR> described in <nr_mirrors>.
 mirror_device_row := <mirror_device_name> "," <mirror_device_status>
 mirror_device_name := "mirror_device_" <X> "=" <mirror_device_name_str>
                       where <X> ranges from 0 to (<NR> -1) - for <NR> described in <nr_mirrors>.
 mirror_device_status := "mirror_device_" <X> "_status=" <mirror_device_status_char>
                         where <X> ranges from 0 to (<NR> -1) - for <NR> described in <nr_mirrors>.
 mirror_device_status_char := "A" | "F" | "D" | "S" | "R" | "U"
 handle_errors := "handle_errors=" <yes_no>
 keep_log := "keep_log=" <yes_no>
 log_type_status := "log_type_status=" <log_type_status_str>
 yes_no := "y" | "n"
mirror measurement field
Field설명
`nr_mirrors`Mirror 수 `NR`
`mirror_device_X`X=0..NR-1인 mirror device name
`mirror_device_X_status`Status `A|F|D|S|R|U`
`handle_errors` / `keep_log``y` 또는 `n`
`log_type_status`Mirror log type status

Mirror 수에 따라 device row를 반복합니다.

예제 `mirror1`에는 status `A`인 mirror device 두 개, `handle_errors=y`, `keep_log=n`이 기록됩니다.

 E.g.
 When a 'mirror' target is loaded, then IMA ASCII measurement log will have an entry
 similar to the following, depicting what 'mirror' attributes are measured in EVENT_DATA
 for 'dm_table_load' event.
 (converted from ASCII to text for readability)

 dm_version=4.45.0;
 name=mirror1,uuid=mirror_uuid1,major=253,minor=6,minor_count=1,num_targets=1;
 target_index=0,target_begin=0,target_len=2048,target_name=mirror,target_version=1.14.0,nr_mirrors=2,
    mirror_device_0=253:4,mirror_device_0_status=A,
    mirror_device_1=253:5,mirror_device_1_status=A,
 handle_errors=y,keep_log=n,log_type_status=;

multipath target attribute

526-566

`multipath` target은 priority group 수, group state와 path selector, 각 path의 active 상태·fail count·selector status를 계층적으로 기록합니다.

 target_attributes := <target_name> "," <target_version> "," <nr_priority_groups>
                      ["," <pg_state> "," <priority_groups> "," <priority_group_paths>] ";"

 target_name := "target_name=multipath"
 target_version := "target_version=" <N> "." <N> "." <N>
 nr_priority_groups := "nr_priority_groups=" <NPG>
 priority_groups := <priority_groups_row>|<priority_groups_row><priority_groups>
 priority_groups_row := "pg_state_" <X> "=" <pg_state_str> "," "nr_pgpaths_" <X>  "=" <NPGP> ","
                        "path_selector_name_" <X> "=" <string> "," <priority_group_paths>
                        where <X> ranges from 0 to (<NPG> -1) - for <NPG> described in <nr_priority_groups>.
 pg_state_str := "E" | "A" | "D"
 <priority_group_paths> := <priority_group_paths_row> | <priority_group_paths_row><priority_group_paths>
 priority_group_paths_row := "path_name_" <X> "_" <Y> "=" <string> "," "is_active_" <X> "_" <Y> "=" <is_active_str>
                             "fail_count_" <X> "_" <Y> "=" <N> "," "path_selector_status_" <X> "_" <Y> "=" <path_selector_status_str>
                             where <X> ranges from 0 to (<NPG> -1) - for <NPG> described in <nr_priority_groups>,
                             and <Y> ranges from 0 to (<NPGP> -1) - for <NPGP> described in <priority_groups_row>.
 is_active_str := "A" | "F"
multipath 반복 구조
LevelField
Target`nr_priority_groups=NPG`
Priority group X`pg_state_X`(`E|A|D`), `nr_pgpaths_X`, `path_selector_name_X`
Path X_Y`path_name_X_Y`, `is_active_X_Y`(`A|F`), `fail_count_X_Y`, `path_selector_status_X_Y`

Priority group X와 그 안 path Y를 반복해 전체 route 상태를 표현합니다.

예제 `mp`는 두 priority group을 가지며 각 group에는 `queue-length` selector와 active 상태 `A`인 path 두 개가 있습니다. 모든 fail count는 0입니다.

 E.g.
 When a 'multipath' target is loaded, then IMA ASCII measurement log will have an entry
 similar to the following, depicting what 'multipath' attributes are measured in EVENT_DATA
 for 'dm_table_load' event.
 (converted from ASCII to text for readability)

 dm_version=4.45.0;
 name=mp,uuid=,major=253,minor=0,minor_count=1,num_targets=1;
 target_index=0,target_begin=0,target_len=2097152,target_name=multipath,target_version=1.14.0,nr_priority_groups=2,
    pg_state_0=E,nr_pgpaths_0=2,path_selector_name_0=queue-length,
        path_name_0_0=8:16,is_active_0_0=A,fail_count_0_0=0,path_selector_status_0_0=,
        path_name_0_1=8:32,is_active_0_1=A,fail_count_0_1=0,path_selector_status_0_1=,
    pg_state_1=E,nr_pgpaths_1=2,path_selector_name_1=queue-length,
        path_name_1_0=8:48,is_active_1_0=A,fail_count_1_0=0,path_selector_status_1_0=,
        path_name_1_1=8:64,is_active_1_1=A,fail_count_1_1=0,path_selector_status_1_1=;

raid target attribute

567-606

`raid` target은 RAID type, disk 수, array state, 각 device status와 선택적 journal mode를 기록합니다.

 target_attributes := <target_name> "," <target_version> "," <raid_type> "," <raid_disks> "," <raid_state>
                      <raid_device_status> ["," journal_dev_mode] ";"

 target_name := "target_name=raid"
 target_version := "target_version=" <N> "." <N> "." <N>
 raid_type := "raid_type=" <raid_type_str>
 raid_disks := "raid_disks=" <NRD>
 raid_state := "raid_state=" <raid_state_str>
 raid_state_str := "frozen" | "reshape" |"resync" | "check" | "repair" | "recover" | "idle" |"undef"
 raid_device_status := <raid_device_status_row> | <raid_device_status_row><raid_device_status>
                       <raid_device_status_row> is repeated <NRD> times - for <NRD> described in <raid_disks>.
 raid_device_status_row := "raid_device_" <X> "_status=" <raid_device_status_str>
                           where <X> ranges from 0 to (<NRD> -1) - for <NRD> described in <raid_disks>.
 raid_device_status_str := "A" | "D" | "a" | "-"
 journal_dev_mode := "journal_dev_mode=" <journal_dev_mode_str>
 journal_dev_mode_str := "writethrough" | "writeback" | "invalid"
raid measurement field
Field
`raid_type`RAID type 문자열
`raid_disks`RAID disk 수 `NRD`
`raid_state``frozen|reshape|resync|check|repair|recover|idle|undef`
`raid_device_X_status``A|D|a|-`, X=0..NRD-1
`journal_dev_mode``writethrough|writeback|invalid`

Array state와 NRD개 device row를 측정합니다.

예제 `raid_LV1`은 `raid10`, disk 4개, state `idle`이며 네 device status가 모두 `A`입니다.

 E.g.
 When a 'raid' target is loaded, then IMA ASCII measurement log will have an entry
 similar to the following, depicting what 'raid' attributes are measured in EVENT_DATA
 for 'dm_table_load' event.
 (converted from ASCII to text for readability)

 dm_version=4.45.0;
 name=raid_LV1,uuid=uuid_raid_LV1,major=253,minor=12,minor_count=1,num_targets=1;
 target_index=0,target_begin=0,target_len=2048,target_name=raid,target_version=1.15.1,
 raid_type=raid10,raid_disks=4,raid_state=idle,
    raid_device_0_status=A,
    raid_device_1_status=A,
    raid_device_2_status=A,
    raid_device_3_status=A;

snapshot과 striped target attribute

607-672

`snapshot` target은 origin·COW device와 snapshot validity, merge failure, overflow state를 기록합니다.

 target_attributes := <target_name> "," <target_version> "," <snap_origin_name> ","
                      <snap_cow_name> "," <snap_valid> "," <snap_merge_failed> "," <snapshot_overflowed> ";"

 target_name := "target_name=snapshot"
 target_version := "target_version=" <N> "." <N> "." <N>
 snap_origin_name := "snap_origin_name=" <string>
 snap_cow_name := "snap_cow_name=" <string>
 snap_valid := "snap_valid=" <yes_no>
 snap_merge_failed := "snap_merge_failed=" <yes_no>
 snapshot_overflowed := "snapshot_overflowed=" <yes_no>
 yes_no := "y" | "n"

예제 `snap1`은 origin `253:11`, COW `253:12`, valid `y`, merge failed와 overflowed는 `n`입니다.

 E.g.
 When a 'snapshot' target is loaded, then IMA ASCII measurement log will have an entry
 similar to the following, depicting what 'snapshot' attributes are measured in EVENT_DATA
 for 'dm_table_load' event.
 (converted from ASCII to text for readability)

 dm_version=4.45.0;
 name=snap1,uuid=snap_uuid1,major=253,minor=13,minor_count=1,num_targets=1;
 target_index=0,target_begin=0,target_len=4096,target_name=snapshot,target_version=1.16.0,
 snap_origin_name=253:11,snap_cow_name=253:12,snap_valid=y,snap_merge_failed=n,snapshot_overflowed=n;

`striped` target은 stripe 수, chunk size와 각 stripe device·physical start·status를 기록합니다.

 target_attributes := <target_name> "," <target_version> "," <stripes> "," <chunk_size> ","
                      <stripe_data> ";"

 target_name := "target_name=striped"
 target_version := "target_version=" <N> "." <N> "." <N>
 stripes := "stripes=" <NS>
 chunk_size := "chunk_size=" <N>
 stripe_data := <stripe_data_row>|<stripe_data><stripe_data_row>
 stripe_data_row := <stripe_device_name> "," <stripe_physical_start> "," <stripe_status>
 stripe_device_name := "stripe_" <X> "_device_name=" <stripe_device_name_str>
                       where <X> ranges from 0 to (<NS> -1) - for <NS> described in <stripes>.
 stripe_physical_start := "stripe_" <X> "_physical_start=" <N>
                           where <X> ranges from 0 to (<NS> -1) - for <NS> described in <stripes>.
 stripe_status := "stripe_" <X> "_status=" <stripe_status_str>
                  where <X> ranges from 0 to (<NS> -1) - for <NS> described in <stripes>.
 stripe_status_str := "D" | "A"
striped measurement field
Field설명
`stripes`Stripe 수 `NS`
`chunk_size`Stripe chunk 크기
`stripe_X_device_name`X=0..NS-1 device
`stripe_X_physical_start`각 stripe physical start
`stripe_X_status``D` 또는 `A`

NS개 stripe row가 device 위치와 health를 나타냅니다.

예제 `striped1`은 chunk size 64, stripe 두 개이며 device `253:0`과 `253:3`에서 모두 physical start 2048, status `A`입니다.

 E.g.
 When a 'striped' target is loaded, then IMA ASCII measurement log will have an entry
 similar to the following, depicting what 'striped' attributes are measured in EVENT_DATA
 for 'dm_table_load' event.
 (converted from ASCII to text for readability)

 dm_version=4.45.0;
 name=striped1,uuid=striped_uuid1,major=253,minor=5,minor_count=1,num_targets=1;
 target_index=0,target_begin=0,target_len=640,target_name=striped,target_version=1.6.0,stripes=2,chunk_size=64,
    stripe_0_device_name=253:0,stripe_0_physical_start=2048,stripe_0_status=A,
    stripe_1_device_name=253:3,stripe_1_physical_start=2048,stripe_1_status=A;

verity target attribute

673-715

`verity` target은 hash 검증 상태, version, data/hash device, algorithm, root digest·salt와 verification behavior를 기록합니다.

 target_attributes := <target_name> "," <target_version> "," <hash_failed> "," <verity_version> ","
                      <data_device_name> "," <hash_device_name> "," <verity_algorithm> "," <root_digest> ","
                      <salt> "," <ignore_zero_blocks> "," <check_at_most_once> ["," <root_hash_sig_key_desc>]
                      ["," <verity_mode>] ";"

 target_name := "target_name=verity"
 target_version := "target_version=" <N> "." <N> "." <N>
 hash_failed := "hash_failed=" <hash_failed_str>
 hash_failed_str := "C" | "V"
 verity_version := "verity_version=" <verity_version_str>
 data_device_name := "data_device_name=" <data_device_name_str>
 hash_device_name := "hash_device_name=" <hash_device_name_str>
 verity_algorithm := "verity_algorithm=" <verity_algorithm_str>
 root_digest := "root_digest=" <root_digest_str>
 salt := "salt=" <salt_str>
 salt_str := "-" <verity_salt_str>
 ignore_zero_blocks := "ignore_zero_blocks=" <yes_no>
 check_at_most_once := "check_at_most_once=" <yes_no>
 root_hash_sig_key_desc := "root_hash_sig_key_desc="
 verity_mode := "verity_mode=" <verity_mode_str>
 verity_mode_str := "ignore_corruption" | "restart_on_corruption" | "panic_on_corruption" | "invalid"
 yes_no := "y" | "n"
verity measurement field
Field group내용
Status`hash_failed` 값 `C|V`, `verity_version`
Hash tree`data_device_name`, `hash_device_name`, `verity_algorithm`, `root_digest`, `salt`
Verification option`ignore_zero_blocks`, `check_at_most_once`, optional `root_hash_sig_key_desc`
Corruption mode`ignore_corruption|restart_on_corruption|panic_on_corruption|invalid`

Root of trust와 corruption policy를 attestation 가능한 data로 만듭니다.

예제 `test-verity`는 target version 1.8.0, `hash_failed=V`, verity version 1, algorithm SHA-256, 지정 root digest와 salt, `ignore_zero_blocks=n`, `check_at_most_once=n`을 기록합니다.

 E.g.
 When a 'verity' target is loaded, then IMA ASCII measurement log will have an entry
 similar to the following, depicting what 'verity' attributes are measured in EVENT_DATA
 for 'dm_table_load' event.
 (converted from ASCII to text for readability)

 dm_version=4.45.0;
 name=test-verity,uuid=,major=253,minor=2,minor_count=1,num_targets=1;
 target_index=0,target_begin=0,target_len=1953120,target_name=verity,target_version=1.8.0,hash_failed=V,
 verity_version=1,data_device_name=253:1,hash_device_name=253:0,verity_algorithm=sha256,
 root_digest=29cb87e60ce7b12b443ba6008266f3e41e93e403d7f298f8e3f316b29ff89c5e,
 salt=e48da609055204e89ae53b655ca2216dd983cf3cb829f34f63a297d106d53e2d,
 ignore_zero_blocks=n,check_at_most_once=n;