Commit 592b24cb authored by Tyler Hicks's avatar Tyler Hicks Committed by Mimi Zohar

ima: Use the common function to detect LSM conditionals in a rule

Make broader use of ima_rule_contains_lsm_cond() to check if a given
rule contains an LSM conditional. This is a code cleanup and has no
user-facing change.
Signed-off-by: default avatarTyler Hicks <tyhicks@linux.microsoft.com>
Reviewed-by: default avatarMimi Zohar <zohar@linux.ibm.com>
Signed-off-by: default avatarMimi Zohar <zohar@linux.ibm.com>
parent 30031b0e
...@@ -360,17 +360,10 @@ static bool ima_rule_contains_lsm_cond(struct ima_rule_entry *entry) ...@@ -360,17 +360,10 @@ static bool ima_rule_contains_lsm_cond(struct ima_rule_entry *entry)
static void ima_lsm_update_rules(void) static void ima_lsm_update_rules(void)
{ {
struct ima_rule_entry *entry, *e; struct ima_rule_entry *entry, *e;
int i, result, needs_update; int result;
list_for_each_entry_safe(entry, e, &ima_policy_rules, list) { list_for_each_entry_safe(entry, e, &ima_policy_rules, list) {
needs_update = 0; if (!ima_rule_contains_lsm_cond(entry))
for (i = 0; i < MAX_LSM_RULES; i++) {
if (entry->lsm[i].args_p) {
needs_update = 1;
break;
}
}
if (!needs_update)
continue; continue;
result = ima_lsm_update_rule(entry); result = ima_lsm_update_rule(entry);
......
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