From: Andreas Gruenbacher <agruen@suse.de>
To: Christoph Hellwig <hch@infradead.org>,
Andreas Dilger <adilger@dilger.ca>
Cc: Eric Paris <eparis@redhat.com>,
Matt Helsley <matthltc@us.ibm.com>,
torvalds@linux-foundation.org, linux-kernel@vger.kernel.org,
viro@zeniv.linux.org.uk, akpm@linux-foundation.org,
Michael Kerrisk <michael.kerrisk@gmail.com>,
linux-fsdevel@vger.kernel.org
Subject: Re: [GIT PULL] notification tree: directory events
Date: Fri, 20 Aug 2010 17:29:07 +0200 [thread overview]
Message-ID: <201008201729.09535.agruen@suse.de> (raw)
In-Reply-To: <20100820092127.GC20138@infradead.org>
On Friday 20 August 2010 11:21:27 Christoph Hellwig wrote:
> On Thu, Aug 19, 2010 at 11:19:07PM -0600, Andreas Dilger wrote:
> > What about unifying the file identification here with the file handle
> > used for open_by_handle()? That keeps a consistent identifier for the
> > inode between multiple system calls (always a good thing), and allows
> > the inode to be opened again via open_by_handle() if needed.
>
> That's what the dmapi callouts that are intendeded to do just about the
> same as fanotify always did. I'm pretty sure I brought this up earlier
> in the discussion.
I remember you bringing this up.
The persistent handles require CAP_DAC_READ_SEARCH for using open_by_handle()
to prevent an unprivileged process from forging handles and bypassing
directory permission checks. This would be okay for users of fanotify which
can listen to all events in their namespace (and which requires CAP_SYS_ADMIN
anyway).
I don't see how open_by_handle() could be made safe to use by arbitrary
processes; I don't think we can make the handles cryptographically strong, for
example. But I may be overlooking something here.
[Side note: checking for CAP_DAC_READ_SEARCH in fanotify would probably be
enough when no perm events are involved because dentry_open() performs tail
permission checks anyway.]
In the future it will make sense to extend fanotify to allow unprivileged
processes to listen to "their own" events, for example, like inotify does
today. (You know that providing a better inotify replacement was one of the
goals of fanotify before it got merged anyway.) Unprivileged processes
wouldn't be allowed to use open_by_handle() anymore though, and so file
handles still look like a better choice for fanotify to me.
Thanks,
Andreas
next prev parent reply other threads:[~2010-08-20 15:29 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1281110319.17812.21.camel@dhcp231-200.rdu.redhat.com>
[not found] ` <201008191444.08966.agruen@suse.de>
[not found] ` <1282230012.21419.1566.camel@acb20005.ipt.aol.com>
2010-08-19 23:41 ` [GIT PULL] notification tree: directory events Andreas Gruenbacher
2010-08-20 3:38 ` Eric Paris
2010-08-20 5:19 ` Andreas Dilger
2010-08-20 9:21 ` Christoph Hellwig
2010-08-20 15:29 ` Andreas Gruenbacher [this message]
2010-08-20 20:39 ` Andreas Dilger
2010-08-20 9:09 ` Tvrtko Ursulin
2010-08-20 11:07 ` Andreas Gruenbacher
2010-08-20 11:25 ` Andreas Gruenbacher
2010-08-20 12:16 ` Andreas Gruenbacher
[not found] ` <1282016387.21419.113.camel@acb20005.ipt.aol.com>
[not found] ` <201008171009.51737.agruen@suse.de>
2010-08-20 0:00 ` [GIT PULL] notification tree - try 37! Andreas Gruenbacher
[not found] ` <201008192307.32526.agruen@suse.de>
[not found] ` <1282276236.21419.2101.camel@acb20005.ipt.aol.com>
2010-08-20 12:38 ` Andreas Gruenbacher
2010-08-23 16:46 ` Eric Paris
2010-08-23 22:38 ` Andreas Gruenbacher
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=201008201729.09535.agruen@suse.de \
--to=agruen@suse.de \
--cc=adilger@dilger.ca \
--cc=akpm@linux-foundation.org \
--cc=eparis@redhat.com \
--cc=hch@infradead.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=matthltc@us.ibm.com \
--cc=michael.kerrisk@gmail.com \
--cc=torvalds@linux-foundation.org \
--cc=viro@zeniv.linux.org.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;
as well as URLs for NNTP newsgroup(s).