]> git.karo-electronics.de Git - karo-tx-linux.git/commit
vfs: Carefully propogate mounts across user namespaces
authorEric W. Biederman <ebiederm@xmission.com>
Fri, 22 Mar 2013 11:08:05 +0000 (04:08 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 5 Apr 2013 16:26:02 +0000 (09:26 -0700)
commit9c773201d61272db49f8f33a83a3cb2a3fe4b14f
tree9009a77acbfebc0b672e03a94b0b01c5162f8323
parent2f8d2ffe267ddb8d28dbed0ebb2d8dcf47c629fd
vfs: Carefully propogate mounts across user namespaces

commit 132c94e31b8bca8ea921f9f96a57d684fa4ae0a9 upstream.

As a matter of policy MNT_READONLY should not be changable if the
original mounter had more privileges than creator of the mount
namespace.

Add the flag CL_UNPRIVILEGED to note when we are copying a mount from
a mount namespace that requires more privileges to a mount namespace
that requires fewer privileges.

When the CL_UNPRIVILEGED flag is set cause clone_mnt to set MNT_NO_REMOUNT
if any of the mnt flags that should never be changed are set.

This protects both mount propagation and the initial creation of a less
privileged mount namespace.

Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
Reported-by: Andy Lutomirski <luto@amacapital.net>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/namespace.c
fs/pnode.c
fs/pnode.h