From: Andreas Gruenbacher <agruen-l3A5Bk7waGM@public.gmane.org>
To: Matthew Helsley <matt.helsley-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Eric Paris <eparis-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
Oleg Nesterov <oleg-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
hch-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org,
viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn@public.gmane.org,
linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Sukadev Bhattiprolu
<sukadev-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
Subject: Re: [PATCH 2/4] fanotify: Add pids to events
Date: Fri, 15 Jan 2010 16:12:09 +0100 [thread overview]
Message-ID: <201001151612.10032.agruen@suse.de> (raw)
In-Reply-To: <6a12d2f31001142041j7f917b07l1e1a728790175321-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
On Friday 15 January 2010 05:41:10 Matthew Helsley wrote:
> Eric, you never replied to my point about pid namespaces
> (http://lkml.org/lkml/2009/7/1/2). I'm still concerned that it's a
> problem for this patch. I've cc'd some pid namespace folks, listed the
> problems, and some alternative solutions (where I could think of any)
> below:
>
> 1. Since fanotify doesn't hold a reference to the struct pid then the
> pid can become stale before the event is acted upon.
> solution a: Just ignoring this problem, like other interfaces
> often do, is probably ok.
> ... ?
> solution z: Seems to require taking a reference to the pid and
> giving userspace a way to drop the reference after it's done using
> this value to refer to the process (yuck).
struct fsnotify_event->tgid does hold a reference to the appropriate struct
pid. The reference is released when that struct fsnotify_event is freed.
> 2. If the event recipient does a clone and enters a new pidns the pid
> number will be incorrect without any indication.
No, if a process has a pid within the listener's namespace the listener will
see this pid; otherwise, the resulting pid value is 0.
> 3. If the listening process is not in the same or an ancestor pid
> namespace of the triggering process then there is no correct pid
> corresponding to the event.
Indeed, if the listener is not in the same or an ancestor pid namespace, the
pid in the event will end up as 0. The event still indicates that something
has happened to a file the listener is interested in though, it's just unclear
who triggered the event. I don't see a problem with that though -- do you?
Thanks,
Andreas
next prev parent reply other threads:[~2010-01-15 15:12 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-02 14:14 [PATCH 1/4] fanotify: create_fd cleanup Eric Paris
2009-12-02 14:14 ` [PATCH 2/4] fanotify: Add pids to events Eric Paris
2010-01-15 4:41 ` Matthew Helsley
[not found] ` <6a12d2f31001142041j7f917b07l1e1a728790175321-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-01-15 15:12 ` Andreas Gruenbacher [this message]
2010-01-15 21:21 ` Matt Helsley
2010-01-16 22:53 ` Andreas Gruenbacher
2010-01-17 3:44 ` Matt Helsley
2009-12-02 14:15 ` [PATCH 3/4] fsnotify: split generic and inode specific mark code Eric Paris
2009-12-02 14:15 ` [PATCH 4/4] fsnotify: clear marks to 0 in fsnotify_init_mark Eric Paris
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=201001151612.10032.agruen@suse.de \
--to=agruen-l3a5bk7wagm@public.gmane.org \
--cc=containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
--cc=eparis-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=hch-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org \
--cc=linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=matt.helsley-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=oleg-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=sukadev-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org \
--cc=viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn@public.gmane.org \
/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).