]> 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>
Tue, 5 Nov 2013 05:57:07 +0000 (16:57 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 5 Nov 2013 05:57:07 +0000 (16:57 +1100)
commit40cd4d822bbbd8a7377a2fcf470507b644064713
tree2e4fa2ce049e80c8becac09d0ae7fd955f07dcc0
parent3ca33de5ad1362e39757ad2425046ef97b0e303e
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>
Cc: Ian Kent <raven@themaw.net>
Cc: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/autofs4/waitq.c