Commit eb8dae96 authored by Eric Paris's avatar Eric Paris Committed by James Morris

IMA: include the word IMA in printk messages

As an example IMA emits a warning when it can't find a TPM chip:

"No TPM chip found, activating TPM-bypass!"

This patch prefaces that message with IMA so we know what subsystem is
bypassing the TPM.  Do this for all pr_info and pr_err messages.
Signed-off-by: default avatarEric Paris <eparis@redhat.com>
Acked-by: default avatarMimi Zohar <zohar@us.ibm.com>
Signed-off-by: default avatarJames Morris <jmorris@namei.org>
parent 34c111f6
...@@ -26,7 +26,7 @@ static int init_desc(struct hash_desc *desc) ...@@ -26,7 +26,7 @@ static int init_desc(struct hash_desc *desc)
desc->tfm = crypto_alloc_hash(ima_hash, 0, CRYPTO_ALG_ASYNC); desc->tfm = crypto_alloc_hash(ima_hash, 0, CRYPTO_ALG_ASYNC);
if (IS_ERR(desc->tfm)) { if (IS_ERR(desc->tfm)) {
pr_info("failed to load %s transform: %ld\n", pr_info("IMA: failed to load %s transform: %ld\n",
ima_hash, PTR_ERR(desc->tfm)); ima_hash, PTR_ERR(desc->tfm));
rc = PTR_ERR(desc->tfm); rc = PTR_ERR(desc->tfm);
return rc; return rc;
...@@ -111,7 +111,7 @@ static void __init ima_pcrread(int idx, u8 *pcr) ...@@ -111,7 +111,7 @@ static void __init ima_pcrread(int idx, u8 *pcr)
return; return;
if (tpm_pcr_read(TPM_ANY_NUM, idx, pcr) != 0) if (tpm_pcr_read(TPM_ANY_NUM, idx, pcr) != 0)
pr_err("Error Communicating to TPM chip\n"); pr_err("IMA: Error Communicating to TPM chip\n");
} }
/* /*
......
...@@ -82,7 +82,7 @@ int __init ima_init(void) ...@@ -82,7 +82,7 @@ int __init ima_init(void)
ima_used_chip = 1; ima_used_chip = 1;
if (!ima_used_chip) if (!ima_used_chip)
pr_info("No TPM chip found, activating TPM-bypass!\n"); pr_info("IMA: No TPM chip found, activating TPM-bypass!\n");
ima_add_boot_aggregate(); /* boot aggregate must be first entry */ ima_add_boot_aggregate(); /* boot aggregate must be first entry */
ima_init_policy(); ima_init_policy();
......
...@@ -70,7 +70,7 @@ static int ima_add_digest_entry(struct ima_template_entry *entry) ...@@ -70,7 +70,7 @@ static int ima_add_digest_entry(struct ima_template_entry *entry)
qe = kmalloc(sizeof(*qe), GFP_KERNEL); qe = kmalloc(sizeof(*qe), GFP_KERNEL);
if (qe == NULL) { if (qe == NULL) {
pr_err("OUT OF MEMORY ERROR creating queue entry.\n"); pr_err("IMA: OUT OF MEMORY ERROR creating queue entry.\n");
return -ENOMEM; return -ENOMEM;
} }
qe->entry = entry; qe->entry = entry;
...@@ -93,7 +93,7 @@ static int ima_pcr_extend(const u8 *hash) ...@@ -93,7 +93,7 @@ static int ima_pcr_extend(const u8 *hash)
result = tpm_pcr_extend(TPM_ANY_NUM, CONFIG_IMA_MEASURE_PCR_IDX, hash); result = tpm_pcr_extend(TPM_ANY_NUM, CONFIG_IMA_MEASURE_PCR_IDX, hash);
if (result != 0) if (result != 0)
pr_err("Error Communicating to TPM chip\n"); pr_err("IMA: Error Communicating to TPM chip\n");
return result; return result;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment