Commit 7e9001f6 authored by Richard Guy Briggs's avatar Richard Guy Briggs Committed by Mimi Zohar

audit: fix dangling keywords in integrity ima message output

Replace spaces in op keyword labels in log output since userspace audit tools
can't parse orphaned keywords.
Reported-by: default avatarSteve Grubb <sgrubb@redhat.com>
Signed-off-by: default avatarRichard Guy Briggs <rgb@redhat.com>
Signed-off-by: default avatarMimi Zohar <zohar@linux.vnet.ibm.com>
parent 209b43ca
...@@ -214,7 +214,7 @@ int ima_appraise_measurement(int func, struct integrity_iint_cache *iint, ...@@ -214,7 +214,7 @@ int ima_appraise_measurement(int func, struct integrity_iint_cache *iint,
hash_start = 1; hash_start = 1;
case IMA_XATTR_DIGEST: case IMA_XATTR_DIGEST:
if (iint->flags & IMA_DIGSIG_REQUIRED) { if (iint->flags & IMA_DIGSIG_REQUIRED) {
cause = "IMA signature required"; cause = "IMA-signature-required";
status = INTEGRITY_FAIL; status = INTEGRITY_FAIL;
break; break;
} }
......
...@@ -332,7 +332,7 @@ void __init ima_init_policy(void) ...@@ -332,7 +332,7 @@ void __init ima_init_policy(void)
void ima_update_policy(void) void ima_update_policy(void)
{ {
static const char op[] = "policy_update"; static const char op[] = "policy_update";
const char *cause = "already exists"; const char *cause = "already-exists";
int result = 1; int result = 1;
int audit_info = 0; int audit_info = 0;
...@@ -659,7 +659,7 @@ ssize_t ima_parse_add_rule(char *rule) ...@@ -659,7 +659,7 @@ ssize_t ima_parse_add_rule(char *rule)
/* Prevent installed policy from changing */ /* Prevent installed policy from changing */
if (ima_rules != &ima_default_rules) { if (ima_rules != &ima_default_rules) {
integrity_audit_msg(AUDIT_INTEGRITY_STATUS, NULL, integrity_audit_msg(AUDIT_INTEGRITY_STATUS, NULL,
NULL, op, "already exists", NULL, op, "already-exists",
-EACCES, audit_info); -EACCES, audit_info);
return -EACCES; return -EACCES;
} }
...@@ -685,7 +685,7 @@ ssize_t ima_parse_add_rule(char *rule) ...@@ -685,7 +685,7 @@ ssize_t ima_parse_add_rule(char *rule)
if (result) { if (result) {
kfree(entry); kfree(entry);
integrity_audit_msg(AUDIT_INTEGRITY_STATUS, NULL, integrity_audit_msg(AUDIT_INTEGRITY_STATUS, NULL,
NULL, op, "invalid policy", result, NULL, op, "invalid-policy", result,
audit_info); audit_info);
return result; return result;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment