public inbox for linux-unionfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Mimi Zohar <zohar@linux.ibm.com>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: Stefan Berger <stefanb@linux.ibm.com>,
	Amir Goldstein <amir73il@gmail.com>,
	linux-integrity@vger.kernel.org, linux-unionfs@vger.kernel.org,
	linux-kernel@vger.kernel.org, roberto.sassu@huawei.com,
	Christian Brauner <brauner@kernel.org>
Subject: Re: [RFC 2/2] ima: Fix detection of read/write violations on stacked filesystems
Date: Tue, 16 Apr 2024 15:05:49 -0400	[thread overview]
Message-ID: <254ee35d6534089e99f7396582572606f24ff3a2.camel@linux.ibm.com> (raw)
In-Reply-To: <CAJfpeguzh6VzhdnwOPf_hM4x0FbsK8hhZp=VK4kWpCYn0xeBCg@mail.gmail.com>

On Tue, 2024-04-16 at 16:46 +0200, Miklos Szeredi wrote:
> On Tue, 16 Apr 2024 at 14:18, Mimi Zohar <zohar@linux.ibm.com> wrote:
> > Originally there was a single measureent unless the filesystem was mounted with
> > SB_I_VERSION.  With commit a2a2c3c8580a ("ima: Use i_version only when
> > filesystem supports it") this changed to always re-measure the file if the
> > filesystem wasn't mounted with SB_I_VERSION.
> 
> Does the i_version get stored and compared only while the inode is in memory?
> 
> In that case I think it should be possible to support a version number
> for the overlay inode.

i_version was insufficient to detect a file change for overlay.  Commit
b836c4d29f27 ("ima: detect changes to the backing overlay") also compares the
i_ino and s_dev as well.  Refer to 
https://lore.kernel.org/lkml/20231025143906.133218-1-zohar@linux.ibm.com/.

Here in this patch set we need to detect IMA read/write violations, based on the
i_readcount/i_writecount.  If an overlay file is opened for read, but the
backing file is already opened for write, the file measurement is
meaningless.  An "open-writers" violation needs to be generated; and the IMA
measurement list needs to be invalidated.

thanks,

Mimi


  reply	other threads:[~2024-04-16 19:06 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-12 14:01 [RFC 0/2] ima: Fix detection of read/write violations on stacked filesystems Stefan Berger
2024-04-12 14:01 ` [RFC 1/2] ovl: Define D_REAL_FILEDATA for d_real to return dentry with data Stefan Berger
2024-04-12 18:05   ` Amir Goldstein
2024-04-12 14:01 ` [RFC 2/2] ima: Fix detection of read/write violations on stacked filesystems Stefan Berger
2024-04-12 18:08   ` Amir Goldstein
2024-04-12 19:08     ` Stefan Berger
2024-04-15  8:09       ` Miklos Szeredi
2024-04-15 10:47         ` Mimi Zohar
2024-04-15 12:57           ` Miklos Szeredi
2024-04-15 18:34             ` Mimi Zohar
2024-04-16  8:05               ` Miklos Szeredi
2024-04-16 12:18                 ` Mimi Zohar
2024-04-16 14:46                   ` Miklos Szeredi
2024-04-16 19:05                     ` Mimi Zohar [this message]
2024-04-23 11:06                       ` Miklos Szeredi
2024-05-01 21:13                         ` 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=254ee35d6534089e99f7396582572606f24ff3a2.camel@linux.ibm.com \
    --to=zohar@linux.ibm.com \
    --cc=amir73il@gmail.com \
    --cc=brauner@kernel.org \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-unionfs@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=roberto.sassu@huawei.com \
    --cc=stefanb@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