Skip to content

Commit eb8dae9

Browse files
eparisxjamesmorris
authored andcommitted
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: Eric Paris <eparis@redhat.com> Acked-by: Mimi Zohar <zohar@us.ibm.com> Signed-off-by: James Morris <jmorris@namei.org>
1 parent 34c111f commit eb8dae9

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

‎security/integrity/ima/ima_crypto.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ static int init_desc(struct hash_desc *desc)
2626

2727
desc->tfm = crypto_alloc_hash(ima_hash, 0, CRYPTO_ALG_ASYNC);
2828
if (IS_ERR(desc->tfm)) {
29-
pr_info("failed to load %s transform: %ld\n",
29+
pr_info("IMA: failed to load %s transform: %ld\n",
3030
ima_hash, PTR_ERR(desc->tfm));
3131
rc = PTR_ERR(desc->tfm);
3232
return rc;
@@ -111,7 +111,7 @@ static void __init ima_pcrread(int idx, u8 *pcr)
111111
return;
112112

113113
if (tpm_pcr_read(TPM_ANY_NUM, idx, pcr) != 0)
114-
pr_err("Error Communicating to TPM chip\n");
114+
pr_err("IMA: Error Communicating to TPM chip\n");
115115
}
116116

117117
/*

‎security/integrity/ima/ima_init.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ int __init ima_init(void)
8282
ima_used_chip = 1;
8383

8484
if (!ima_used_chip)
85-
pr_info("No TPM chip found, activating TPM-bypass!\n");
85+
pr_info("IMA: No TPM chip found, activating TPM-bypass!\n");
8686

8787
ima_add_boot_aggregate(); /* boot aggregate must be first entry */
8888
ima_init_policy();

‎security/integrity/ima/ima_queue.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ static int ima_add_digest_entry(struct ima_template_entry *entry)
7070

7171
qe = kmalloc(sizeof(*qe), GFP_KERNEL);
7272
if (qe == NULL) {
73-
pr_err("OUT OF MEMORY ERROR creating queue entry.\n");
73+
pr_err("IMA: OUT OF MEMORY ERROR creating queue entry.\n");
7474
return -ENOMEM;
7575
}
7676
qe->entry = entry;
@@ -93,7 +93,7 @@ static int ima_pcr_extend(const u8 *hash)
9393

9494
result = tpm_pcr_extend(TPM_ANY_NUM, CONFIG_IMA_MEASURE_PCR_IDX, hash);
9595
if (result != 0)
96-
pr_err("Error Communicating to TPM chip\n");
96+
pr_err("IMA: Error Communicating to TPM chip\n");
9797
return result;
9898
}
9999

0 commit comments

Comments
 (0)