From: Eric Paris <eparis@redhat.com>
To: Tvrtko Ursulin <tvrtko.ursulin@sophos.com>
Cc: Andreas Gruenbacher <agruen@suse.de>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>
Subject: Re: [BUG][PATCH][2.6.36-rc3] fanotify: Do not ignore result of permission decisions
Date: Fri, 08 Oct 2010 12:51:00 -0400 [thread overview]
Message-ID: <1286556660.2682.72.camel@localhost.localdomain> (raw)
In-Reply-To: <201010081711.24373.tvrtko.ursulin@sophos.com>
On Fri, 2010-10-08 at 17:11 +0100, Tvrtko Ursulin wrote:
> On Friday 08 Oct 2010 14:00:40 Andreas Gruenbacher wrote:
> > Tvrtko,
> >
> > On Wednesday 08 September 2010 10:24:04 Tvrtko Ursulin wrote:
> > > }
> > >
> > > +#ifdef CONFIG_FANOTIFY_ACCESS_PERMISSIONS
> > > + /* If a listener denied on a permission event we will
> > > remember the reason + and run the rest with a
> > > non-permission mask only. This allows other + listeners
> > > to receive non-permission notifications but we do not care +
> > > about further permission checks and want to deny this event. */ +
> > > if (unlikely((res == -EPERM) && (mask &
> > > FS_ALL_PERM_EVENTS))) {
> >
> > We should probably stop processing here whenever res != 0, for any mask.
> > (The fanotify and inotify handle_event callbacks can return -ENOMEM right
> > now, but this doesn't seem very useful and should probably be fixed:
> > fsnotify has no way of doing anything about -ENOMEM.
>
> I wasn't 100% sure of how fanotify works, or in other words can there be more
> events in this mask after perm events are removed. If it can then we should
> send them to other listeners. Eric?
>
> Also if ENOMEM, why not try sending to other listeners?
No, you'll never have a PERM_EVENT and something else at the same time.
If it's a PERM_EVENT denial we wouldn't really want to even notify
others, since the operation won't have actually taken place (perm event
denials should be passed all the way back up the stack)
As to ENOMEM that's a little harder I guess. We don't have to stop just
because inotify got ENOMEM, but we should stop if PERM_EVENTS got an
ENOMEM.
I'd really rather not put CONFIG_FANOTIFY_ACCESS_PERMISSIONS in this
file. fsnotify.c should be notifier agnostic.
How about just:
if (unlikely(ret && (mask & ALL_PERM)))
return ret
next prev parent reply other threads:[~2010-10-08 16:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-07 15:08 Tvrtko Ursulin
2010-09-08 8:24 ` Tvrtko Ursulin
2010-10-08 13:00 ` Andreas Gruenbacher
2010-10-08 16:11 ` Tvrtko Ursulin
2010-10-08 16:51 ` Eric Paris [this message]
2010-10-18 11:05 ` Tvrtko Ursulin
2010-10-08 21:05 ` 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=1286556660.2682.72.camel@localhost.localdomain \
--to=eparis@redhat.com \
--cc=agruen@suse.de \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tvrtko.ursulin@sophos.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
Powered by JetHome