Skip to content

Commit 2600136

Browse files
kstruczygregkh
authored andcommitted
ima: Remove redundant policy rule set in add_rules()
[ Upstream commit 6ee2844 ] Function ima_appraise_flag() returns the flag to be set in temp_ima_appraise depending on the hook identifier passed as an argument. It is not necessary to set the flag again for the POLICY_CHECK hook. Signed-off-by: Krzysztof Struczynski <krzysztof.struczynski@huawei.com> Signed-off-by: Mimi Zohar <zohar@linux.ibm.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 70ce853 commit 2600136

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

‎security/integrity/ima/ima_policy.c‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -590,11 +590,8 @@ static void add_rules(struct ima_rule_entry *entries, int count,
590590

591591
list_add_tail(&entry->list, &ima_policy_rules);
592592
}
593-
if (entries[i].action == APPRAISE) {
593+
if (entries[i].action == APPRAISE)
594594
temp_ima_appraise |= ima_appraise_flag(entries[i].func);
595-
if (entries[i].func == POLICY_CHECK)
596-
temp_ima_appraise |= IMA_APPRAISE_POLICY;
597-
}
598595
}
599596
}
600597

0 commit comments

Comments
 (0)