From: Mimi Zohar <zohar@linux.vnet.ibm.com>
To: Al Viro <viro@ZenIV.linux.org.uk>
Cc: linux-kernel@vger.kernel.org, Eric Paris <eparis@redhat.com>,
Hugh Dickins <hugh.dickins@tiscali.co.uk>,
James Morris <jmorris@namei.org>,
David Safford <safford@watson.ibm.com>,
"Serge E. Hallyn" <serue@linux.vnet.ibm.com>,
Mimi Zohar <zohar@us.ibm.com>
Subject: Re: [RFC PATCH 1/2] Fix 1 untangling ima mess, part 2 with counters
Date: Mon, 25 Jan 2010 14:24:37 -0500 [thread overview]
Message-ID: <1264447477.3696.30.camel@dyn9002018117.watson.ibm.com> (raw)
In-Reply-To: <20100123230735.GW19799@ZenIV.linux.org.uk>
On Sat, 2010-01-23 at 23:07 +0000, Al Viro wrote:
> On Wed, Jan 20, 2010 at 03:35:40PM -0500, Mimi Zohar wrote:
> > The "Untangling ima mess, part 2 with counters" patch messed
> > up the counters. Based on conversations with Al Viro, this patch
> > streamlines ima_path_check() by removing the counter maintaince.
> > The counters are now updated independently, from measuring the file,
> > in __dentry_open() and alloc_file() by calling ima_counts_get().
> > ima_path_check() is called from nfsd and do_filp_open().
> >
> > Signed-off-by: Mimi Zohar <zohar@us.ibm.com>
> > ---
> > fs/namei.c | 4 +-
> > include/linux/ima.h | 4 +-
> > security/integrity/ima/ima_main.c | 234 ++++++++++++++-----------------------
>
> Um...
> a) where's the nfsd part?
> b) will that work if we open file with O_WRONLY?
Files opened O_WRONLY are not measured.
> nfsd side of things is non-trivial. Note that you have that thing called
> an awful lot; nfsd_permission() is called by fh_verify(). For which
> operations do you really want it to happen? Should it just migrate to
> nfsd_open()?
The IMA counters are updated in alloc_file() and __dentry_open().
__dentry_open() is called from a couple of places:
lookup_instantiate_filp(), nameidata_to_filp() and dentry_open. Of
these calls, files are only being measured in the nameidata_to_filp()
path. So yes, the current ima_path_check() needs to be moved to after
the dentry_open() in nfsd_open(), and also added after each of the other
dentry_open() and lookup_instantiate_filp() calls. Otherwise the
counters will be correct, but the files will not be measured.
Eric's proposed patches had two calls to ima_path_check(). Was sure
looking forward to not having to add ima_path_check() calls all over.
Mimi
next prev parent reply other threads:[~2010-01-25 19:24 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-20 20:35 [RFC PATCH 0/2] Fix " Mimi Zohar
2010-01-20 20:35 ` [RFC PATCH 1/2] Fix 1 " Mimi Zohar
2010-01-23 23:07 ` Al Viro
2010-01-25 19:24 ` Mimi Zohar [this message]
2010-01-25 21:30 ` Al Viro
2010-01-26 13:03 ` Al Viro
2010-01-26 15:16 ` Mimi Zohar
2010-01-26 16:27 ` Al Viro
[not found] ` <1264520125.3789.32.camel@dyn9002018117.watson.ibm.com>
[not found] ` <20100126163143.GJ19799@ZenIV.linux.org.uk>
[not found] ` <1264528747.3062.11.camel@dyn9002018117.watson.ibm.com>
2010-01-26 19:41 ` Open Intents, lookup_instantiate_filp() And All That Shit(tm) Al Viro
2010-01-26 22:01 ` [RFC PATCH 1/2] Fix 1 untangling ima mess, part 2 with counters Mimi Zohar
2010-01-20 20:35 ` [RFC PATCH 2/2] Fix 2 " 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=1264447477.3696.30.camel@dyn9002018117.watson.ibm.com \
--to=zohar@linux.vnet.ibm.com \
--cc=eparis@redhat.com \
--cc=hugh.dickins@tiscali.co.uk \
--cc=jmorris@namei.org \
--cc=linux-kernel@vger.kernel.org \
--cc=safford@watson.ibm.com \
--cc=serue@linux.vnet.ibm.com \
--cc=viro@ZenIV.linux.org.uk \
--cc=zohar@us.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
all inboxes | Powered by JetHome®