From: Mimi Zohar <zohar@linux.ibm.com>
To: Enrico Bravi <enrico.bravi@polito.it>,
"roberto.sassu@huawei.com" <roberto.sassu@huawei.com>,
"linux-integrity@vger.kernel.org"
<linux-integrity@vger.kernel.org>,
"dmitry.kasatkin@gmail.com" <dmitry.kasatkin@gmail.com>
Cc: "eric.snowberg@oracle.com" <eric.snowberg@oracle.com>
Subject: Re: [PATCH v5 2/2] ima: measure userspace policy writes before parsing
Date: Tue, 07 Jul 2026 16:06:48 -0400 [thread overview]
Message-ID: <80faa6f4928ab77604e1ce76ef625a5885e08c82.camel@linux.ibm.com> (raw)
In-Reply-To: <801419f4424e106dd2fe66d8291a2343708245ba.camel@polito.it>
On Tue, 2026-07-07 at 15:25 +0000, Enrico Bravi wrote:
> On Mon, 2026-07-06 at 23:03 -0400, Mimi Zohar wrote
> > ima_match_rule_data() should only be called for buffer measurements, when
> > there
> > is no inode.
> >
> > + return ((rule->func == func) && !inode &&
> > ima_match_rule_data(rule, func_data, cred));
>
> I was thinking that in this way, it would not trigger the measurement when
> loading the policy from a file. If inode is not NULL, it directly returns false
> instead of continuing. What do you thing of something like this:
>
> switch (func) {
> + case POLICY_CHECK:
> + if (inode)
> + break;
> + fallthrough;
> case KEY_CHECK:
> case CRITICAL_DATA:
> return ((rule->func == func) &&
> ima_match_rule_data(rule, func_data, cred));
Yes, your version is clearer.
Mimi
prev parent reply other threads:[~2026-07-07 20:07 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-02 19:04 [PATCH v5 0/2] ima: measure write on securityfs policy file Enrico Bravi
2026-07-02 19:04 ` [PATCH v5 1/2] ima: add critical data measurement for loaded policy Enrico Bravi
2026-07-07 3:04 ` Mimi Zohar
2026-07-07 11:25 ` Enrico Bravi
2026-07-07 23:53 ` Mimi Zohar
2026-07-02 19:04 ` [PATCH v5 2/2] ima: measure userspace policy writes before parsing Enrico Bravi
2026-07-07 3:03 ` Mimi Zohar
2026-07-07 15:25 ` Enrico Bravi
2026-07-07 20:06 ` Mimi Zohar [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=80faa6f4928ab77604e1ce76ef625a5885e08c82.camel@linux.ibm.com \
--to=zohar@linux.ibm.com \
--cc=dmitry.kasatkin@gmail.com \
--cc=enrico.bravi@polito.it \
--cc=eric.snowberg@oracle.com \
--cc=linux-integrity@vger.kernel.org \
--cc=roberto.sassu@huawei.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox