]> git.baikalelectronics.ru Git - kernel.git/commit
userns: Restrict when proc and sysfs can be mounted
authorEric W. Biederman <ebiederm@xmission.com>
Sun, 24 Mar 2013 21:28:27 +0000 (14:28 -0700)
committerEric W. Biederman <ebiederm@xmission.com>
Wed, 27 Mar 2013 14:50:08 +0000 (07:50 -0700)
commit096dcc25cc08e6254996446f6382b79581b0caf9
tree0bc879f9118c3333c73dfd15223a79e6219f64fd
parentd7d1681103fe5cdcb62642bd30f1418220231985
userns: Restrict when proc and sysfs can be mounted

Only allow unprivileged mounts of proc and sysfs if they are already
mounted when the user namespace is created.

proc and sysfs are interesting because they have content that is
per namespace, and so fresh mounts are needed when new namespaces
are created while at the same time proc and sysfs have content that
is shared between every instance.

Respect the policy of who may see the shared content of proc and sysfs
by only allowing new mounts if there was an existing mount at the time
the user namespace was created.

In practice there are only two interesting cases: proc and sysfs are
mounted at their usual places, proc and sysfs are not mounted at all
(some form of mount namespace jail).

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