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/ipv4/devinet.c | 8 -------- 1 file changed, 8 deletions(-) (limited to 'net/ipv4/devinet.c') diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index 259622a5e690..298c1c279739 100644 --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c @@ -1821,10 +1821,6 @@ static int __devinet_sysctl_register(struct net *net, char *dev_name, t->devinet_vars[i].extra2 = net; } - /* Don't export sysctls to unprivileged users */ - if (net->user_ns != &init_user_ns) - t->devinet_vars[0].procname = NULL; - snprintf(path, sizeof(path), "net/ipv4/conf/%s", dev_name); t->sysctl_header = register_net_sysctl(net, path, t->devinet_vars); @@ -1910,10 +1906,6 @@ static __net_init int devinet_init_net(struct net *net) tbl[0].data = &all->data[IPV4_DEVCONF_FORWARDING - 1]; tbl[0].extra1 = all; tbl[0].extra2 = net; - - /* Don't export sysctls to unprivileged users */ - if (net->user_ns != &init_user_ns) - tbl[0].procname = NULL; #endif } -- cgit v1.2.3-59-g8ed1b