linux-security-module.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Roberto Sassu <roberto.sassu@huaweicloud.com>
To: Shu Han <ebpqwerty472123@gmail.com>
Cc: zohar@linux.ibm.com, dmitry.kasatkin@gmail.com,
	eric.snowberg@oracle.com,  paul@paul-moore.com,
	jmorris@namei.org, serge@hallyn.com,
	 linux-integrity@vger.kernel.org,
	linux-security-module@vger.kernel.org,
	 linux-kernel@vger.kernel.org, bpf@vger.kernel.org,
	Roberto Sassu <roberto.sassu@huawei.com>
Subject: Re: [PATCH 1/3] ima: Remove inode lock
Date: Wed, 27 Nov 2024 16:57:27 +0100	[thread overview]
Message-ID: <9c8979adb9b575d2f938043f61e2be82c898632a.camel@huaweicloud.com> (raw)
In-Reply-To: <CAHQche-W2VxB+EJQRHUAWr4=850sX1ZfzzZUFJChUx8j6dW9Hw@mail.gmail.com>

On Wed, 2024-10-09 at 23:59 +0800, Shu Han wrote:
> > Finally, expand the critical region in process_measurement()
> > guarded by
> > iint->mutex up to where the inode was locked, use only one iint
> > lock in
> > __ima_inode_hash(), since the mutex is now in the inode security
> > blob, and
> > replace the inode_lock()/inode_unlock() calls in
> > ima_check_last_writer().
> 
> I am not familiar with this, so the following statement may be
> inaccurate:
> 
> I suspect that modifying the `i_flags` field through
> `inode->i_flags |= S_IMA;` in `ima_inode_get` may cause a
> race, as this patch removes the write lock for inodes in
> process_measurement().
> 
> For example, swapon() adds the S_SWAPFILE tag under inode write
> lock's
> protection.
> 
> Perhaps this initialization tag(`S_IMA`) can also be moved into
> inode's
> security blob.

It would not even be necessary, since after making IMA as a regular LSM
the S_IMA check can be replaced by testing whether or not the pointer
of inode integrity metadata in the security blob is NULL.

Will remove S_IMA.

Thanks

Roberto


      reply	other threads:[~2024-11-27 15:57 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-08 16:57 [PATCH 1/3] ima: Remove inode lock Roberto Sassu
2024-10-08 16:57 ` [PATCH 2/3] ima: Ensure lock is held when setting iint pointer in inode security blob Roberto Sassu
2024-10-09 15:41   ` Paul Moore
2024-10-09 15:43     ` Roberto Sassu
2024-10-11 19:30       ` Mimi Zohar
2024-10-14 11:45         ` Roberto Sassu
2024-10-16 13:08           ` Roberto Sassu
2024-10-08 16:57 ` [PATCH 3/3] ima: Mark concurrent accesses to the iint pointer in the " Roberto Sassu
2024-10-09 15:36 ` [PATCH 1/3] ima: Remove inode lock Paul Moore
2024-10-09 15:37   ` Paul Moore
2024-10-09 16:25     ` Roberto Sassu
2024-10-09 16:32       ` Roberto Sassu
2024-10-09 16:43       ` Roberto Sassu
2024-10-11 13:30         ` Roberto Sassu
2024-10-16  9:59           ` Roberto Sassu
2024-10-18  9:24             ` Roberto Sassu
2024-10-18 10:49               ` Kirill A. Shutemov
2024-10-18 10:52                 ` Kirill A. Shutemov
2024-10-18 10:55                   ` Kirill A. Shutemov
2024-10-18 11:00                 ` Lorenzo Stoakes
2024-10-18 11:05                   ` Kirill A. Shutemov
2024-10-18 11:22                     ` Roberto Sassu
2024-10-18 11:54                       ` Kirill A. Shutemov
2024-10-18 11:56                         ` Roberto Sassu
2024-10-18 13:29                     ` Roberto Sassu
2024-10-18 14:36                   ` Jann Horn
2024-10-18 14:48                     ` Lorenzo Stoakes
2024-10-09 16:24   ` Roberto Sassu
2024-10-09 15:59 ` Shu Han
2024-11-27 15:57   ` Roberto Sassu [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=9c8979adb9b575d2f938043f61e2be82c898632a.camel@huaweicloud.com \
    --to=roberto.sassu@huaweicloud.com \
    --cc=bpf@vger.kernel.org \
    --cc=dmitry.kasatkin@gmail.com \
    --cc=ebpqwerty472123@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=serge@hallyn.com \
    --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;
as well as URLs for NNTP newsgroup(s).