summaryrefslogtreecommitdiffstats
path: root/include/linux/sysctl.h
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2016-08-10 17:36:02 -0400
committerDavid S. Miller <davem@davemloft.net>2016-08-15 00:08:58 -0400
commite79c6a4fc923eed2bdd3b716e0f01414847db90a (patch)
treead2cc7b3534b8767f507caf65b093fe4fca43fa9 /include/linux/sysctl.h
parentc110486f6cb240f36ec143cad6628d52c071f529 (diff)
net: make net namespace sysctls belong to container's owner
If net namespace is attached to a user namespace let's make container's root owner of sysctls affecting said network namespace instead of global root. This also allows us to clean up net_ctl_permissions() because we do not need to fudge permissions anymore for the container's owner since it now owns the objects in question. Acked-by: "Eric W. Biederman" <ebiederm@xmission.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/sysctl.h')
-rw-r--r--include/linux/sysctl.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index 697e160c78d0..d82cb6011e77 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -25,6 +25,7 @@
25#include <linux/rcupdate.h> 25#include <linux/rcupdate.h>
26#include <linux/wait.h> 26#include <linux/wait.h>
27#include <linux/rbtree.h> 27#include <linux/rbtree.h>
28#include <linux/uidgid.h>
28#include <uapi/linux/sysctl.h> 29#include <uapi/linux/sysctl.h>
29 30
30/* For the /proc/sys support */ 31/* For the /proc/sys support */
@@ -157,6 +158,9 @@ struct ctl_table_root {
157 struct ctl_table_set default_set; 158 struct ctl_table_set default_set;
158 struct ctl_table_set *(*lookup)(struct ctl_table_root *root, 159 struct ctl_table_set *(*lookup)(struct ctl_table_root *root,
159 struct nsproxy *namespaces); 160 struct nsproxy *namespaces);
161 void (*set_ownership)(struct ctl_table_header *head,
162 struct ctl_table *table,
163 kuid_t *uid, kgid_t *gid);
160 int (*permissions)(struct ctl_table_header *head, struct ctl_table *table); 164 int (*permissions)(struct ctl_table_header *head, struct ctl_table *table);
161}; 165};
162 166