Commit 407eb63f authored by Petr Vorel's avatar Petr Vorel Committed by Greg Kroah-Hartman

ima: fix wrong signed policy requirement when not appraising

commit f4001947 upstream.

Kernel booted just with ima_policy=tcb (not with
ima_policy=appraise_tcb) shouldn't require signed policy.

Regression found with LTP test ima_policy.sh.

Fixes: c52657d9 ("ima: refactor ima_init_policy()")
Cc: stable@vger.kernel.org  (linux-5.0)
Signed-off-by: default avatarPetr Vorel <pvorel@suse.cz>
Signed-off-by: default avatarMimi Zohar <zohar@linux.ibm.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c59e2a64
...@@ -498,11 +498,12 @@ static void add_rules(struct ima_rule_entry *entries, int count, ...@@ -498,11 +498,12 @@ static void add_rules(struct ima_rule_entry *entries, int count,
list_add_tail(&entry->list, &ima_policy_rules); list_add_tail(&entry->list, &ima_policy_rules);
} }
if (entries[i].action == APPRAISE) if (entries[i].action == APPRAISE) {
temp_ima_appraise |= ima_appraise_flag(entries[i].func); temp_ima_appraise |= ima_appraise_flag(entries[i].func);
if (entries[i].func == POLICY_CHECK) if (entries[i].func == POLICY_CHECK)
temp_ima_appraise |= IMA_APPRAISE_POLICY; temp_ima_appraise |= IMA_APPRAISE_POLICY;
} }
}
} }
static int ima_parse_rule(char *rule, struct ima_rule_entry *entry); static int ima_parse_rule(char *rule, struct ima_rule_entry *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