Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Eric Paris and committed by
James Morris
eb8dae96 34c111f6

+5 -5
+2 -2
security/integrity/ima/ima_crypto.c
··· 26 26 27 27 desc->tfm = crypto_alloc_hash(ima_hash, 0, CRYPTO_ALG_ASYNC); 28 28 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", 30 30 ima_hash, PTR_ERR(desc->tfm)); 31 31 rc = PTR_ERR(desc->tfm); 32 32 return rc; ··· 111 111 return; 112 112 113 113 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"); 115 115 } 116 116 117 117 /*
+1 -1
security/integrity/ima/ima_init.c
··· 82 82 ima_used_chip = 1; 83 83 84 84 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"); 86 86 87 87 ima_add_boot_aggregate(); /* boot aggregate must be first entry */ 88 88 ima_init_policy();
+2 -2
security/integrity/ima/ima_queue.c
··· 70 70 71 71 qe = kmalloc(sizeof(*qe), GFP_KERNEL); 72 72 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"); 74 74 return -ENOMEM; 75 75 } 76 76 qe->entry = entry; ··· 93 93 94 94 result = tpm_pcr_extend(TPM_ANY_NUM, CONFIG_IMA_MEASURE_PCR_IDX, hash); 95 95 if (result != 0) 96 - pr_err("Error Communicating to TPM chip\n"); 96 + pr_err("IMA: Error Communicating to TPM chip\n"); 97 97 return result; 98 98 } 99 99