Skip to content

Commit 6ee2844

Browse files
kstruczymimizohar
authored andcommitted
ima: Remove redundant policy rule set in add_rules()
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 <[email protected]> Signed-off-by: Mimi Zohar <[email protected]>
1 parent 1129d31 commit 6ee2844

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

security/integrity/ima/ima_policy.c

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

644644
list_add_tail(&entry->list, &ima_policy_rules);
645645
}
646-
if (entries[i].action == APPRAISE) {
646+
if (entries[i].action == APPRAISE)
647647
temp_ima_appraise |= ima_appraise_flag(entries[i].func);
648-
if (entries[i].func == POLICY_CHECK)
649-
temp_ima_appraise |= IMA_APPRAISE_POLICY;
650-
}
651648
}
652649
}
653650

0 commit comments

Comments
 (0)