linux-integrity.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mimi Zohar <zohar@linux.ibm.com>
To: Kavitha Sivagnanam <kavi@juniper.net>,
	"linux-integrity@vger.kernel.org"
	<linux-integrity@vger.kernel.org>
Subject: Re: Can we enforce "IMA Policy" based on file type
Date: Sun, 07 Jul 2019 16:59:59 -0400	[thread overview]
Message-ID: <1562533199.4106.9.camel@linux.ibm.com> (raw)
In-Reply-To: <41610A39-BB93-4D64-8821-B59DCE72EE8D@juniper.net>

On Tue, 2019-06-25 at 21:35 +0000, Kavitha Sivagnanam wrote:
> 
> On 4/25/19, 4:59 AM, "Mimi Zohar" <zohar@linux.ibm.com> wrote:
> 
> >    As Matthew indicated, you could define LSM labels on the squashfs file
> >   images.  Another option would be to extend IMA by implementing the LSM
> >    security_sb_mount hook.  The IMA policy rule would probably look
> >   something like:
> 
> We looked in to the security_sb_mount function. It receives the
> device name as string "const char *dev_name".  We need to do the IMA
> appraisal on the backing file (squashfs file) associated with this
> device.  However, based on this device name we were unable to get
> the backing_file associated with it in kernel space.
> Can you give some pointers? 
> 
> Also, we need to know if at the time when this function is called,
> if the backing file is associated with this device.
> 
> >    appraise func=MOUNT_CHECK fsname=squashfs appraise_type=imasig

When the squashfs file is loopback mounted, the backing file is set in
drivers/block/loop.c: loop_set_fd() and stored as lo->lo_backing_file.

Although security_sb_mount() is called after setting the backing file,
it seems to be too early.  You probably need to wait until after
fill_super().  Try using security_sb_kern_mount().

Mimi


      reply	other threads:[~2019-07-07 21:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-19 21:52 Can we enforce "IMA Policy" based on file type Kavitha Sivagnanam
2019-04-23 17:59 ` Matthew Garrett
2019-04-23 19:49   ` Kavitha Sivagnanam
2019-04-25 11:58 ` Mimi Zohar
2019-04-25 17:07   ` Kavitha Sivagnanam
2019-04-25 19:35     ` Nayna
2019-06-25 21:35   ` Kavitha Sivagnanam
2019-07-07 20: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=1562533199.4106.9.camel@linux.ibm.com \
    --to=zohar@linux.ibm.com \
    --cc=kavi@juniper.net \
    --cc=linux-integrity@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 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).