int __init ima_init(void) { u8 pcr_i[TPM_DIGEST_SIZE]; int rc; ima_used_chip = 0; rc = tpm_pcr_read(TPM_ANY_NUM, 0, pcr_i); if (rc == 0) ima_used_chip = 1; if (!ima_used_chip) pr_info("No TPM chip found, activating TPM-bypass! (rc=%d)\n", rc); rc = integrity_init_keyring(INTEGRITY_KEYRING_IMA); if (rc) return rc; rc = ima_init_crypto(); if (rc) return rc; rc = ima_init_template(); if (rc != 0) return rc; ima_load_kexec_buffer(); rc = ima_add_boot_aggregate(); /* boot aggregate must be first entry */ if (rc != 0) return rc; ima_init_policy(); return ima_fs_init(); }
int __init ima_init(void) { u8 pcr_i[TPM_DIGEST_SIZE]; int rc; ima_used_chip = 0; rc = tpm_pcr_read(TPM_ANY_NUM, 0, pcr_i); if (rc == 0) ima_used_chip = 1; if (!ima_used_chip) pr_info("IMA: No TPM chip found, activating TPM-bypass!\n"); rc = ima_init_crypto(); if (rc) return rc; rc = ima_init_template(); if (rc != 0) return rc; ima_add_boot_aggregate(); /* boot aggregate must be first entry */ ima_init_policy(); return ima_fs_init(); }