mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
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>
This commit is contained in:
committed by
David S. Miller
parent
f8c46cb390
commit
c110486f6c
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user