diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2025-01-29 10:35:40 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2025-01-29 10:35:40 -0800 |
| commit | af13ff1c33e043b746cd96c83c7660ddf0272f73 (patch) | |
| tree | 9c0f6b33b52346f15ed481e201e56631752950c5 /kernel/utsname_sysctl.c | |
| parent | Merge tag 'fuse-update-6.14' of git://git.kernel.org/pub/scm/linux/kernel/git... (diff) | |
| parent | treewide: const qualify ctl_tables where applicable (diff) | |
| download | linux-af13ff1c33e043b746cd96c83c7660ddf0272f73.tar.gz linux-af13ff1c33e043b746cd96c83c7660ddf0272f73.zip | |
Merge tag 'constfy-sysctl-6.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/sysctl/sysctl
Pull sysctl table constification from Joel Granados:
"All ctl_table declared outside of functions and that remain unmodified
after initialization are const qualified.
This prevents unintended modifications to proc_handler function
pointers by placing them in the .rodata section.
This is a continuation of the tree-wide effort started a few releases
ago with the constification of the ctl_table struct arguments in the
sysctl API done in 78eb4ea25cd5 ("sysctl: treewide: constify the
ctl_table argument of proc_handlers")"
* tag 'constfy-sysctl-6.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/sysctl/sysctl:
treewide: const qualify ctl_tables where applicable
Diffstat (limited to 'kernel/utsname_sysctl.c')
| -rw-r--r-- | kernel/utsname_sysctl.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/utsname_sysctl.c b/kernel/utsname_sysctl.c index 7282f61a8650..bfbaaecb1dd4 100644 --- a/kernel/utsname_sysctl.c +++ b/kernel/utsname_sysctl.c @@ -75,7 +75,7 @@ static DEFINE_CTL_TABLE_POLL(hostname_poll); static DEFINE_CTL_TABLE_POLL(domainname_poll); // Note: update 'enum uts_proc' to match any changes to this table -static struct ctl_table uts_kern_table[] = { +static const struct ctl_table uts_kern_table[] = { { .procname = "arch", .data = init_uts_ns.name.machine, @@ -129,7 +129,7 @@ static struct ctl_table uts_kern_table[] = { */ void uts_proc_notify(enum uts_proc proc) { - struct ctl_table *table = &uts_kern_table[proc]; + const struct ctl_table *table = &uts_kern_table[proc]; proc_sys_poll_notify(table->poll); } |
