summaryrefslogtreecommitdiff
path: root/fs/proc/generic.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2016-08-11 00:36:01 +0300
committerDavid S. Miller <davem@davemloft.net>2016-08-15 07:07:20 +0300
commitc110486f6cb240f36ec143cad6628d52c071f529 (patch)
treec7b7e3033c55e91744c9271ffd37917ee78f6085 /fs/proc/generic.c
parentf8c46cb39079b7415ada1affc4631ae761d8b621 (diff)
downloadlinux-c110486f6cb240f36ec143cad6628d52c071f529.tar.xz
proc: make proc entries inherit ownership from parent
There are certain parameters that belong to net namespace and that are exported in /proc. They should be controllable by the container's owner, but are currently owned by global root and thus not available. Let's change proc code to inherit ownership of parent entry, and when create per-ns "net" proc entry set it up as owned by container's owner. Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'fs/proc/generic.c')
-rw-r--r--fs/proc/generic.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/proc/generic.c b/fs/proc/generic.c
index c633476616e0..bca66d83a765 100644
--- a/fs/proc/generic.c
+++ b/fs/proc/generic.c
@@ -390,6 +390,8 @@ static struct proc_dir_entry *__proc_create(struct proc_dir_entry **parent,
atomic_set(&ent->count, 1);
spin_lock_init(&ent->pde_unload_lock);
INIT_LIST_HEAD(&ent->pde_openers);
+ proc_set_user(ent, (*parent)->uid, (*parent)->gid);
+
out:
return ent;
}