Lines Matching refs:ima
171 memset(&(md->ima), 0, sizeof(md->ima)); in dm_ima_reset_data()
172 md->ima.dm_version_str_len = strlen(DM_IMA_VERSION_STR); in dm_ima_reset_data()
229 memcpy(ima_buf + l, DM_IMA_VERSION_STR, table->md->ima.dm_version_str_len); in dm_ima_measure_on_table_load()
230 l += table->md->ima.dm_version_str_len; in dm_ima_measure_on_table_load()
286 memcpy(ima_buf + l, DM_IMA_VERSION_STR, table->md->ima.dm_version_str_len); in dm_ima_measure_on_table_load()
287 l += table->md->ima.dm_version_str_len; in dm_ima_measure_on_table_load()
339 if (table->md->ima.active_table.hash != table->md->ima.inactive_table.hash) in dm_ima_measure_on_table_load()
340 kfree(table->md->ima.inactive_table.hash); in dm_ima_measure_on_table_load()
342 table->md->ima.inactive_table.hash = digest_buf; in dm_ima_measure_on_table_load()
343 table->md->ima.inactive_table.hash_len = strlen(digest_buf); in dm_ima_measure_on_table_load()
344 table->md->ima.inactive_table.num_targets = num_targets; in dm_ima_measure_on_table_load()
346 if (table->md->ima.active_table.device_metadata != in dm_ima_measure_on_table_load()
347 table->md->ima.inactive_table.device_metadata) in dm_ima_measure_on_table_load()
348 kfree(table->md->ima.inactive_table.device_metadata); in dm_ima_measure_on_table_load()
350 table->md->ima.inactive_table.device_metadata = device_data_buf; in dm_ima_measure_on_table_load()
351 table->md->ima.inactive_table.device_metadata_len = device_data_buf_len; in dm_ima_measure_on_table_load()
387 memcpy(device_table_data + l, DM_IMA_VERSION_STR, md->ima.dm_version_str_len); in dm_ima_measure_on_device_resume()
388 l += md->ima.dm_version_str_len; in dm_ima_measure_on_device_resume()
391 if (md->ima.active_table.hash != md->ima.inactive_table.hash) in dm_ima_measure_on_device_resume()
392 kfree(md->ima.active_table.hash); in dm_ima_measure_on_device_resume()
394 md->ima.active_table.hash = NULL; in dm_ima_measure_on_device_resume()
395 md->ima.active_table.hash_len = 0; in dm_ima_measure_on_device_resume()
397 if (md->ima.active_table.device_metadata != in dm_ima_measure_on_device_resume()
398 md->ima.inactive_table.device_metadata) in dm_ima_measure_on_device_resume()
399 kfree(md->ima.active_table.device_metadata); in dm_ima_measure_on_device_resume()
401 md->ima.active_table.device_metadata = NULL; in dm_ima_measure_on_device_resume()
402 md->ima.active_table.device_metadata_len = 0; in dm_ima_measure_on_device_resume()
403 md->ima.active_table.num_targets = 0; in dm_ima_measure_on_device_resume()
405 if (md->ima.inactive_table.hash) { in dm_ima_measure_on_device_resume()
406 md->ima.active_table.hash = md->ima.inactive_table.hash; in dm_ima_measure_on_device_resume()
407 md->ima.active_table.hash_len = md->ima.inactive_table.hash_len; in dm_ima_measure_on_device_resume()
408 md->ima.inactive_table.hash = NULL; in dm_ima_measure_on_device_resume()
409 md->ima.inactive_table.hash_len = 0; in dm_ima_measure_on_device_resume()
412 if (md->ima.inactive_table.device_metadata) { in dm_ima_measure_on_device_resume()
413 md->ima.active_table.device_metadata = in dm_ima_measure_on_device_resume()
414 md->ima.inactive_table.device_metadata; in dm_ima_measure_on_device_resume()
415 md->ima.active_table.device_metadata_len = in dm_ima_measure_on_device_resume()
416 md->ima.inactive_table.device_metadata_len; in dm_ima_measure_on_device_resume()
417 md->ima.active_table.num_targets = md->ima.inactive_table.num_targets; in dm_ima_measure_on_device_resume()
418 md->ima.inactive_table.device_metadata = NULL; in dm_ima_measure_on_device_resume()
419 md->ima.inactive_table.device_metadata_len = 0; in dm_ima_measure_on_device_resume()
420 md->ima.inactive_table.num_targets = 0; in dm_ima_measure_on_device_resume()
424 if (md->ima.active_table.device_metadata) { in dm_ima_measure_on_device_resume()
425 memcpy(device_table_data + l, md->ima.active_table.device_metadata, in dm_ima_measure_on_device_resume()
426 md->ima.active_table.device_metadata_len); in dm_ima_measure_on_device_resume()
427 l += md->ima.active_table.device_metadata_len; in dm_ima_measure_on_device_resume()
432 if (md->ima.active_table.hash) { in dm_ima_measure_on_device_resume()
436 memcpy(device_table_data + l, md->ima.active_table.hash, in dm_ima_measure_on_device_resume()
437 md->ima.active_table.hash_len); in dm_ima_measure_on_device_resume()
438 l += md->ima.active_table.hash_len; in dm_ima_measure_on_device_resume()
503 memcpy(device_table_data + l, DM_IMA_VERSION_STR, md->ima.dm_version_str_len); in dm_ima_measure_on_device_remove()
504 l += md->ima.dm_version_str_len; in dm_ima_measure_on_device_remove()
506 if (md->ima.active_table.device_metadata) { in dm_ima_measure_on_device_remove()
510 memcpy(device_table_data + l, md->ima.active_table.device_metadata, in dm_ima_measure_on_device_remove()
511 md->ima.active_table.device_metadata_len); in dm_ima_measure_on_device_remove()
512 l += md->ima.active_table.device_metadata_len; in dm_ima_measure_on_device_remove()
517 if (md->ima.inactive_table.device_metadata) { in dm_ima_measure_on_device_remove()
521 memcpy(device_table_data + l, md->ima.inactive_table.device_metadata, in dm_ima_measure_on_device_remove()
522 md->ima.inactive_table.device_metadata_len); in dm_ima_measure_on_device_remove()
523 l += md->ima.inactive_table.device_metadata_len; in dm_ima_measure_on_device_remove()
528 if (md->ima.active_table.hash) { in dm_ima_measure_on_device_remove()
532 memcpy(device_table_data + l, md->ima.active_table.hash, in dm_ima_measure_on_device_remove()
533 md->ima.active_table.hash_len); in dm_ima_measure_on_device_remove()
534 l += md->ima.active_table.hash_len; in dm_ima_measure_on_device_remove()
542 if (md->ima.inactive_table.hash) { in dm_ima_measure_on_device_remove()
546 memcpy(device_table_data + l, md->ima.inactive_table.hash, in dm_ima_measure_on_device_remove()
547 md->ima.inactive_table.hash_len); in dm_ima_measure_on_device_remove()
548 l += md->ima.inactive_table.hash_len; in dm_ima_measure_on_device_remove()
585 kfree(md->ima.active_table.device_metadata); in dm_ima_measure_on_device_remove()
587 if (md->ima.active_table.device_metadata != in dm_ima_measure_on_device_remove()
588 md->ima.inactive_table.device_metadata) in dm_ima_measure_on_device_remove()
589 kfree(md->ima.inactive_table.device_metadata); in dm_ima_measure_on_device_remove()
591 kfree(md->ima.active_table.hash); in dm_ima_measure_on_device_remove()
593 if (md->ima.active_table.hash != md->ima.inactive_table.hash) in dm_ima_measure_on_device_remove()
594 kfree(md->ima.inactive_table.hash); in dm_ima_measure_on_device_remove()
623 memcpy(device_table_data + l, DM_IMA_VERSION_STR, md->ima.dm_version_str_len); in dm_ima_measure_on_table_clear()
624 l += md->ima.dm_version_str_len; in dm_ima_measure_on_table_clear()
626 if (md->ima.inactive_table.device_metadata_len && in dm_ima_measure_on_table_clear()
627 md->ima.inactive_table.hash_len) { in dm_ima_measure_on_table_clear()
628 memcpy(device_table_data + l, md->ima.inactive_table.device_metadata, in dm_ima_measure_on_table_clear()
629 md->ima.inactive_table.device_metadata_len); in dm_ima_measure_on_table_clear()
630 l += md->ima.inactive_table.device_metadata_len; in dm_ima_measure_on_table_clear()
635 memcpy(device_table_data + l, md->ima.inactive_table.hash, in dm_ima_measure_on_table_clear()
636 md->ima.inactive_table.hash_len); in dm_ima_measure_on_table_clear()
638 l += md->ima.inactive_table.hash_len; in dm_ima_measure_on_table_clear()
663 if (md->ima.inactive_table.hash && in dm_ima_measure_on_table_clear()
664 md->ima.inactive_table.hash != md->ima.active_table.hash) in dm_ima_measure_on_table_clear()
665 kfree(md->ima.inactive_table.hash); in dm_ima_measure_on_table_clear()
667 md->ima.inactive_table.hash = NULL; in dm_ima_measure_on_table_clear()
668 md->ima.inactive_table.hash_len = 0; in dm_ima_measure_on_table_clear()
670 if (md->ima.inactive_table.device_metadata && in dm_ima_measure_on_table_clear()
671 md->ima.inactive_table.device_metadata != md->ima.active_table.device_metadata) in dm_ima_measure_on_table_clear()
672 kfree(md->ima.inactive_table.device_metadata); in dm_ima_measure_on_table_clear()
674 md->ima.inactive_table.device_metadata = NULL; in dm_ima_measure_on_table_clear()
675 md->ima.inactive_table.device_metadata_len = 0; in dm_ima_measure_on_table_clear()
676 md->ima.inactive_table.num_targets = 0; in dm_ima_measure_on_table_clear()
678 if (md->ima.active_table.hash) { in dm_ima_measure_on_table_clear()
679 md->ima.inactive_table.hash = md->ima.active_table.hash; in dm_ima_measure_on_table_clear()
680 md->ima.inactive_table.hash_len = md->ima.active_table.hash_len; in dm_ima_measure_on_table_clear()
683 if (md->ima.active_table.device_metadata) { in dm_ima_measure_on_table_clear()
684 md->ima.inactive_table.device_metadata = in dm_ima_measure_on_table_clear()
685 md->ima.active_table.device_metadata; in dm_ima_measure_on_table_clear()
686 md->ima.inactive_table.device_metadata_len = in dm_ima_measure_on_table_clear()
687 md->ima.active_table.device_metadata_len; in dm_ima_measure_on_table_clear()
688 md->ima.inactive_table.num_targets = in dm_ima_measure_on_table_clear()
689 md->ima.active_table.num_targets; in dm_ima_measure_on_table_clear()
712 md->ima.active_table.num_targets, noio)) in dm_ima_measure_on_device_rename()
726 old_device_data = md->ima.active_table.device_metadata; in dm_ima_measure_on_device_rename()
728 md->ima.active_table.device_metadata = new_device_data; in dm_ima_measure_on_device_rename()
729 md->ima.active_table.device_metadata_len = strlen(new_device_data); in dm_ima_measure_on_device_rename()