Skip to content

Commit e406737

Browse files
committed
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]>
1 parent 39cd87c commit e406737

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kernel/seccomp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2334,7 +2334,7 @@ static bool seccomp_actions_logged_from_names(u32 *actions_logged, char *names)
23342334
return true;
23352335
}
23362336

2337-
static int read_actions_logged(struct ctl_table *ro_table, void *buffer,
2337+
static int read_actions_logged(const struct ctl_table *ro_table, void *buffer,
23382338
size_t *lenp, loff_t *ppos)
23392339
{
23402340
char names[sizeof(seccomp_actions_avail)];
@@ -2352,7 +2352,7 @@ static int read_actions_logged(struct ctl_table *ro_table, void *buffer,
23522352
return proc_dostring(&table, 0, buffer, lenp, ppos);
23532353
}
23542354

2355-
static int write_actions_logged(struct ctl_table *ro_table, void *buffer,
2355+
static int write_actions_logged(const struct ctl_table *ro_table, void *buffer,
23562356
size_t *lenp, loff_t *ppos, u32 *actions_logged)
23572357
{
23582358
char names[sizeof(seccomp_actions_avail)];

0 commit comments

Comments
 (0)