@@ -192,6 +192,7 @@ void dm_ima_measure_on_table_load(struct dm_table *table, unsigned int status_fl
192
192
* when prefixing the hash value with the hash algorithm name. e.g. sha256:<hash_value>.
193
193
*/
194
194
const size_t hash_alg_prefix_len = strlen (DM_IMA_TABLE_HASH_ALG ) + 1 ;
195
+ char table_load_event_name [] = "dm_table_load" ;
195
196
196
197
ima_buf = dm_ima_alloc (DM_IMA_MEASUREMENT_BUF_LEN , GFP_KERNEL , noio );
197
198
if (!ima_buf )
@@ -271,7 +272,7 @@ void dm_ima_measure_on_table_load(struct dm_table *table, unsigned int status_fl
271
272
* targets by prefixing the device metadata again.
272
273
*/
273
274
if (unlikely (cur_total_buf_len >= DM_IMA_MEASUREMENT_BUF_LEN )) {
274
- dm_ima_measure_data ("table_load" , ima_buf , l , noio );
275
+ dm_ima_measure_data (table_load_event_name , ima_buf , l , noio );
275
276
r = crypto_shash_update (shash , (const u8 * )ima_buf , l );
276
277
if (r < 0 )
277
278
goto error ;
@@ -280,8 +281,8 @@ void dm_ima_measure_on_table_load(struct dm_table *table, unsigned int status_fl
280
281
l = 0 ;
281
282
282
283
/*
283
- * Each new "table_load " entry in IMA log should have device data
284
- * prefix, so that multiple records from the same table_load for
284
+ * Each new "dm_table_load " entry in IMA log should have device data
285
+ * prefix, so that multiple records from the same "dm_table_load" for
285
286
* a given device can be linked together.
286
287
*/
287
288
memcpy (ima_buf + l , DM_IMA_VERSION_STR , table -> md -> ima .dm_version_str_len );
@@ -292,7 +293,7 @@ void dm_ima_measure_on_table_load(struct dm_table *table, unsigned int status_fl
292
293
293
294
/*
294
295
* If this iteration of the for loop turns out to be the last target
295
- * in the table, dm_ima_measure_data("table_load ", ...) doesn't need
296
+ * in the table, dm_ima_measure_data("dm_table_load ", ...) doesn't need
296
297
* to be called again, just the hash needs to be finalized.
297
298
* "last_target_measured" tracks this state.
298
299
*/
@@ -311,7 +312,7 @@ void dm_ima_measure_on_table_load(struct dm_table *table, unsigned int status_fl
311
312
}
312
313
313
314
if (!last_target_measured ) {
314
- dm_ima_measure_data ("table_load" , ima_buf , l , noio );
315
+ dm_ima_measure_data (table_load_event_name , ima_buf , l , noio );
315
316
316
317
r = crypto_shash_update (shash , (const u8 * )ima_buf , l );
317
318
if (r < 0 )
@@ -460,7 +461,7 @@ void dm_ima_measure_on_device_resume(struct mapped_device *md, bool swap)
460
461
memcpy (device_table_data + l , capacity_str , capacity_len );
461
462
l += capacity_len ;
462
463
463
- dm_ima_measure_data ("device_resume " , device_table_data , l , noio );
464
+ dm_ima_measure_data ("dm_device_resume " , device_table_data , l , noio );
464
465
465
466
kfree (dev_name );
466
467
kfree (dev_uuid );
@@ -577,7 +578,7 @@ void dm_ima_measure_on_device_remove(struct mapped_device *md, bool remove_all)
577
578
memcpy (device_table_data + l , capacity_str , capacity_len );
578
579
l += capacity_len ;
579
580
580
- dm_ima_measure_data ("device_remove " , device_table_data , l , noio );
581
+ dm_ima_measure_data ("dm_device_remove " , device_table_data , l , noio );
581
582
582
583
error :
583
584
kfree (device_table_data );
@@ -658,7 +659,7 @@ void dm_ima_measure_on_table_clear(struct mapped_device *md, bool new_map)
658
659
memcpy (device_table_data + l , capacity_str , capacity_len );
659
660
l += capacity_len ;
660
661
661
- dm_ima_measure_data ("table_clear " , device_table_data , l , noio );
662
+ dm_ima_measure_data ("dm_table_clear " , device_table_data , l , noio );
662
663
663
664
if (new_map ) {
664
665
if (md -> ima .inactive_table .hash &&
@@ -733,7 +734,7 @@ void dm_ima_measure_on_device_rename(struct mapped_device *md)
733
734
"%s%snew_name=%s,new_uuid=%s;%s" , DM_IMA_VERSION_STR , old_device_data ,
734
735
new_dev_name , new_dev_uuid , capacity_str );
735
736
736
- dm_ima_measure_data ("device_rename " , combined_device_data , strlen (combined_device_data ),
737
+ dm_ima_measure_data ("dm_device_rename " , combined_device_data , strlen (combined_device_data ),
737
738
noio );
738
739
739
740
goto exit ;
0 commit comments