proc: Restrict mounting the proc filesystem
authorEric W. Biederman <ebiederm@xmission.com>
Tue, 26 Mar 2013 02:57:10 +0000 (19:57 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Sep 2013 00:18:28 +0000 (17:18 -0700)
commit1ca91545961a92067cb8ad3ebc1558c8d1574456
tree5a36f10eb2f7f78e6b6c6ff7e8a5664dd264e614
parent8b89ae8a4914ee393c0db530735d933481272e97
proc: Restrict mounting the proc filesystem

commit aee1c13dd0f6c2fc56e0e492b349ee8ac655880f upstream.

Don't allow mounting the proc filesystem unless the caller has
CAP_SYS_ADMIN rights over the pid namespace.  The principle here is if
you create or have capabilities over it you can mount it, otherwise
you get to live with what other people have mounted.

Andy pointed out that this is needed to prevent users in a user
namespace from remounting proc and specifying different hidepid and gid
options on already existing proc mounts.

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/proc/root.c