public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Timothy R. Chavez" <tinytim@us.ibm.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: linux-kernel@vger.kernel.org, Serge Hallyn <serue@us.ibm.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Steve Grubb <sgrubb@redhat.com>,
	Stephen Smalley <sds@tycho.nsa.gov>,
	Chris Wright <chrisw@osdl.org>,
	Alexander Viro <viro@parcelfarce.linux.theplanet.co.uk>,
	Mounir Bsaibes <bsaibes@us.ibm.com>
Subject: Re: [RFC][PATCH] filesystem auditing by location+name
Date: Sat, 11 Jun 2005 11:55:11 -0500	[thread overview]
Message-ID: <200506111155.12439.tinytim@us.ibm.com> (raw)
In-Reply-To: <20050610223806.GA16506@infradead.org>

On Friday 10 June 2005 17:38, Christoph Hellwig wrote:
> most of this looks like a copy & paste of the inotify code.  Could you
> please arrange with the inotify folks to merge the patches?
> 

Christoph,

Thank you for the response.

When we first started this project we had assessed whether or not inotify 
would be a feasible starting point, but ultimately rejected it.  What it came 
down to was that the objectives of inotify were distinctly different from the 
objectives of auditfs.  These distinctions were rooted in the very design of 
inotify.  Why?  Inotify is not a generic fs events notification subsystem.

Some of the cursory problems with using inotify which would need changing 
were:

1) Coverage

Inotify is only interested in a portion of the fs ops that we are interested 
in.  Most notably, we need the ability to generate records every time the 
[exec_]permission[_lite]() function is called.

2) Processing

The processing of events has to occur in the kernel, not in user space.  
Inotify collects events and tosses them back over the fence for processing.  
We cannot introduce any window of opportunity for audit subversion.

You see, auditfs is interested in the inode at location+name, whatever it may 
be when the auditable event occurs.  Thus, we've had to hook dcache to help 
us with this processing.  This is something Inotify does not care about nor 
should it.

Inotify will resolve a path to its inode and watch _that_ inode, we're saying 
"watch any inode at this path"

To build auditfs on top of inotify would require watching directories for 
events on its children and processing the events in the kernel (and not 
simply tossing them over the fence to user space).  This gets very... 
hackish ;)

3) Queue

Depending on the work, there may be a requirement that no audit record can be 
lost.  The message queue structure of inotify has the potential to overflow 
and drop events.  This is a no-go for us, but perfectly reasonable for 
inotify.

To make this work for us we'd have to hook the queueing functions to forward 
events on to the audit subsystem.  This would basically mean fitting a system 
that has been designed for interaction with userspace to also have 
interaction with other parts of the kernel... again, hackish.

4) Context

We require information regarding the process and system call associated with 
the fs event.  This is not necessarily evident from where the event occurred 
(ie: permission()).  Inotify would have to hook into the audit subsystem to 
get at this information. 


The only place that the two projects converge is in fs/namei.c where they both 
collect information about events.  One project notifies the audit subsystem 
and the other notifies user space.  I think it is here where a collaboration 
could take place without skewing the objectives of either project.

-tim

  reply	other threads:[~2005-06-11 16:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-10 22:28 [RFC][PATCH] filesystem auditing by location+name Timothy R. Chavez
2005-06-10 22:38 ` Christoph Hellwig
2005-06-11 16:55   ` Timothy R. Chavez [this message]
2005-06-11 17:00     ` Christoph Hellwig
2005-06-11 17:40       ` Timothy R. Chavez
2005-06-10 23:28 ` Chris Wright
2005-06-13 20:45   ` Timothy R. Chavez

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=200506111155.12439.tinytim@us.ibm.com \
    --to=tinytim@us.ibm.com \
    --cc=bsaibes@us.ibm.com \
    --cc=chrisw@osdl.org \
    --cc=dwmw2@infradead.org \
    --cc=hch@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sds@tycho.nsa.gov \
    --cc=serue@us.ibm.com \
    --cc=sgrubb@redhat.com \
    --cc=viro@parcelfarce.linux.theplanet.co.uk \
    /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