mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
net: Don't export sysctls to unprivileged users
In preparation for supporting the creation of network namespaces by unprivileged users, modify all of the per net sysctl exports and refuse to allow them to unprivileged users. This makes it safe for unprivileged users in general to access per net sysctls, and allows sysctls to be exported to unprivileged users on an individual basis as they are deemed safe. Signed-off-by: "Eric W. Biederman" <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
73f7ef4359
commit
464dc801c7
22 changed files with 98 additions and 4 deletions
|
|
@ -54,6 +54,10 @@ int __net_init xfrm_sysctl_init(struct net *net)
|
|||
table[2].data = &net->xfrm.sysctl_larval_drop;
|
||||
table[3].data = &net->xfrm.sysctl_acq_expires;
|
||||
|
||||
/* Don't export sysctls to unprivileged users */
|
||||
if (net->user_ns != &init_user_ns)
|
||||
table[0].procname = NULL;
|
||||
|
||||
net->xfrm.sysctl_hdr = register_net_sysctl(net, "net/core", table);
|
||||
if (!net->xfrm.sysctl_hdr)
|
||||
goto out_register;
|
||||
|
|
|
|||
Loading…
Reference in a new issue