[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1383832849-17125-2-git-send-email-roberto.sassu@polito.it>
Date: Thu, 7 Nov 2013 15:00:42 +0100
From: Roberto Sassu <roberto.sassu@...ito.it>
To: linux-security-module@...r.kernel.org
Cc: linux-kernel@...r.kernel.org,
linux-ima-devel@...ts.sourceforge.net, zohar@...ibm.com,
d.kasatkin@...sung.com, james.l.morris@...cle.com,
Roberto Sassu <roberto.sassu@...ito.it>
Subject: [RFC][PATCH 1/4] ima: added error messages to template-related functions
This patch adds some error messages to inform users about the following
events: template descriptor not found, template field not found, and
template initialization failed.
Signed-off-by: Roberto Sassu <roberto.sassu@...ito.it>
---
security/integrity/ima/ima_template.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/security/integrity/ima/ima_template.c b/security/integrity/ima/ima_template.c
index 4e5da99..7bcff5c 100644
--- a/security/integrity/ima/ima_template.c
+++ b/security/integrity/ima/ima_template.c
@@ -49,8 +49,11 @@ static int __init ima_template_setup(char *str)
* If not, use CONFIG_IMA_DEFAULT_TEMPLATE.
*/
template_desc = lookup_template_desc(str);
- if (!template_desc)
+ if (!template_desc) {
+ pr_err("IMA: template %s not found, using %s\n",
+ str, CONFIG_IMA_DEFAULT_TEMPLATE);
return 1;
+ }
/*
* Verify whether the current hash algorithm is supported
@@ -127,6 +130,7 @@ static int template_desc_init_fields(char *template_fmt,
struct ima_template_field *f = lookup_template_field(c);
if (!f) {
+ pr_err("IMA: field '%s' not found\n", c);
result = -ENOENT;
goto out;
}
@@ -152,8 +156,12 @@ static int init_defined_templates(void)
result = template_desc_init_fields(template->fmt,
&(template->fields),
&(template->num_fields));
- if (result < 0)
+ if (result < 0) {
+ pr_err("IMA: template %s init failed, result: %d\n",
+ (strlen(template->name) ?
+ template->name : template->fmt), result);
return result;
+ }
}
return result;
}
--
1.8.1.4
Download attachment "smime.p7s" of type "application/x-pkcs7-signature" (2061 bytes)
Powered by blists - more mailing lists