Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 20ee451f authored by Joe Perches's avatar Joe Perches Committed by Mimi Zohar
Browse files

security: integrity: Use a more current logging style



Convert printks to pr_<level>.
Add pr_fmt.
Remove embedded prefixes.

Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarMimi Zohar <zohar@linux.vnet.ibm.com>
parent 74dd744f
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -13,6 +13,8 @@
 *	 Using root's kernel master key (kmk), calculate the HMAC
 */

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/module.h>
#include <linux/crypto.h>
#include <linux/xattr.h>
@@ -221,7 +223,7 @@ int evm_init_hmac(struct inode *inode, const struct xattr *lsm_xattr,

	desc = init_desc(EVM_XATTR_HMAC);
	if (IS_ERR(desc)) {
		printk(KERN_INFO "init_desc failed\n");
		pr_info("init_desc failed\n");
		return PTR_ERR(desc);
	}

+4 −2
Original line number Diff line number Diff line
@@ -14,6 +14,8 @@
 *	evm_inode_removexattr, and evm_verifyxattr
 */

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/module.h>
#include <linux/crypto.h>
#include <linux/audit.h>
@@ -432,7 +434,7 @@ static int __init init_evm(void)

	error = evm_init_secfs();
	if (error < 0) {
		printk(KERN_INFO "EVM: Error registering secfs\n");
		pr_info("Error registering secfs\n");
		goto err;
	}

@@ -449,7 +451,7 @@ static int __init evm_display_config(void)
	char **xattrname;

	for (xattrname = evm_config_xattrnames; *xattrname != NULL; xattrname++)
		printk(KERN_INFO "EVM: %s\n", *xattrname);
		pr_info("%s\n", *xattrname);
	return 0;
}

+4 −2
Original line number Diff line number Diff line
@@ -13,6 +13,8 @@
 *	- Get the key and enable EVM
 */

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/uaccess.h>
#include <linux/module.h>
#include "evm.h"
@@ -79,9 +81,9 @@ static ssize_t evm_write_key(struct file *file, const char __user *buf,
	error = evm_init_key();
	if (!error) {
		evm_initialized = 1;
		pr_info("EVM: initialized\n");
		pr_info("initialized\n");
	} else
		pr_err("EVM: initialization failed\n");
		pr_err("initialization failed\n");
	return count;
}

+3 −1
Original line number Diff line number Diff line
@@ -13,6 +13,8 @@
 * 	Calculates md5/sha1 file hash, template hash, boot-aggreate hash
 */

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/kernel.h>
#include <linux/file.h>
#include <linux/crypto.h>
@@ -212,7 +214,7 @@ static void __init ima_pcrread(int idx, u8 *pcr)
		return;

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

/*
+4 −1
Original line number Diff line number Diff line
@@ -14,6 +14,9 @@
 * File: ima_init.c
 *             initialization and cleanup functions
 */

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/module.h>
#include <linux/scatterlist.h>
#include <linux/slab.h>
@@ -93,7 +96,7 @@ int __init ima_init(void)
		ima_used_chip = 1;

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

	rc = ima_init_crypto();
	if (rc)
Loading