aboutsummaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2014-02-24 16:59:56 -0500
committerMimi Zohar <zohar@linux.vnet.ibm.com>2014-03-07 12:15:21 -0500
commit20ee451f5a7cd43edda56ba36cbec4d881d3329f (patch)
tree38acf7ca59128f42987dfc43e2dfdebfcd967667 /security
parent74dd744fd7f7492a52cf2f0312640ae714bd8180 (diff)
security: integrity: Use a more current logging style
Convert printks to pr_<level>. Add pr_fmt. Remove embedded prefixes. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
Diffstat (limited to 'security')
-rw-r--r--security/integrity/evm/evm_crypto.c4
-rw-r--r--security/integrity/evm/evm_main.c6
-rw-r--r--security/integrity/evm/evm_secfs.c6
-rw-r--r--security/integrity/ima/ima_crypto.c4
-rw-r--r--security/integrity/ima/ima_init.c5
-rw-r--r--security/integrity/ima/ima_queue.c8
-rw-r--r--security/integrity/ima/ima_template.c5
7 files changed, 27 insertions, 11 deletions
diff --git a/security/integrity/evm/evm_crypto.c b/security/integrity/evm/evm_crypto.c
index 3bab89eb21d6..9bd329f1927a 100644
--- a/security/integrity/evm/evm_crypto.c
+++ b/security/integrity/evm/evm_crypto.c
@@ -13,6 +13,8 @@
13 * Using root's kernel master key (kmk), calculate the HMAC 13 * Using root's kernel master key (kmk), calculate the HMAC
14 */ 14 */
15 15
16#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
17
16#include <linux/module.h> 18#include <linux/module.h>
17#include <linux/crypto.h> 19#include <linux/crypto.h>
18#include <linux/xattr.h> 20#include <linux/xattr.h>
@@ -221,7 +223,7 @@ int evm_init_hmac(struct inode *inode, const struct xattr *lsm_xattr,
221 223
222 desc = init_desc(EVM_XATTR_HMAC); 224 desc = init_desc(EVM_XATTR_HMAC);
223 if (IS_ERR(desc)) { 225 if (IS_ERR(desc)) {
224 printk(KERN_INFO "init_desc failed\n"); 226 pr_info("init_desc failed\n");
225 return PTR_ERR(desc); 227 return PTR_ERR(desc);
226 } 228 }
227 229
diff --git a/security/integrity/evm/evm_main.c b/security/integrity/evm/evm_main.c
index 336b3ddfe63f..996092f21b64 100644
--- a/security/integrity/evm/evm_main.c
+++ b/security/integrity/evm/evm_main.c
@@ -14,6 +14,8 @@
14 * evm_inode_removexattr, and evm_verifyxattr 14 * evm_inode_removexattr, and evm_verifyxattr
15 */ 15 */
16 16
17#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
18
17#include <linux/module.h> 19#include <linux/module.h>
18#include <linux/crypto.h> 20#include <linux/crypto.h>
19#include <linux/audit.h> 21#include <linux/audit.h>
@@ -432,7 +434,7 @@ static int __init init_evm(void)
432 434
433 error = evm_init_secfs(); 435 error = evm_init_secfs();
434 if (error < 0) { 436 if (error < 0) {
435 printk(KERN_INFO "EVM: Error registering secfs\n"); 437 pr_info("Error registering secfs\n");
436 goto err; 438 goto err;
437 } 439 }
438 440
@@ -449,7 +451,7 @@ static int __init evm_display_config(void)
449 char **xattrname; 451 char **xattrname;
450 452
451 for (xattrname = evm_config_xattrnames; *xattrname != NULL; xattrname++) 453 for (xattrname = evm_config_xattrnames; *xattrname != NULL; xattrname++)
452 printk(KERN_INFO "EVM: %s\n", *xattrname); 454 pr_info("%s\n", *xattrname);
453 return 0; 455 return 0;
454} 456}
455 457
diff --git a/security/integrity/evm/evm_secfs.c b/security/integrity/evm/evm_secfs.c
index 30f670ad6ac3..cf12a04717d3 100644
--- a/security/integrity/evm/evm_secfs.c
+++ b/security/integrity/evm/evm_secfs.c
@@ -13,6 +13,8 @@
13 * - Get the key and enable EVM 13 * - Get the key and enable EVM
14 */ 14 */
15 15
16#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
17
16#include <linux/uaccess.h> 18#include <linux/uaccess.h>
17#include <linux/module.h> 19#include <linux/module.h>
18#include "evm.h" 20#include "evm.h"
@@ -79,9 +81,9 @@ static ssize_t evm_write_key(struct file *file, const char __user *buf,
79 error = evm_init_key(); 81 error = evm_init_key();
80 if (!error) { 82 if (!error) {
81 evm_initialized = 1; 83 evm_initialized = 1;
82 pr_info("EVM: initialized\n"); 84 pr_info("initialized\n");
83 } else 85 } else
84 pr_err("EVM: initialization failed\n"); 86 pr_err("initialization failed\n");
85 return count; 87 return count;
86} 88}
87 89
diff --git a/security/integrity/ima/ima_crypto.c b/security/integrity/ima/ima_crypto.c
index d8b55c952005..99990578b7cd 100644
--- a/security/integrity/ima/ima_crypto.c
+++ b/security/integrity/ima/ima_crypto.c
@@ -13,6 +13,8 @@
13 * Calculates md5/sha1 file hash, template hash, boot-aggreate hash 13 * Calculates md5/sha1 file hash, template hash, boot-aggreate hash
14 */ 14 */
15 15
16#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
17
16#include <linux/kernel.h> 18#include <linux/kernel.h>
17#include <linux/file.h> 19#include <linux/file.h>
18#include <linux/crypto.h> 20#include <linux/crypto.h>
@@ -212,7 +214,7 @@ static void __init ima_pcrread(int idx, u8 *pcr)
212 return; 214 return;
213 215
214 if (tpm_pcr_read(TPM_ANY_NUM, idx, pcr) != 0) 216 if (tpm_pcr_read(TPM_ANY_NUM, idx, pcr) != 0)
215 pr_err("IMA: Error Communicating to TPM chip\n"); 217 pr_err("Error Communicating to TPM chip\n");
216} 218}
217 219
218/* 220/*
diff --git a/security/integrity/ima/ima_init.c b/security/integrity/ima/ima_init.c
index 315f2b96496f..e8f9d70a465d 100644
--- a/security/integrity/ima/ima_init.c
+++ b/security/integrity/ima/ima_init.c
@@ -14,6 +14,9 @@
14 * File: ima_init.c 14 * File: ima_init.c
15 * initialization and cleanup functions 15 * initialization and cleanup functions
16 */ 16 */
17
18#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
19
17#include <linux/module.h> 20#include <linux/module.h>
18#include <linux/scatterlist.h> 21#include <linux/scatterlist.h>
19#include <linux/slab.h> 22#include <linux/slab.h>
@@ -93,7 +96,7 @@ int __init ima_init(void)
93 ima_used_chip = 1; 96 ima_used_chip = 1;
94 97
95 if (!ima_used_chip) 98 if (!ima_used_chip)
96 pr_info("IMA: No TPM chip found, activating TPM-bypass!\n"); 99 pr_info("No TPM chip found, activating TPM-bypass!\n");
97 100
98 rc = ima_init_crypto(); 101 rc = ima_init_crypto();
99 if (rc) 102 if (rc)
diff --git a/security/integrity/ima/ima_queue.c b/security/integrity/ima/ima_queue.c
index d85e99761f4f..91128b4b812a 100644
--- a/security/integrity/ima/ima_queue.c
+++ b/security/integrity/ima/ima_queue.c
@@ -18,6 +18,9 @@
18 * The measurement list is append-only. No entry is 18 * The measurement list is append-only. No entry is
19 * ever removed or changed during the boot-cycle. 19 * ever removed or changed during the boot-cycle.
20 */ 20 */
21
22#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
23
21#include <linux/module.h> 24#include <linux/module.h>
22#include <linux/rculist.h> 25#include <linux/rculist.h>
23#include <linux/slab.h> 26#include <linux/slab.h>
@@ -72,7 +75,7 @@ static int ima_add_digest_entry(struct ima_template_entry *entry)
72 75
73 qe = kmalloc(sizeof(*qe), GFP_KERNEL); 76 qe = kmalloc(sizeof(*qe), GFP_KERNEL);
74 if (qe == NULL) { 77 if (qe == NULL) {
75 pr_err("IMA: OUT OF MEMORY ERROR creating queue entry.\n"); 78 pr_err("OUT OF MEMORY ERROR creating queue entry\n");
76 return -ENOMEM; 79 return -ENOMEM;
77 } 80 }
78 qe->entry = entry; 81 qe->entry = entry;
@@ -95,8 +98,7 @@ static int ima_pcr_extend(const u8 *hash)
95 98
96 result = tpm_pcr_extend(TPM_ANY_NUM, CONFIG_IMA_MEASURE_PCR_IDX, hash); 99 result = tpm_pcr_extend(TPM_ANY_NUM, CONFIG_IMA_MEASURE_PCR_IDX, hash);
97 if (result != 0) 100 if (result != 0)
98 pr_err("IMA: Error Communicating to TPM chip, result: %d\n", 101 pr_err("Error Communicating to TPM chip, result: %d\n", result);
99 result);
100 return result; 102 return result;
101} 103}
102 104
diff --git a/security/integrity/ima/ima_template.c b/security/integrity/ima/ima_template.c
index 635695f6a185..9a4a0d182610 100644
--- a/security/integrity/ima/ima_template.c
+++ b/security/integrity/ima/ima_template.c
@@ -12,6 +12,9 @@
12 * File: ima_template.c 12 * File: ima_template.c
13 * Helpers to manage template descriptors. 13 * Helpers to manage template descriptors.
14 */ 14 */
15
16#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
17
15#include <crypto/hash_info.h> 18#include <crypto/hash_info.h>
16 19
17#include "ima.h" 20#include "ima.h"
@@ -58,7 +61,7 @@ static int __init ima_template_setup(char *str)
58 */ 61 */
59 if (template_len == 3 && strcmp(str, IMA_TEMPLATE_IMA_NAME) == 0 && 62 if (template_len == 3 && strcmp(str, IMA_TEMPLATE_IMA_NAME) == 0 &&
60 ima_hash_algo != HASH_ALGO_SHA1 && ima_hash_algo != HASH_ALGO_MD5) { 63 ima_hash_algo != HASH_ALGO_SHA1 && ima_hash_algo != HASH_ALGO_MD5) {
61 pr_err("IMA: template does not support hash alg\n"); 64 pr_err("template does not support hash alg\n");
62 return 1; 65 return 1;
63 } 66 }
64 67