public inbox for linux-integrity@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ima: ignore suffixed policy rule comments
@ 2024-12-30 14:23 Mimi Zohar
  2024-12-30 14:23 ` [PATCH] ima: limit the builtin 'tcb' dont_measure tmpfs policy rule Mimi Zohar
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Mimi Zohar @ 2024-12-30 14:23 UTC (permalink / raw)
  To: linux-integrity; +Cc: Mimi Zohar, Petr Vorel

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.

Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
---
 security/integrity/ima/ima_policy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/security/integrity/ima/ima_policy.c b/security/integrity/ima/ima_policy.c
index 23bbe2c405f0..128fab897930 100644
--- a/security/integrity/ima/ima_policy.c
+++ b/security/integrity/ima/ima_policy.c
@@ -1432,7 +1432,7 @@ static int ima_parse_rule(char *rule, struct ima_rule_entry *entry)
 		int token;
 		unsigned long lnum;
 
-		if (result < 0)
+		if (result < 0 || *p == '#')  /* ignore suffixed comment */
 			break;
 		if ((*p == '\0') || (*p == ' ') || (*p == '\t'))
 			continue;
-- 
2.47.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-01-15 10:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-30 14:23 [PATCH] ima: ignore suffixed policy rule comments Mimi Zohar
2024-12-30 14:23 ` [PATCH] ima: limit the builtin 'tcb' dont_measure tmpfs policy rule Mimi Zohar
2024-12-31  9:33   ` Petr Vorel
2025-01-15 10:09   ` Roberto Sassu
2024-12-31  7:28 ` [PATCH] ima: ignore suffixed policy rule comments Petr Vorel
2025-01-03 13:24 ` Jarkko Sakkinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox