From c027aab4a6b1fe2541090ac04bee8ad246aeef70 Mon Sep 17 00:00:00 2001 From: "Eric W. Biederman" Date: Fri, 16 Nov 2012 03:03:10 +0000 Subject: net: Enable some sysctls that are safe for the userns root - Enable the per device ipv4 sysctls: net/ipv4/conf//forwarding net/ipv4/conf//mc_forwarding net/ipv4/conf//accept_redirects net/ipv4/conf//secure_redirects net/ipv4/conf//shared_media net/ipv4/conf//rp_filter net/ipv4/conf//send_redirects net/ipv4/conf//accept_source_route net/ipv4/conf//accept_local net/ipv4/conf//src_valid_mark net/ipv4/conf//proxy_arp net/ipv4/conf//medium_id net/ipv4/conf//bootp_relay net/ipv4/conf//log_martians net/ipv4/conf//tag net/ipv4/conf//arp_filter net/ipv4/conf//arp_announce net/ipv4/conf//arp_ignore net/ipv4/conf//arp_accept net/ipv4/conf//arp_notify net/ipv4/conf//proxy_arp_pvlan net/ipv4/conf//disable_xfrm net/ipv4/conf//disable_policy net/ipv4/conf//force_igmp_version net/ipv4/conf//promote_secondaries net/ipv4/conf//route_localnet - Enable the global ipv4 sysctl: net/ipv4/ip_forward - Enable the per device ipv6 sysctls: net/ipv6/conf//forwarding net/ipv6/conf//hop_limit net/ipv6/conf//mtu net/ipv6/conf//accept_ra net/ipv6/conf//accept_redirects net/ipv6/conf//autoconf net/ipv6/conf//dad_transmits net/ipv6/conf//router_solicitations net/ipv6/conf//router_solicitation_interval net/ipv6/conf//router_solicitation_delay net/ipv6/conf//force_mld_version net/ipv6/conf//use_tempaddr net/ipv6/conf//temp_valid_lft net/ipv6/conf//temp_prefered_lft net/ipv6/conf//regen_max_retry net/ipv6/conf//max_desync_factor net/ipv6/conf//max_addresses net/ipv6/conf//accept_ra_defrtr net/ipv6/conf//accept_ra_pinfo net/ipv6/conf//accept_ra_rtr_pref net/ipv6/conf//router_probe_interval net/ipv6/conf//accept_ra_rt_info_max_plen net/ipv6/conf//proxy_ndp net/ipv6/conf//accept_source_route net/ipv6/conf//optimistic_dad net/ipv6/conf//mc_forwarding net/ipv6/conf//disable_ipv6 net/ipv6/conf//accept_dad net/ipv6/conf//force_tllao - Enable the global ipv6 sysctls: net/ipv6/bindv6only net/ipv6/icmp/ratelimit Signed-off-by: "Eric W. Biederman" Signed-off-by: David S. Miller --- net/ipv6/addrconf.c | 4 ---- net/ipv6/icmp.c | 7 +------ net/ipv6/sysctl_net_ipv6.c | 4 ---- 3 files changed, 1 insertion(+), 14 deletions(-) (limited to 'net/ipv6') diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 67ac9f8d1976..d39fe490da08 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c @@ -4741,10 +4741,6 @@ static int __addrconf_sysctl_register(struct net *net, char *dev_name, t->addrconf_vars[i].extra2 = net; } - /* Don't export sysctls to unprivileged users */ - if (net->user_ns != &init_user_ns) - t->addrconf_vars[0].procname = NULL; - snprintf(path, sizeof(path), "net/ipv6/conf/%s", dev_name); t->sysctl_header = register_net_sysctl(net, path, t->addrconf_vars); diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c index d77dc1e2a42b..b4a9fd51dae7 100644 --- a/net/ipv6/icmp.c +++ b/net/ipv6/icmp.c @@ -967,14 +967,9 @@ struct ctl_table * __net_init ipv6_icmp_sysctl_init(struct net *net) sizeof(ipv6_icmp_table_template), GFP_KERNEL); - if (table) { + if (table) table[0].data = &net->ipv6.sysctl.icmpv6_time; - /* Don't export sysctls to unprivileged users */ - if (net->user_ns != &init_user_ns) - table[0].procname = NULL; - } - return table; } #endif diff --git a/net/ipv6/sysctl_net_ipv6.c b/net/ipv6/sysctl_net_ipv6.c index b06fd078e6c7..e85c48bd404f 100644 --- a/net/ipv6/sysctl_net_ipv6.c +++ b/net/ipv6/sysctl_net_ipv6.c @@ -52,10 +52,6 @@ static int __net_init ipv6_sysctl_net_init(struct net *net) goto out; ipv6_table[0].data = &net->ipv6.sysctl.bindv6only; - /* Don't export sysctls to unprivileged users */ - if (net->user_ns != &init_user_ns) - ipv6_table[0].procname = NULL; - ipv6_route_table = ipv6_route_sysctl_init(net); if (!ipv6_route_table) goto out_ipv6_table; -- cgit v1.2.3