aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc/generic.c
diff options
context:
space:
mode:
authorDmitry Torokhov <[email protected]>2016-08-10 21:36:01 +0000
committerDavid S. Miller <[email protected]>2016-08-15 04:07:20 +0000
commitc110486f6cb240f36ec143cad6628d52c071f529 (patch)
treec7b7e3033c55e91744c9271ffd37917ee78f6085 /fs/proc/generic.c
parentnetns: do not call pernet ops for not yet set up init_net namespace (diff)
downloadkernel-c110486f6cb240f36ec143cad6628d52c071f529.tar.gz
kernel-c110486f6cb240f36ec143cad6628d52c071f529.zip
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
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;
}