Lines Matching refs:ima
172 memset(&(md->ima), 0, sizeof(md->ima)); in dm_ima_reset_data()
173 md->ima.dm_version_str_len = strlen(DM_IMA_VERSION_STR); in dm_ima_reset_data()
230 memcpy(ima_buf + l, DM_IMA_VERSION_STR, table->md->ima.dm_version_str_len); in dm_ima_measure_on_table_load()
231 l += table->md->ima.dm_version_str_len; in dm_ima_measure_on_table_load()
287 memcpy(ima_buf + l, DM_IMA_VERSION_STR, table->md->ima.dm_version_str_len); in dm_ima_measure_on_table_load()
288 l += table->md->ima.dm_version_str_len; in dm_ima_measure_on_table_load()
340 if (table->md->ima.active_table.hash != table->md->ima.inactive_table.hash) in dm_ima_measure_on_table_load()
341 kfree(table->md->ima.inactive_table.hash); in dm_ima_measure_on_table_load()
343 table->md->ima.inactive_table.hash = digest_buf; in dm_ima_measure_on_table_load()
344 table->md->ima.inactive_table.hash_len = strlen(digest_buf); in dm_ima_measure_on_table_load()
345 table->md->ima.inactive_table.num_targets = num_targets; in dm_ima_measure_on_table_load()
347 if (table->md->ima.active_table.device_metadata != in dm_ima_measure_on_table_load()
348 table->md->ima.inactive_table.device_metadata) in dm_ima_measure_on_table_load()
349 kfree(table->md->ima.inactive_table.device_metadata); in dm_ima_measure_on_table_load()
351 table->md->ima.inactive_table.device_metadata = device_data_buf; in dm_ima_measure_on_table_load()
352 table->md->ima.inactive_table.device_metadata_len = device_data_buf_len; in dm_ima_measure_on_table_load()
388 memcpy(device_table_data + l, DM_IMA_VERSION_STR, md->ima.dm_version_str_len); in dm_ima_measure_on_device_resume()
389 l += md->ima.dm_version_str_len; in dm_ima_measure_on_device_resume()
392 if (md->ima.active_table.hash != md->ima.inactive_table.hash) in dm_ima_measure_on_device_resume()
393 kfree(md->ima.active_table.hash); in dm_ima_measure_on_device_resume()
395 md->ima.active_table.hash = NULL; in dm_ima_measure_on_device_resume()
396 md->ima.active_table.hash_len = 0; in dm_ima_measure_on_device_resume()
398 if (md->ima.active_table.device_metadata != in dm_ima_measure_on_device_resume()
399 md->ima.inactive_table.device_metadata) in dm_ima_measure_on_device_resume()
400 kfree(md->ima.active_table.device_metadata); in dm_ima_measure_on_device_resume()
402 md->ima.active_table.device_metadata = NULL; in dm_ima_measure_on_device_resume()
403 md->ima.active_table.device_metadata_len = 0; in dm_ima_measure_on_device_resume()
404 md->ima.active_table.num_targets = 0; in dm_ima_measure_on_device_resume()
406 if (md->ima.inactive_table.hash) { in dm_ima_measure_on_device_resume()
407 md->ima.active_table.hash = md->ima.inactive_table.hash; in dm_ima_measure_on_device_resume()
408 md->ima.active_table.hash_len = md->ima.inactive_table.hash_len; in dm_ima_measure_on_device_resume()
409 md->ima.inactive_table.hash = NULL; in dm_ima_measure_on_device_resume()
410 md->ima.inactive_table.hash_len = 0; in dm_ima_measure_on_device_resume()
413 if (md->ima.inactive_table.device_metadata) { in dm_ima_measure_on_device_resume()
414 md->ima.active_table.device_metadata = in dm_ima_measure_on_device_resume()
415 md->ima.inactive_table.device_metadata; in dm_ima_measure_on_device_resume()
416 md->ima.active_table.device_metadata_len = in dm_ima_measure_on_device_resume()
417 md->ima.inactive_table.device_metadata_len; in dm_ima_measure_on_device_resume()
418 md->ima.active_table.num_targets = md->ima.inactive_table.num_targets; in dm_ima_measure_on_device_resume()
419 md->ima.inactive_table.device_metadata = NULL; in dm_ima_measure_on_device_resume()
420 md->ima.inactive_table.device_metadata_len = 0; in dm_ima_measure_on_device_resume()
421 md->ima.inactive_table.num_targets = 0; in dm_ima_measure_on_device_resume()
425 if (md->ima.active_table.device_metadata) { in dm_ima_measure_on_device_resume()
426 memcpy(device_table_data + l, md->ima.active_table.device_metadata, in dm_ima_measure_on_device_resume()
427 md->ima.active_table.device_metadata_len); in dm_ima_measure_on_device_resume()
428 l += md->ima.active_table.device_metadata_len; in dm_ima_measure_on_device_resume()
433 if (md->ima.active_table.hash) { in dm_ima_measure_on_device_resume()
437 memcpy(device_table_data + l, md->ima.active_table.hash, in dm_ima_measure_on_device_resume()
438 md->ima.active_table.hash_len); in dm_ima_measure_on_device_resume()
439 l += md->ima.active_table.hash_len; in dm_ima_measure_on_device_resume()
504 memcpy(device_table_data + l, DM_IMA_VERSION_STR, md->ima.dm_version_str_len); in dm_ima_measure_on_device_remove()
505 l += md->ima.dm_version_str_len; in dm_ima_measure_on_device_remove()
507 if (md->ima.active_table.device_metadata) { in dm_ima_measure_on_device_remove()
511 memcpy(device_table_data + l, md->ima.active_table.device_metadata, in dm_ima_measure_on_device_remove()
512 md->ima.active_table.device_metadata_len); in dm_ima_measure_on_device_remove()
513 l += md->ima.active_table.device_metadata_len; in dm_ima_measure_on_device_remove()
518 if (md->ima.inactive_table.device_metadata) { in dm_ima_measure_on_device_remove()
522 memcpy(device_table_data + l, md->ima.inactive_table.device_metadata, in dm_ima_measure_on_device_remove()
523 md->ima.inactive_table.device_metadata_len); in dm_ima_measure_on_device_remove()
524 l += md->ima.inactive_table.device_metadata_len; in dm_ima_measure_on_device_remove()
529 if (md->ima.active_table.hash) { in dm_ima_measure_on_device_remove()
533 memcpy(device_table_data + l, md->ima.active_table.hash, in dm_ima_measure_on_device_remove()
534 md->ima.active_table.hash_len); in dm_ima_measure_on_device_remove()
535 l += md->ima.active_table.hash_len; in dm_ima_measure_on_device_remove()
543 if (md->ima.inactive_table.hash) { in dm_ima_measure_on_device_remove()
547 memcpy(device_table_data + l, md->ima.inactive_table.hash, in dm_ima_measure_on_device_remove()
548 md->ima.inactive_table.hash_len); in dm_ima_measure_on_device_remove()
549 l += md->ima.inactive_table.hash_len; in dm_ima_measure_on_device_remove()
586 kfree(md->ima.active_table.device_metadata); in dm_ima_measure_on_device_remove()
588 if (md->ima.active_table.device_metadata != in dm_ima_measure_on_device_remove()
589 md->ima.inactive_table.device_metadata) in dm_ima_measure_on_device_remove()
590 kfree(md->ima.inactive_table.device_metadata); in dm_ima_measure_on_device_remove()
592 kfree(md->ima.active_table.hash); in dm_ima_measure_on_device_remove()
594 if (md->ima.active_table.hash != md->ima.inactive_table.hash) in dm_ima_measure_on_device_remove()
595 kfree(md->ima.inactive_table.hash); in dm_ima_measure_on_device_remove()
624 memcpy(device_table_data + l, DM_IMA_VERSION_STR, md->ima.dm_version_str_len); in dm_ima_measure_on_table_clear()
625 l += md->ima.dm_version_str_len; in dm_ima_measure_on_table_clear()
627 if (md->ima.inactive_table.device_metadata_len && in dm_ima_measure_on_table_clear()
628 md->ima.inactive_table.hash_len) { in dm_ima_measure_on_table_clear()
629 memcpy(device_table_data + l, md->ima.inactive_table.device_metadata, in dm_ima_measure_on_table_clear()
630 md->ima.inactive_table.device_metadata_len); in dm_ima_measure_on_table_clear()
631 l += md->ima.inactive_table.device_metadata_len; in dm_ima_measure_on_table_clear()
636 memcpy(device_table_data + l, md->ima.inactive_table.hash, in dm_ima_measure_on_table_clear()
637 md->ima.inactive_table.hash_len); in dm_ima_measure_on_table_clear()
639 l += md->ima.inactive_table.hash_len; in dm_ima_measure_on_table_clear()
664 if (md->ima.inactive_table.hash && in dm_ima_measure_on_table_clear()
665 md->ima.inactive_table.hash != md->ima.active_table.hash) in dm_ima_measure_on_table_clear()
666 kfree(md->ima.inactive_table.hash); in dm_ima_measure_on_table_clear()
668 md->ima.inactive_table.hash = NULL; in dm_ima_measure_on_table_clear()
669 md->ima.inactive_table.hash_len = 0; in dm_ima_measure_on_table_clear()
671 if (md->ima.inactive_table.device_metadata && in dm_ima_measure_on_table_clear()
672 md->ima.inactive_table.device_metadata != md->ima.active_table.device_metadata) in dm_ima_measure_on_table_clear()
673 kfree(md->ima.inactive_table.device_metadata); in dm_ima_measure_on_table_clear()
675 md->ima.inactive_table.device_metadata = NULL; in dm_ima_measure_on_table_clear()
676 md->ima.inactive_table.device_metadata_len = 0; in dm_ima_measure_on_table_clear()
677 md->ima.inactive_table.num_targets = 0; in dm_ima_measure_on_table_clear()
679 if (md->ima.active_table.hash) { in dm_ima_measure_on_table_clear()
680 md->ima.inactive_table.hash = md->ima.active_table.hash; in dm_ima_measure_on_table_clear()
681 md->ima.inactive_table.hash_len = md->ima.active_table.hash_len; in dm_ima_measure_on_table_clear()
684 if (md->ima.active_table.device_metadata) { in dm_ima_measure_on_table_clear()
685 md->ima.inactive_table.device_metadata = in dm_ima_measure_on_table_clear()
686 md->ima.active_table.device_metadata; in dm_ima_measure_on_table_clear()
687 md->ima.inactive_table.device_metadata_len = in dm_ima_measure_on_table_clear()
688 md->ima.active_table.device_metadata_len; in dm_ima_measure_on_table_clear()
689 md->ima.inactive_table.num_targets = in dm_ima_measure_on_table_clear()
690 md->ima.active_table.num_targets; in dm_ima_measure_on_table_clear()
713 md->ima.active_table.num_targets, noio)) in dm_ima_measure_on_device_rename()
727 old_device_data = md->ima.active_table.device_metadata; in dm_ima_measure_on_device_rename()
729 md->ima.active_table.device_metadata = new_device_data; in dm_ima_measure_on_device_rename()
730 md->ima.active_table.device_metadata_len = strlen(new_device_data); in dm_ima_measure_on_device_rename()