From: Mimi Zohar <zohar@linux.ibm.com>
To: Roberto Sassu <roberto.sassu@huaweicloud.com>,
dmitry.kasatkin@gmail.com, eric.snowberg@oracle.com,
paul@paul-moore.com, jmorris@namei.org, serge@hallyn.com
Cc: linux-integrity@vger.kernel.org,
linux-security-module@vger.kernel.org,
linux-kernel@vger.kernel.org,
Roberto Sassu <roberto.sassu@huawei.com>,
stable@vger.kernel.org
Subject: Re: [PATCH] ima: Reset IMA_NONACTION_RULE_FLAGS after post_setattr
Date: Tue, 04 Feb 2025 21:59:31 -0500 [thread overview]
Message-ID: <bbfce282a00854c220eddb1ffcde7c6d839efe5e.camel@linux.ibm.com> (raw)
In-Reply-To: <20250204125720.1326257-1-roberto.sassu@huaweicloud.com>
On Tue, 2025-02-04 at 13:57 +0100, Roberto Sassu wrote:
> From: Roberto Sassu <roberto.sassu@huawei.com>
>
> Commit 0d73a55208e9 ("ima: re-introduce own integrity cache lock")
> mistakenly reverted the performance improvement introduced in commit
> 42a4c603198f0 ("ima: fix ima_inode_post_setattr"). The unused bit mask was
> subsequently removed by commit 11c60f23ed13 ("integrity: Remove unused
> macro IMA_ACTION_RULE_FLAGS").
>
> Restore the performance improvement by introducing the new mask
> IMA_NONACTION_RULE_FLAGS, equal to IMA_NONACTION_FLAGS without
> IMA_NEW_FILE, which is not a rule-specific flag.
>
> Finally, reset IMA_NONACTION_RULE_FLAGS instead of IMA_NONACTION_FLAGS in
> process_measurement(), if the IMA_CHANGE_ATTR atomic flag is set (after
> file metadata modification).
>
> With this patch, new files for which metadata were modified while they are
> still open, can be reopened before the last file close (when security.ima
> is written), since the IMA_NEW_FILE flag is not cleared anymore. Otherwise,
> appraisal fails because security.ima is missing (files with IMA_NEW_FILE
> set are an exception).
>
> Cc: stable@vger.kernel.org # v4.16.x
> Fixes: 0d73a55208e9 ("ima: re-introduce own integrity cache lock")
> Signed-off-by: Roberto Sassu <roberto.sassu@huawei.com>
Thanks!
Mimi
prev parent reply other threads:[~2025-02-05 2:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-04 12:57 [PATCH] ima: Reset IMA_NONACTION_RULE_FLAGS after post_setattr Roberto Sassu
2025-02-05 2:59 ` 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=bbfce282a00854c220eddb1ffcde7c6d839efe5e.camel@linux.ibm.com \
--to=zohar@linux.ibm.com \
--cc=dmitry.kasatkin@gmail.com \
--cc=eric.snowberg@oracle.com \
--cc=jmorris@namei.org \
--cc=linux-integrity@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=paul@paul-moore.com \
--cc=roberto.sassu@huawei.com \
--cc=roberto.sassu@huaweicloud.com \
--cc=serge@hallyn.com \
--cc=stable@vger.kernel.org \
/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.