Commit bfa858f2 authored by Thomas Weißschuh's avatar Thomas Weißschuh Committed by David S. Miller
Browse files

sysctl: treewide: constify ctl_table_header::ctl_table_arg



To be able to constify instances of struct ctl_tables it is necessary to
remove ways through which non-const versions are exposed from the
sysctl core.
One of these is the ctl_table_arg member of struct ctl_table_header.

Constify this reference as a prerequisite for the full constification of
struct ctl_table instances.
No functional change.

Signed-off-by: default avatarThomas Weißschuh <linux@weissschuh.net>
Reviewed-by: default avatarKees Cook <keescook@chromium.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8442f8ba
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1971,7 +1971,7 @@ static int vrf_netns_init_sysctl(struct net *net, struct netns_vrf *nn_vrf)
static void vrf_netns_exit_sysctl(struct net *net)
{
	struct netns_vrf *nn_vrf = net_generic(net, vrf_net_id);
	struct ctl_table *table;
	const struct ctl_table *table;

	table = nn_vrf->ctl_hdr->ctl_table_arg;
	unregister_net_sysctl_table(nn_vrf->ctl_hdr);
+1 −1
Original line number Diff line number Diff line
@@ -182,7 +182,7 @@ struct ctl_table_header {
		struct rcu_head rcu;
	};
	struct completion *unregistering;
	struct ctl_table *ctl_table_arg;
	const struct ctl_table *ctl_table_arg;
	struct ctl_table_root *root;
	struct ctl_table_set *set;
	struct ctl_dir *parent;
+1 −1
Original line number Diff line number Diff line
@@ -306,7 +306,7 @@ bool setup_ipc_sysctls(struct ipc_namespace *ns)

void retire_ipc_sysctls(struct ipc_namespace *ns)
{
	struct ctl_table *tbl;
	const struct ctl_table *tbl;

	tbl = ns->ipc_sysctls->ctl_table_arg;
	unregister_sysctl_table(ns->ipc_sysctls);
+1 −1
Original line number Diff line number Diff line
@@ -160,7 +160,7 @@ bool setup_mq_sysctls(struct ipc_namespace *ns)

void retire_mq_sysctls(struct ipc_namespace *ns)
{
	struct ctl_table *tbl;
	const struct ctl_table *tbl;

	tbl = ns->mq_sysctls->ctl_table_arg;
	unregister_sysctl_table(ns->mq_sysctls);
+1 −1
Original line number Diff line number Diff line
@@ -119,7 +119,7 @@ bool setup_userns_sysctls(struct user_namespace *ns)
void retire_userns_sysctls(struct user_namespace *ns)
{
#ifdef CONFIG_SYSCTL
	struct ctl_table *tbl;
	const struct ctl_table *tbl;

	tbl = ns->sysctls->ctl_table_arg;
	unregister_sysctl_table(ns->sysctls);
Loading