ima: Unify logging

Define pr_fmt everywhere.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>  (powerpc build error)
Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com>

Changelog:
Previous pr_fmt definition was too late and caused problems in powerpc
allyesconfg build.
This commit is contained in:
Petr Vorel 2018-04-24 16:30:38 +02:00 committed by Mimi Zohar
parent ffb122de9a
commit de636769c8
3 changed files with 9 additions and 2 deletions

View File

@ -15,6 +15,9 @@
* implemenents security file system for reporting * implemenents security file system for reporting
* current measurement list and IMA statistics * current measurement list and IMA statistics
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/fcntl.h> #include <linux/fcntl.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/module.h> #include <linux/module.h>
@ -336,7 +339,7 @@ static ssize_t ima_write_policy(struct file *file, const char __user *buf,
if (data[0] == '/') { if (data[0] == '/') {
result = ima_read_policy(data); result = ima_read_policy(data);
} else if (ima_appraise & IMA_APPRAISE_POLICY) { } else if (ima_appraise & IMA_APPRAISE_POLICY) {
pr_err("IMA: signed policy file (specified as an absolute pathname) required\n"); pr_err("signed policy file (specified as an absolute pathname) required\n");
integrity_audit_msg(AUDIT_INTEGRITY_STATUS, NULL, NULL, integrity_audit_msg(AUDIT_INTEGRITY_STATUS, NULL, NULL,
"policy_update", "signed policy required", "policy_update", "signed policy required",
1, 0); 1, 0);
@ -417,7 +420,7 @@ static int ima_release_policy(struct inode *inode, struct file *file)
valid_policy = 0; valid_policy = 0;
} }
pr_info("IMA: policy update %s\n", cause); pr_info("policy update %s\n", cause);
integrity_audit_msg(AUDIT_INTEGRITY_STATUS, NULL, NULL, integrity_audit_msg(AUDIT_INTEGRITY_STATUS, NULL, NULL,
"policy_update", cause, !valid_policy, 0); "policy_update", cause, !valid_policy, 0);

View File

@ -10,6 +10,8 @@
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <linux/vmalloc.h> #include <linux/vmalloc.h>
#include <linux/kexec.h> #include <linux/kexec.h>

View File

@ -13,6 +13,8 @@
* Library of supported template fields. * Library of supported template fields.
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include "ima_template_lib.h" #include "ima_template_lib.h"
static bool ima_template_hash_algo_allowed(u8 algo) static bool ima_template_hash_algo_allowed(u8 algo)