]> git.karo-electronics.de Git - karo-tx-linux.git/commit
autofs4: translate pids to the right namespace for the daemon
authorMiklos Szeredi <miklos@szeredi.hu>
Fri, 3 Jan 2014 03:10:20 +0000 (14:10 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 3 Jan 2014 03:10:20 +0000 (14:10 +1100)
commitd6862fd5345dc890444fd0917ac2228fa6037e87
treeeaf1a6c26fa2bbe1fc578fd401408a9233c825a1
parent28cb1f1a16326e8cd4bfbed3da8343325f624c93
autofs4: translate pids to the right namespace for the daemon

The PID and the TGID of the process triggering the mount are sent to the
daemon.  Currently the global pid values are sent (ones valid in the
initial pid namespace) but this is wrong if the autofs daemon itself is
not running in the initial pid namespace.

So send the pid values that are valid in the namespace of the autofs daemon.

The namespace to use is taken from the oz_pgrp pid pointer, which was set
at mount time to the mounting process' pid namespace.

If the pid translation fails (the triggering process is in an unrelated
pid namespace) then the automount fails with ENOENT.

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
Cc: Eric Biederman <ebiederm@xmission.com>
Acked-by: Ian Kent <raven@themaw.net>
Cc: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/autofs4/waitq.c