From: "Jarkko Sakkinen" <jarkko@kernel.org>
To: "Mimi Zohar" <zohar@linux.ibm.com>, <linux-integrity@vger.kernel.org>
Cc: "Petr Vorel" <pvorel@suse.cz>
Subject: Re: [PATCH] ima: ignore suffixed policy rule comments
Date: Fri, 03 Jan 2025 15:24:21 +0200 [thread overview]
Message-ID: <D6SGZ0MLUC5J.3FQOUC5KVKLV3@kernel.org> (raw)
In-Reply-To: <20241230142333.1309623-1-zohar@linux.ibm.com>
On Mon Dec 30, 2024 at 4:23 PM EET, Mimi Zohar wrote:
> 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 */
skip?
Not that relevant but skipping those lines is the actual action taken
in order to reach the state of ignorance ;-)
> break;
> if ((*p == '\0') || (*p == ' ') || (*p == '\t'))
> continue;
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
BR, Jarkko
prev parent reply other threads:[~2025-01-03 13:24 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
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 message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=D6SGZ0MLUC5J.3FQOUC5KVKLV3@kernel.org \
--to=jarkko@kernel.org \
--cc=linux-integrity@vger.kernel.org \
--cc=pvorel@suse.cz \
--cc=zohar@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.