[RFC v2 09/19] ima: Only accept AUDIT rules for IMA non-init_ima_ns namespaces for now
Stefan Berger
stefanb at linux.ibm.com
Fri Dec 3 02:31:08 UTC 2021
Only accept AUDIT rules for non-init_ima_ns namespaces rejecting all rules
that require support for measuring, appraisal, and hashing.
Signed-off-by: Stefan Berger <stefanb at linux.ibm.com>
---
security/integrity/ima/ima_policy.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/security/integrity/ima/ima_policy.c b/security/integrity/ima/ima_policy.c
index 96e7d63167e8..02e96da2faff 100644
--- a/security/integrity/ima/ima_policy.c
+++ b/security/integrity/ima/ima_policy.c
@@ -1785,6 +1785,16 @@ static int ima_parse_rule(struct ima_namespace *ns,
result = -EINVAL;
break;
}
+
+ /* IMA namespace only accepts AUDIT rules */
+ if (ns != &init_ima_ns) {
+ switch (entry->action) {
+ case MEASURE:
+ case APPRAISE:
+ case HASH:
+ result = -EINVAL;
+ }
+ }
}
if (!result && !ima_validate_rule(entry))
result = -EINVAL;
--
2.31.1
More information about the Linux-security-module-archive
mailing list