From: Ian Kent <raven@themaw.net>
To: "Serge E. Hallyn" <serue@us.ibm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
autofs@linux.kernel.org, linux-kernel@vger.kernel.org,
linux-fsdevel@vger.kernel.org, containers@lists.osdl.org
Subject: Re: [PATCH 2/4] autofs4 - track uid and gid of last mount requester
Date: Fri, 08 Aug 2008 12:44:02 +0800 [thread overview]
Message-ID: <1218170643.17093.88.camel@raven.themaw.net> (raw)
In-Reply-To: <1218167314.17093.79.camel@raven.themaw.net>
On Fri, 2008-08-08 at 11:48 +0800, Ian Kent wrote:
> > >
> > > Please remind me again why autofs's use of current->uid and
> > > current->gid is not busted in the presence of PID namespaces, where
> > > these things are no longer system-wide unique?
> >
> > I actually don't see what the autofs4_waitq->pid is used for. It's
> > copied from current into wq->pid at autofs4_wait, and into a packet to
> > send to userspace (I assume) at autofs4_notify_daemon.
> >
> > So as long as a daemon can serve multiple pid namespaces (which
> > doubtless it can), the pid could be confusing (or erroneous) for the
> > daemon.
>
> Your point is well taken.
>
> The pid is used purely for logging purposes to aid in debugging in user
> space. I'm not sure it is worth worrying about it too much as the daemon
> has no business interfering with user space processes it is not the
> owner of.
>
> >
> > If I'm remotely right about how the pid is being used, then the thing to
> > do would be to
> > 1. store the daemon's pid namespace (would that belong in
> > the autofs_sb_info?)
>
> Yep.
>
> > 2. store the task_pid(current) in the waitqueue
> > 3. retrieve the pid_t for the waiting task in the daemon's
> > pid namespace, and put that into the packet at
> > autofs4_notify_daemon.
> >
> > I realize this patch was about the *uids*, but the pids seem more
> > urgent.
>
> OK, I get it.
> I'll have a go at doing this for completeness.
On second thoughts I'm not sure about this.
The pid that is logged needs to relate to a process in the name space of
the one that caused the mount to be done.
For example, suppose a GUI user finds mounts never expiring, then we get
a debug log to try and identify the culprit. So the pid should
correspond to a process that the user sees (So I guess in the namespace
of that user).
This is the only reason I added the pid to the request packet in the
first place.
Please correct me if my understanding of this is not right.
Ian
>
> Ian
>
next prev parent reply other threads:[~2008-08-08 4:48 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-07 11:40 [PATCH 1/4] autofs4 - cleanup autofs mount type usage Ian Kent
2008-08-07 11:40 ` [PATCH 2/4] autofs4 - track uid and gid of last mount requester Ian Kent
2008-08-07 20:46 ` Andrew Morton
2008-08-07 22:12 ` Serge E. Hallyn
2008-08-08 3:48 ` Ian Kent
2008-08-08 4:44 ` Ian Kent [this message]
2008-08-08 14:58 ` Serge E. Hallyn
2008-08-09 6:05 ` Ian Kent
2008-08-09 13:31 ` Serge E. Hallyn
2008-08-25 18:05 ` Serge E. Hallyn
2008-08-07 22:15 ` Serge E. Hallyn
2008-08-08 3:13 ` Ian Kent
2008-08-08 15:23 ` Serge E. Hallyn
2008-08-08 3:25 ` Ian Kent
2008-08-08 5:37 ` Ian Kent
2008-08-07 11:40 ` [PATCH 3/4] autofs4 - devicer node ioctl docoumentation Ian Kent
2008-08-09 13:00 ` Christoph Hellwig
2008-08-07 11:40 ` [PATCH 4/4] autofs4 - add miscelaneous device for ioctls Ian Kent
2008-08-07 21:10 ` Andrew Morton
2008-08-08 3:39 ` Ian Kent
2008-08-08 5:31 ` Andrew Morton
2008-08-08 6:12 ` Ian Kent
2008-08-08 6:33 ` Andrew Morton
2008-08-09 12:59 ` Christoph Hellwig
2008-08-09 15:29 ` Ian Kent
2008-08-09 17:18 ` Christoph Hellwig
2008-08-10 5:20 ` Ian Kent
2008-08-09 12:47 ` [PATCH 1/4] autofs4 - cleanup autofs mount type usage Christoph Hellwig
2008-08-09 15:17 ` Ian Kent
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=1218170643.17093.88.camel@raven.themaw.net \
--to=raven@themaw.net \
--cc=akpm@linux-foundation.org \
--cc=autofs@linux.kernel.org \
--cc=containers@lists.osdl.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=serue@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®