From: Goldwyn Rodrigues <rgoldwyn@suse.de>
To: Amir Goldstein <amir73il@gmail.com>
Cc: overlayfs <linux-unionfs@vger.kernel.org>,
zohar@linux.ibm.com, iforster@suse.de,
linux-integrity@vger.kernel.org
Subject: Re: [PATCH] ovl: IMA Call ima_post_mknod_path() on copy_up'd dentry
Date: Thu, 17 Jan 2019 09:02:12 -0600 [thread overview]
Message-ID: <20190117150212.t4snb6jynran2dvn@merlin> (raw)
In-Reply-To: <CAOQ4uxgDi38dX0VLfHZ8R_fesN=0rBQB7Cw0ObRqy5fUqFepTQ@mail.gmail.com>
On 8:57 17/01, Amir Goldstein wrote:
> On Thu, Jan 17, 2019 at 1:22 AM Goldwyn Rodrigues <rgoldwyn@suse.de> wrote:
> >
> > Since copy_up() happens when you are modifying a file on overlay,
> > it is still a new file for the underlying filesystem. Mark it
> > in IMA for re-evaluating as a new file.
> >
> > Putting ima calls within overlayfs may not be the best method, but this is
> > the only one which I thought would work.
> >
>
> Doesn't look right.
> Overlayfs creates the new inode with vfs_tmpfile() and I think that is
> where you should plug the IMA hook.
>
> > Here is a test case:
> > mount /dev/vdb /lower
> > mount /dev/vdc /upper
> > echo "Original contents" > /lower/existingfile.txt
> > mount -t overlay overlay /mnt -o upperdir=/upper/upper,workdir=/upper/workdir,lowerdir=/lower
> > echo "New contents" > /mnt/existingfile.txt
> >
>
> I bet you can reproduce that same issue without overlayfs
> by creating an O_TMPFILE from userspace.
>
> The ima_file_check() hook in do_last() does not cover the O_TMPFILE
> case.
>
The problem you mention was resolved by https://lkml.org/lkml/2018/12/18/809
which I have in my tree.
The current patch is on top of that.
--
Goldwyn
next prev parent reply other threads:[~2019-01-17 15:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-16 17:39 [PATCH] ovl: IMA Call ima_post_mknod_path() on copy_up'd dentry Goldwyn Rodrigues
2019-01-17 6:57 ` Amir Goldstein
2019-01-17 15:02 ` Goldwyn Rodrigues [this message]
2019-01-17 15:44 ` Amir Goldstein
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=20190117150212.t4snb6jynran2dvn@merlin \
--to=rgoldwyn@suse.de \
--cc=amir73il@gmail.com \
--cc=iforster@suse.de \
--cc=linux-integrity@vger.kernel.org \
--cc=linux-unionfs@vger.kernel.org \
--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).