Skip to content

Commit 4785ed3

Browse files
committed
ima: ignore suffixed policy rule comments
Lines beginning with '#' in the IMA policy are comments and are ignored. Instead of placing the rule and comment on separate lines, allow the comment to be suffixed to the IMA policy rule. Reviewed-by: Petr Vorel <[email protected]> Reviewed-by: Jarkko Sakkinen <[email protected]> Signed-off-by: Mimi Zohar <[email protected]>
1 parent 7eef7c8 commit 4785ed3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

security/integrity/ima/ima_policy.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1432,7 +1432,7 @@ static int ima_parse_rule(char *rule, struct ima_rule_entry *entry)
14321432
int token;
14331433
unsigned long lnum;
14341434

1435-
if (result < 0)
1435+
if (result < 0 || *p == '#') /* ignore suffixed comment */
14361436
break;
14371437
if ((*p == '\0') || (*p == ' ') || (*p == '\t'))
14381438
continue;

0 commit comments

Comments
 (0)