From: Christian Brauner <brauner@kernel.org>
To: Roberto Sassu <roberto.sassu@huaweicloud.com>
Cc: viro@zeniv.linux.org.uk, jack@suse.cz, zohar@linux.ibm.com,
dmitry.kasatkin@gmail.com, eric.snowberg@oracle.com,
paul@paul-moore.com, jmorris@namei.org, serge@hallyn.com,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-integrity@vger.kernel.org,
linux-security-module@vger.kernel.org,
Roberto Sassu <roberto.sassu@huawei.com>,
Shu Han <ebpqwerty472123@gmail.com>
Subject: Re: [PATCH v2 1/7] fs: ima: Remove S_IMA and IS_IMA()
Date: Thu, 28 Nov 2024 14:30:39 +0100 [thread overview]
Message-ID: <20241128-pokal-langweilen-8071fe2ad394@brauner> (raw)
In-Reply-To: <20241128100621.461743-2-roberto.sassu@huaweicloud.com>
On Thu, Nov 28, 2024 at 11:06:14AM +0100, Roberto Sassu wrote:
> From: Roberto Sassu <roberto.sassu@huawei.com>
>
> Commit 196f518128d2e ("IMA: explicit IMA i_flag to remove global lock on
> inode_delete") introduced the new S_IMA inode flag to determine whether or
> not an inode was processed by IMA. In that way, it was not necessary to
> take the global lock on inode delete.
>
> Since commit 4de2f084fbff ("ima: Make it independent from 'integrity'
> LSM"), the pointer of the inode integrity metadata managed by IMA has been
> moved to the inode security blob, from the rb-tree. The pointer is not NULL
> only if the inode has been processed by IMA, i.e. ima_inode_get() has been
> called for that inode.
>
> Thus, since the IS_IMA() check can be now implemented by trivially testing
> whether or not the pointer of inode integrity metadata is NULL, remove the
> S_IMA definition in include/linux/fs.h and also the IS_IMA() macro.
>
> Remove also the IS_IMA() invocation in ima_rdwr_violation_check(), since
> whether the inode was processed by IMA will be anyway detected by a
> subsequent call to ima_iint_find(). It does not have an additional overhead
> since the decision can be made in constant time, as opposed to logarithm
> when the inode integrity metadata was stored in the rb-tree.
>
> Suggested-by: Shu Han <ebpqwerty472123@gmail.com>
> Signed-off-by: Roberto Sassu <roberto.sassu@huawei.com>
> ---
> include/linux/fs.h | 3 +--
> security/integrity/ima/ima_iint.c | 5 -----
> security/integrity/ima/ima_main.c | 2 +-
> 3 files changed, 2 insertions(+), 8 deletions(-)
>
> diff --git a/include/linux/fs.h b/include/linux/fs.h
> index 3559446279c1..b33363becbdd 100644
> --- a/include/linux/fs.h
> +++ b/include/linux/fs.h
> @@ -2261,7 +2261,7 @@ struct super_operations {
> #define S_NOCMTIME (1 << 7) /* Do not update file c/mtime */
> #define S_SWAPFILE (1 << 8) /* Do not truncate: swapon got its bmaps */
> #define S_PRIVATE (1 << 9) /* Inode is fs-internal */
> -#define S_IMA (1 << 10) /* Inode has an associated IMA struct */
> +/* #define S_IMA (1 << 10) Inode has an associated IMA struct (unused) */
As Jan said, that line should be deleted. Otherwise,
Reviewed-by: Christian Brauner <brauner@kernel.org>
next prev parent reply other threads:[~2024-11-28 13:30 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-28 10:06 [PATCH v2 0/7] ima: Remove unnecessary inode locks Roberto Sassu
2024-11-28 10:06 ` [PATCH v2 1/7] fs: ima: Remove S_IMA and IS_IMA() Roberto Sassu
2024-11-28 11:40 ` Jan Kara
2024-11-28 13:30 ` Christian Brauner [this message]
2024-11-28 10:06 ` [PATCH v2 2/7] ima: Remove inode lock Roberto Sassu
2025-01-14 13:35 ` Mimi Zohar
2025-01-15 10:45 ` Roberto Sassu
2024-11-28 10:06 ` [PATCH v2 3/7] ima: Ensure lock is held when setting iint pointer in inode security blob Roberto Sassu
2025-01-14 14:20 ` Mimi Zohar
2025-01-15 10:51 ` Roberto Sassu
2024-11-28 10:06 ` [PATCH v2 4/7] ima: Mark concurrent accesses to the iint pointer in the " Roberto Sassu
2025-01-14 14:32 ` Mimi Zohar
2024-11-28 10:06 ` [PATCH v2 5/7] ima: Set security.ima on file close when ima_appraise=fix Roberto Sassu
2025-01-15 13:46 ` Mimi Zohar
2025-01-17 17:06 ` Roberto Sassu
2024-11-28 10:06 ` [PATCH v2 6/7] ima: Discard files opened with O_PATH Roberto Sassu
2024-11-28 16:22 ` Christian Brauner
2024-11-28 16:25 ` Roberto Sassu
2025-01-16 11:52 ` Mimi Zohar
2024-11-28 10:06 ` [PATCH v2 7/7] ima: Reset IMA_NONACTION_RULE_FLAGS after post_setattr Roberto Sassu
2025-01-16 13:12 ` Mimi Zohar
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=20241128-pokal-langweilen-8071fe2ad394@brauner \
--to=brauner@kernel.org \
--cc=dmitry.kasatkin@gmail.com \
--cc=ebpqwerty472123@gmail.com \
--cc=eric.snowberg@oracle.com \
--cc=jack@suse.cz \
--cc=jmorris@namei.org \
--cc=linux-fsdevel@vger.kernel.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=viro@zeniv.linux.org.uk \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox