aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKees Cook <[email protected]>2024-05-08 10:13:41 -0700
committerKees Cook <[email protected]>2024-05-08 12:50:40 -0700
commite406737b11103752838cf50fd197ec8e9352bbf7 (patch)
tree3914d3418cc0d348d2ad510f81d8ec002c2b6c93
parent39cd87c4eb2b893354f3b850f916353f2658ae6f (diff)
seccomp: Constify sysctl subhelpers
The read_actions_logged() and write_actions_logged() helpers called by the sysctl proc handler seccomp_actions_logged_handler() are already expecting their sysctl table argument to be read-only. Actually mark the argument as const in preparation[1] for global constification of the sysctl tables. Suggested-by: Thomas Weißschuh <[email protected]> Link: https://lore.kernel.org/lkml/[email protected]/ [1] Reviewed-by: Luis Chamberlain <[email protected]> Reviewed-by: Thomas Weißschuh <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Kees Cook <[email protected]>
-rw-r--r--kernel/seccomp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/seccomp.c b/kernel/seccomp.c
index aca7b437882e..f70e031e06a8 100644
--- a/kernel/seccomp.c
+++ b/kernel/seccomp.c
@@ -2334,7 +2334,7 @@ static bool seccomp_actions_logged_from_names(u32 *actions_logged, char *names)
return true;
}
-static int read_actions_logged(struct ctl_table *ro_table, void *buffer,
+static int read_actions_logged(const struct ctl_table *ro_table, void *buffer,
size_t *lenp, loff_t *ppos)
{
char names[sizeof(seccomp_actions_avail)];
@@ -2352,7 +2352,7 @@ static int read_actions_logged(struct ctl_table *ro_table, void *buffer,
return proc_dostring(&table, 0, buffer, lenp, ppos);
}
-static int write_actions_logged(struct ctl_table *ro_table, void *buffer,
+static int write_actions_logged(const struct ctl_table *ro_table, void *buffer,
size_t *lenp, loff_t *ppos, u32 *actions_logged)
{
char names[sizeof(seccomp_actions_avail)];