2023-12-04 07:53:22

by Thomas Weißschuh

[permalink] [raw]
Subject: [PATCH v2 09/18] sysctl: treewide: constify ctl_table_root::set_ownership

In a future commit the sysctl core will only use
"const struct ctl_table". As a preparation for that adapt the
set_ownership callbacks.

Signed-off-by: Thomas Weißschuh <[email protected]>
---
include/linux/sysctl.h | 2 +-
net/sysctl_net.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index 26a38161c28f..800154e1ff88 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -205,7 +205,7 @@ struct ctl_table_root {
struct ctl_table_set default_set;
struct ctl_table_set *(*lookup)(struct ctl_table_root *root);
void (*set_ownership)(struct ctl_table_header *head,
- struct ctl_table *table,
+ const struct ctl_table *table,
kuid_t *uid, kgid_t *gid);
int (*permissions)(struct ctl_table_header *head, struct ctl_table *table);
};
diff --git a/net/sysctl_net.c b/net/sysctl_net.c
index 051ed5f6fc93..1310ef8f0958 100644
--- a/net/sysctl_net.c
+++ b/net/sysctl_net.c
@@ -54,7 +54,7 @@ static int net_ctl_permissions(struct ctl_table_header *head,
}

static void net_ctl_set_ownership(struct ctl_table_header *head,
- struct ctl_table *table,
+ const struct ctl_table *table,
kuid_t *uid, kgid_t *gid)
{
struct net *net = container_of(head->set, struct net, sysctls);

--
2.43.0