Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 43444757 authored by Eric W. Biederman's avatar Eric W. Biederman Committed by David S. Miller
Browse files

net: Kill register_sysctl_rotable



register_sysctl_rotable never caught on as an interesting way to
register sysctls.  My take on the situation is that what we want are
sysctls that we can only see in the initial network namespace.  What we
have implemented with register_sysctl_rotable are sysctls that we can
see in all of the network namespaces and can only change in the initial
network namespace.

That is a very silly way to go.  Just register the network sysctls
in the initial network namespace and we don't have any weird special
cases to deal with.

The sysctls affected are:
/proc/sys/net/ipv4/ipfrag_secret_interval
/proc/sys/net/ipv4/ipfrag_max_dist
/proc/sys/net/ipv6/ip6frag_secret_interval
/proc/sys/net/ipv6/mld_max_msf

I really don't expect anyone will miss them if they can't read them in a
child user namespace.

CC: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: default avatarEric W. Biederman <ebiederm@xmission.com>
Acked-by: default avatarPavel Emelyanov <xemul@parallels.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2ca794e5
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -290,8 +290,6 @@ static inline int net_sysctl_init(void) { return 0; }
#endif
extern struct ctl_table_header *register_net_sysctl_table(struct net *net,
	const struct ctl_path *path, struct ctl_table *table);
extern struct ctl_table_header *register_net_sysctl_rotable(
	const struct ctl_path *path, struct ctl_table *table);
extern struct ctl_table_header *register_net_sysctl(struct net *net,
	const char *path, struct ctl_table *table);
extern void unregister_net_sysctl_table(struct ctl_table_header *header);
+1 −1
Original line number Diff line number Diff line
@@ -258,7 +258,7 @@ static __init int sysctl_core_init(void)
	static struct ctl_table empty[1];

	kmemleak_not_leak(register_sysctl_paths(net_core_path, empty));
	register_net_sysctl_rotable(net_core_path, net_core_table);
	register_net_sysctl(&init_net, "net/core", net_core_table);
	return register_pernet_subsys(&sysctl_core_ops);
}

+1 −1
Original line number Diff line number Diff line
@@ -807,7 +807,7 @@ static void __net_exit ip4_frags_ns_ctl_unregister(struct net *net)

static void ip4_frags_ctl_register(void)
{
	register_net_sysctl_rotable(net_ipv4_ctl_path, ip4_frags_ctl_table);
	register_net_sysctl(&init_net, "net/ipv4", ip4_frags_ctl_table);
}
#else
static inline int ip4_frags_ns_ctl_register(struct net *net)
+1 −1
Original line number Diff line number Diff line
@@ -674,7 +674,7 @@ static struct ctl_table_header *ip6_ctl_header;

static int ip6_frags_sysctl_register(void)
{
	ip6_ctl_header = register_net_sysctl_rotable(net_ipv6_ctl_path,
	ip6_ctl_header = register_net_sysctl(&init_net, "net/ipv6",
			ip6_frags_ctl_table);
	return ip6_ctl_header == NULL ? -ENOMEM : 0;
}
+1 −1
Original line number Diff line number Diff line
@@ -140,7 +140,7 @@ int ipv6_sysctl_register(void)
{
	int err = -ENOMEM;

	ip6_header = register_net_sysctl_rotable(net_ipv6_ctl_path, ipv6_rotable);
	ip6_header = register_net_sysctl(&init_net, "net/ipv6", ipv6_rotable);
	if (ip6_header == NULL)
		goto out;

Loading