]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit - fs/namespace.c
mnt: Refactor the logic for mounting sysfs and proc in a user namespace
authorEric W. Biederman <ebiederm@xmission.com>
Sat, 9 May 2015 04:22:29 +0000 (23:22 -0500)
committerEric W. Biederman <ebiederm@xmission.com>
Thu, 14 May 2015 02:44:11 +0000 (21:44 -0500)
commit1b852bceb0d111e510d1a15826ecc4a19358d512
treeb7a6b015d68f3ad25f79d7197690a29e08f0e21c
parent7e96c1b0e0f495c5a7450dc4aa7c9a24ba4305bd
mnt: Refactor the logic for mounting sysfs and proc in a user namespace

Fresh mounts of proc and sysfs are a very special case that works very
much like a bind mount.  Unfortunately the current structure can not
preserve the MNT_LOCK... mount flags.  Therefore refactor the logic
into a form that can be modified to preserve those lock bits.

Add a new filesystem flag FS_USERNS_VISIBLE that requires some mount
of the filesystem be fully visible in the current mount namespace,
before the filesystem may be mounted.

Move the logic for calling fs_fully_visible from proc and sysfs into
fs/namespace.c where it has greater access to mount namespace state.

Cc: stable@vger.kernel.org
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
fs/namespace.c
fs/proc/root.c
fs/sysfs/mount.c
include/linux/fs.h