linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Safford <safford@watson.ibm.com>
To: Mimi Zohar <zohar@linux.vnet.ibm.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	"J. Bruce Fields" <bfields@fieldses.org>,
	linux-kernel@vger.kernel.org,
	linux-security-module@vger.kernel.org,
	linux-fsdevel@vger.kernel.org, jmorris@namei.org,
	akpm@linux-foundation.org, eparis@redhat.com,
	viro@zeniv.linux.org.uk, Dave Chinner <david@fromorbit.com>
Subject: Re: [PATCH v1.2 0/5] IMA: making i_readcount a first class inode citizen (reposting)
Date: Mon, 22 Nov 2010 08:33:02 -0500	[thread overview]
Message-ID: <1290432782.2718.14.camel@localhost.localdomain> (raw)
In-Reply-To: <1290375229.2412.95.camel@localhost.localdomain>

On Sun, 2010-11-21 at 16:33 -0500, Mimi Zohar wrote:
> On Sun, 2010-11-21 at 09:56 -0800, Linus Torvalds wrote:
> > On Sun, Nov 21, 2010 at 5:18 AM, Mimi Zohar <zohar@linux.vnet.ibm.com> wrote:
> > >
> > > IMA (and the proposed EVM/IMA-appraisal patches) detects file change
> > > based on i_version. When the file is closed, if the file has changed,
> > > IMA marks the file as needing to be re-measured. Of course this requires
> > > the filesystem to be mounted with iversion. Don't know if this helps.
> > 
> > If you only do this at close time, I see a _major_ security hole.
> > 
> > The attacker can just write to the file, and keep it open. Ta-daa,
> > everybody who reads it sees the new contents, but your IMA logic is
> > oblivious and thinks it doesn't need to be re-measured.
> > 
> >                             Linus
> 
> Not exactly.  While the file remains open for write, it doesn't make any
> sense to re-measure the file, as there is nothing preventing the file
> from continuing to change.  Any measurement would thus be meaningless.
> Only after the file closes, does it make sense to re-measure.  I did not
> mean to imply there isn't any indication of the problem in the
> measurement list, there obviously is.
> 
> Mimi
> 
To elaborate a bit on Mimi's response - in the case of a malicious
program keeping a file open for write to avoid measurement:
1. as she points out, the reason for i_writecount and i_readcount
   is to detect this "open_writer" problem and log it in both the 
   measurement list and in the audit log.
2. the attacker program itself must have been measured before it
   was executed. 

dave

  reply	other threads:[~2010-11-22 13:33 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-18 23:02 [PATCH v1.2 0/5] IMA: making i_readcount a first class inode citizen (reposting) Mimi Zohar
2010-11-18 23:02 ` [PATCH v1.2 1/5] IMA: convert i_readcount to atomic Mimi Zohar
2010-11-18 23:02 ` [PATCH v1.2 2/5] IMA: define readcount functions Mimi Zohar
2010-11-18 23:03 ` [PATCH v1.2 3/5] IMA: maintain i_readcount in the VFS layer Mimi Zohar
2010-11-18 23:03 ` [PATCH v1.2 4/5] IMA: remove IMA imbalance checking Mimi Zohar
2010-11-18 23:03 ` [PATCH v1.2 5/5] IMA: making i_readcount a first class inode citizen Mimi Zohar
2010-11-18 23:31 ` [PATCH v1.2 0/5] IMA: making i_readcount a first class inode citizen (reposting) Linus Torvalds
2010-11-19 17:50   ` J. Bruce Fields
2010-11-19 17:56     ` J. Bruce Fields
2010-11-21 13:18     ` Mimi Zohar
2010-11-21 17:56       ` Linus Torvalds
2010-11-21 21:33         ` Mimi Zohar
2010-11-22 13:33           ` David Safford [this message]
2010-11-21 21:37       ` J. Bruce Fields

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=1290432782.2718.14.camel@localhost.localdomain \
    --to=safford@watson.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=bfields@fieldses.org \
    --cc=david@fromorbit.com \
    --cc=eparis@redhat.com \
    --cc=jmorris@namei.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=zohar@linux.vnet.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).