Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

+113 -113
+1 -1
arch/arm/kernel/isa.c
··· 16 16 17 17 static unsigned int isa_membase, isa_portbase, isa_portshift; 18 18 19 - static struct ctl_table ctl_isa_vars[] = { 19 + static const struct ctl_table ctl_isa_vars[] = { 20 20 { 21 21 .procname = "membase", 22 22 .data = &isa_membase,
+2 -2
arch/arm64/kernel/fpsimd.c
··· 562 562 return 0; 563 563 } 564 564 565 - static struct ctl_table sve_default_vl_table[] = { 565 + static const struct ctl_table sve_default_vl_table[] = { 566 566 { 567 567 .procname = "sve_default_vector_length", 568 568 .mode = 0644, ··· 585 585 #endif /* ! (CONFIG_ARM64_SVE && CONFIG_SYSCTL) */ 586 586 587 587 #if defined(CONFIG_ARM64_SME) && defined(CONFIG_SYSCTL) 588 - static struct ctl_table sme_default_vl_table[] = { 588 + static const struct ctl_table sme_default_vl_table[] = { 589 589 { 590 590 .procname = "sme_default_vector_length", 591 591 .mode = 0644,
+1 -1
arch/arm64/kernel/process.c
··· 859 859 * disable it for tasks that already opted in to the relaxed ABI. 860 860 */ 861 861 862 - static struct ctl_table tagged_addr_sysctl_table[] = { 862 + static const struct ctl_table tagged_addr_sysctl_table[] = { 863 863 { 864 864 .procname = "tagged_addr_disabled", 865 865 .mode = 0644,
+1 -1
arch/powerpc/kernel/idle.c
··· 97 97 /* 98 98 * Register the sysctl to set/clear powersave_nap. 99 99 */ 100 - static struct ctl_table powersave_nap_ctl_table[] = { 100 + static const struct ctl_table powersave_nap_ctl_table[] = { 101 101 { 102 102 .procname = "powersave-nap", 103 103 .data = &powersave_nap,
+1 -1
arch/powerpc/platforms/pseries/mobility.c
··· 53 53 static unsigned int nmi_wd_lpm_factor = 200; 54 54 55 55 #ifdef CONFIG_SYSCTL 56 - static struct ctl_table nmi_wd_lpm_factor_ctl_table[] = { 56 + static const struct ctl_table nmi_wd_lpm_factor_ctl_table[] = { 57 57 { 58 58 .procname = "nmi_wd_lpm_factor", 59 59 .data = &nmi_wd_lpm_factor,
+1 -1
arch/riscv/kernel/process.c
··· 364 364 * disable it for tasks that already opted in to the relaxed ABI. 365 365 */ 366 366 367 - static struct ctl_table tagged_addr_sysctl_table[] = { 367 + static const struct ctl_table tagged_addr_sysctl_table[] = { 368 368 { 369 369 .procname = "tagged_addr_disabled", 370 370 .mode = 0644,
+1 -1
arch/riscv/kernel/vector.c
··· 287 287 288 288 #ifdef CONFIG_SYSCTL 289 289 290 - static struct ctl_table riscv_v_default_vstate_table[] = { 290 + static const struct ctl_table riscv_v_default_vstate_table[] = { 291 291 { 292 292 .procname = "riscv_v_default_allow", 293 293 .data = &riscv_v_implicit_uacc,
+1 -1
arch/s390/appldata/appldata_base.c
··· 52 52 void *buffer, size_t *lenp, loff_t *ppos); 53 53 54 54 static struct ctl_table_header *appldata_sysctl_header; 55 - static struct ctl_table appldata_table[] = { 55 + static const struct ctl_table appldata_table[] = { 56 56 { 57 57 .procname = "timer", 58 58 .mode = S_IRUGO | S_IWUSR,
+1 -1
arch/s390/kernel/debug.c
··· 1122 1122 return 0; 1123 1123 } 1124 1124 1125 - static struct ctl_table s390dbf_table[] = { 1125 + static const struct ctl_table s390dbf_table[] = { 1126 1126 { 1127 1127 .procname = "debug_stoppable", 1128 1128 .data = &debug_stoppable,
+1 -1
arch/s390/kernel/hiperdispatch.c
··· 292 292 return 0; 293 293 } 294 294 295 - static struct ctl_table hiperdispatch_ctl_table[] = { 295 + static const struct ctl_table hiperdispatch_ctl_table[] = { 296 296 { 297 297 .procname = "hiperdispatch", 298 298 .mode = 0644,
+1 -1
arch/s390/kernel/topology.c
··· 667 667 return set_polarization(polarization); 668 668 } 669 669 670 - static struct ctl_table topology_ctl_table[] = { 670 + static const struct ctl_table topology_ctl_table[] = { 671 671 { 672 672 .procname = "topology", 673 673 .mode = 0644,
+1 -1
arch/s390/mm/cmm.c
··· 332 332 return 0; 333 333 } 334 334 335 - static struct ctl_table cmm_table[] = { 335 + static const struct ctl_table cmm_table[] = { 336 336 { 337 337 .procname = "cmm_pages", 338 338 .mode = 0644,
+1 -1
arch/s390/mm/pgalloc.c
··· 21 21 int page_table_allocate_pgste = 0; 22 22 EXPORT_SYMBOL(page_table_allocate_pgste); 23 23 24 - static struct ctl_table page_table_sysctl[] = { 24 + static const struct ctl_table page_table_sysctl[] = { 25 25 { 26 26 .procname = "allocate_pgste", 27 27 .data = &page_table_allocate_pgste,
+1 -1
arch/x86/entry/vdso/vdso32-setup.c
··· 57 57 /* Register vsyscall32 into the ABI table */ 58 58 #include <linux/sysctl.h> 59 59 60 - static struct ctl_table abi_table2[] = { 60 + static const struct ctl_table abi_table2[] = { 61 61 { 62 62 .procname = "vsyscall32", 63 63 .data = &vdso32_enabled,
+1 -1
arch/x86/kernel/cpu/bus_lock.c
··· 49 49 static DEFINE_SEMAPHORE(buslock_sem, 1); 50 50 51 51 #ifdef CONFIG_PROC_SYSCTL 52 - static struct ctl_table sld_sysctls[] = { 52 + static const struct ctl_table sld_sysctls[] = { 53 53 { 54 54 .procname = "split_lock_mitigate", 55 55 .data = &sysctl_sld_mitigate,
+1 -1
crypto/fips.c
··· 41 41 static char fips_name[] = FIPS_MODULE_NAME; 42 42 static char fips_version[] = FIPS_MODULE_VERSION; 43 43 44 - static struct ctl_table crypto_sysctl_table[] = { 44 + static const struct ctl_table crypto_sysctl_table[] = { 45 45 { 46 46 .procname = "fips_enabled", 47 47 .data = &fips_enabled,
+1 -1
drivers/base/firmware_loader/fallback_table.c
··· 25 25 EXPORT_SYMBOL_NS_GPL(fw_fallback_config, "FIRMWARE_LOADER_PRIVATE"); 26 26 27 27 #ifdef CONFIG_SYSCTL 28 - static struct ctl_table firmware_config_table[] = { 28 + static const struct ctl_table firmware_config_table[] = { 29 29 { 30 30 .procname = "force_sysfs_fallback", 31 31 .data = &fw_fallback_config.force_sysfs_fallback,
+1 -1
drivers/cdrom/cdrom.c
··· 3612 3612 } 3613 3613 3614 3614 /* Place files in /proc/sys/dev/cdrom */ 3615 - static struct ctl_table cdrom_table[] = { 3615 + static const struct ctl_table cdrom_table[] = { 3616 3616 { 3617 3617 .procname = "info", 3618 3618 .data = &cdrom_sysctl_settings.info,
+1 -1
drivers/char/hpet.c
··· 724 724 return 0; 725 725 } 726 726 727 - static struct ctl_table hpet_table[] = { 727 + static const struct ctl_table hpet_table[] = { 728 728 { 729 729 .procname = "max-user-freq", 730 730 .data = &hpet_max_freq,
+1 -1
drivers/char/ipmi/ipmi_poweroff.c
··· 650 650 #ifdef CONFIG_PROC_FS 651 651 #include <linux/sysctl.h> 652 652 653 - static struct ctl_table ipmi_table[] = { 653 + static const struct ctl_table ipmi_table[] = { 654 654 { .procname = "poweroff_powercycle", 655 655 .data = &poweroff_powercycle, 656 656 .maxlen = sizeof(poweroff_powercycle),
+1 -1
drivers/char/random.c
··· 1665 1665 return write ? 0 : proc_dointvec(table, 0, buf, lenp, ppos); 1666 1666 } 1667 1667 1668 - static struct ctl_table random_table[] = { 1668 + static const struct ctl_table random_table[] = { 1669 1669 { 1670 1670 .procname = "poolsize", 1671 1671 .data = &sysctl_poolsize,
+1 -1
drivers/gpu/drm/i915/i915_perf.c
··· 4802 4802 return ret; 4803 4803 } 4804 4804 4805 - static struct ctl_table oa_table[] = { 4805 + static const struct ctl_table oa_table[] = { 4806 4806 { 4807 4807 .procname = "perf_stream_paranoid", 4808 4808 .data = &i915_perf_stream_paranoid,
+1 -1
drivers/gpu/drm/xe/xe_observation.c
··· 56 56 } 57 57 } 58 58 59 - static struct ctl_table observation_ctl_table[] = { 59 + static const struct ctl_table observation_ctl_table[] = { 60 60 { 61 61 .procname = "observation_paranoid", 62 62 .data = &xe_observation_paranoid,
+1 -1
drivers/hv/hv_common.c
··· 141 141 * sysctl option to allow the user to control whether kmsg data should be 142 142 * reported to Hyper-V on panic. 143 143 */ 144 - static struct ctl_table hv_ctl_table[] = { 144 + static const struct ctl_table hv_ctl_table[] = { 145 145 { 146 146 .procname = "hyperv_record_panic_msg", 147 147 .data = &sysctl_record_panic_msg,
+1 -1
drivers/md/md.c
··· 294 294 295 295 static struct ctl_table_header *raid_table_header; 296 296 297 - static struct ctl_table raid_table[] = { 297 + static const struct ctl_table raid_table[] = { 298 298 { 299 299 .procname = "speed_limit_min", 300 300 .data = &sysctl_speed_limit_min,
+2 -2
drivers/misc/sgi-xp/xpc_main.c
··· 93 93 static int xpc_disengage_min_timelimit; /* = 0 */ 94 94 static int xpc_disengage_max_timelimit = 120; 95 95 96 - static struct ctl_table xpc_sys_xpc_hb[] = { 96 + static const struct ctl_table xpc_sys_xpc_hb[] = { 97 97 { 98 98 .procname = "hb_interval", 99 99 .data = &xpc_hb_interval, ··· 111 111 .extra1 = &xpc_hb_check_min_interval, 112 112 .extra2 = &xpc_hb_check_max_interval}, 113 113 }; 114 - static struct ctl_table xpc_sys_xpc[] = { 114 + static const struct ctl_table xpc_sys_xpc[] = { 115 115 { 116 116 .procname = "disengage_timelimit", 117 117 .data = &xpc_disengage_timelimit,
+1 -1
drivers/perf/arm_pmuv3.c
··· 1279 1279 return 0; 1280 1280 } 1281 1281 1282 - static struct ctl_table armv8_pmu_sysctl_table[] = { 1282 + static const struct ctl_table armv8_pmu_sysctl_table[] = { 1283 1283 { 1284 1284 .procname = "perf_user_access", 1285 1285 .data = &sysctl_perf_user_access,
+1 -1
drivers/perf/riscv_pmu_sbi.c
··· 1317 1317 return 0; 1318 1318 } 1319 1319 1320 - static struct ctl_table sbi_pmu_sysctl_table[] = { 1320 + static const struct ctl_table sbi_pmu_sysctl_table[] = { 1321 1321 { 1322 1322 .procname = "perf_user_access", 1323 1323 .data = &sysctl_perf_user_access,
+1 -1
drivers/scsi/scsi_sysctl.c
··· 12 12 #include "scsi_priv.h" 13 13 14 14 15 - static struct ctl_table scsi_table[] = { 15 + static const struct ctl_table scsi_table[] = { 16 16 { .procname = "logging_level", 17 17 .data = &scsi_logging_level, 18 18 .maxlen = sizeof(scsi_logging_level),
+1 -1
drivers/scsi/sg.c
··· 1639 1639 #ifdef CONFIG_SYSCTL 1640 1640 #include <linux/sysctl.h> 1641 1641 1642 - static struct ctl_table sg_sysctls[] = { 1642 + static const struct ctl_table sg_sysctls[] = { 1643 1643 { 1644 1644 .procname = "sg-big-buff", 1645 1645 .data = &sg_big_buff,
+1 -1
drivers/xen/balloon.c
··· 84 84 #ifdef CONFIG_XEN_BALLOON_MEMORY_HOTPLUG 85 85 static int xen_hotplug_unpopulated; 86 86 87 - static struct ctl_table balloon_table[] = { 87 + static const struct ctl_table balloon_table[] = { 88 88 { 89 89 .procname = "hotplug_unpopulated", 90 90 .data = &xen_hotplug_unpopulated,
+1 -1
fs/aio.c
··· 224 224 static unsigned long aio_max_nr = 0x10000; /* system wide maximum number of aio requests */ 225 225 /*----end sysctl variables---*/ 226 226 #ifdef CONFIG_SYSCTL 227 - static struct ctl_table aio_sysctls[] = { 227 + static const struct ctl_table aio_sysctls[] = { 228 228 { 229 229 .procname = "aio-nr", 230 230 .data = &aio_nr,
+1 -1
fs/cachefiles/error_inject.c
··· 11 11 unsigned int cachefiles_error_injection_state; 12 12 13 13 static struct ctl_table_header *cachefiles_sysctl; 14 - static struct ctl_table cachefiles_sysctls[] = { 14 + static const struct ctl_table cachefiles_sysctls[] = { 15 15 { 16 16 .procname = "error_injection", 17 17 .data = &cachefiles_error_injection_state,
+1 -1
fs/coda/sysctl.c
··· 14 14 15 15 static struct ctl_table_header *fs_table_header; 16 16 17 - static struct ctl_table coda_table[] = { 17 + static const struct ctl_table coda_table[] = { 18 18 { 19 19 .procname = "timeout", 20 20 .data = &coda_timeout,
+1 -1
fs/coredump.c
··· 995 995 static const unsigned int core_file_note_size_min = CORE_FILE_NOTE_SIZE_DEFAULT; 996 996 static const unsigned int core_file_note_size_max = CORE_FILE_NOTE_SIZE_MAX; 997 997 998 - static struct ctl_table coredump_sysctls[] = { 998 + static const struct ctl_table coredump_sysctls[] = { 999 999 { 1000 1000 .procname = "core_uses_pid", 1001 1001 .data = &core_uses_pid,
+1 -1
fs/dcache.c
··· 192 192 return proc_doulongvec_minmax(table, write, buffer, lenp, ppos); 193 193 } 194 194 195 - static struct ctl_table fs_dcache_sysctls[] = { 195 + static const struct ctl_table fs_dcache_sysctls[] = { 196 196 { 197 197 .procname = "dentry-state", 198 198 .data = &dentry_stat,
+1 -1
fs/devpts/inode.c
··· 45 45 static int pty_limit_max = INT_MAX; 46 46 static atomic_t pty_count = ATOMIC_INIT(0); 47 47 48 - static struct ctl_table pty_table[] = { 48 + static const struct ctl_table pty_table[] = { 49 49 { 50 50 .procname = "max", 51 51 .maxlen = sizeof(int),
+1 -1
fs/eventpoll.c
··· 318 318 static long long_zero; 319 319 static long long_max = LONG_MAX; 320 320 321 - static struct ctl_table epoll_table[] = { 321 + static const struct ctl_table epoll_table[] = { 322 322 { 323 323 .procname = "max_user_watches", 324 324 .data = &max_user_watches,
+1 -1
fs/exec.c
··· 2159 2159 return error; 2160 2160 } 2161 2161 2162 - static struct ctl_table fs_exec_sysctls[] = { 2162 + static const struct ctl_table fs_exec_sysctls[] = { 2163 2163 { 2164 2164 .procname = "suid_dumpable", 2165 2165 .data = &suid_dumpable,
+1 -1
fs/file_table.c
··· 106 106 return proc_doulongvec_minmax(table, write, buffer, lenp, ppos); 107 107 } 108 108 109 - static struct ctl_table fs_stat_sysctls[] = { 109 + static const struct ctl_table fs_stat_sysctls[] = { 110 110 { 111 111 .procname = "file-nr", 112 112 .data = &files_stat,
+1 -1
fs/fuse/sysctl.c
··· 13 13 /* Bound by fuse_init_out max_pages, which is a u16 */ 14 14 static unsigned int sysctl_fuse_max_pages_limit = 65535; 15 15 16 - static struct ctl_table fuse_sysctl_table[] = { 16 + static const struct ctl_table fuse_sysctl_table[] = { 17 17 { 18 18 .procname = "max_pages_limit", 19 19 .data = &fuse_max_pages_limit,
+1 -1
fs/inode.c
··· 184 184 return proc_doulongvec_minmax(table, write, buffer, lenp, ppos); 185 185 } 186 186 187 - static struct ctl_table inodes_sysctls[] = { 187 + static const struct ctl_table inodes_sysctls[] = { 188 188 { 189 189 .procname = "inode-nr", 190 190 .data = &inodes_stat,
+1 -1
fs/lockd/svc.c
··· 412 412 * Sysctl parameters (same as module parameters, different interface). 413 413 */ 414 414 415 - static struct ctl_table nlm_sysctls[] = { 415 + static const struct ctl_table nlm_sysctls[] = { 416 416 { 417 417 .procname = "nlm_grace_period", 418 418 .data = &nlm_grace_period,
+1 -1
fs/locks.c
··· 97 97 static int lease_break_time = 45; 98 98 99 99 #ifdef CONFIG_SYSCTL 100 - static struct ctl_table locks_sysctls[] = { 100 + static const struct ctl_table locks_sysctls[] = { 101 101 { 102 102 .procname = "leases-enable", 103 103 .data = &leases_enable,
+1 -1
fs/namei.c
··· 1099 1099 static int sysctl_protected_regular __read_mostly; 1100 1100 1101 1101 #ifdef CONFIG_SYSCTL 1102 - static struct ctl_table namei_sysctls[] = { 1102 + static const struct ctl_table namei_sysctls[] = { 1103 1103 { 1104 1104 .procname = "protected_symlinks", 1105 1105 .data = &sysctl_protected_symlinks,
+1 -1
fs/namespace.c
··· 5985 5985 }; 5986 5986 5987 5987 #ifdef CONFIG_SYSCTL 5988 - static struct ctl_table fs_namespace_sysctls[] = { 5988 + static const struct ctl_table fs_namespace_sysctls[] = { 5989 5989 { 5990 5990 .procname = "mount-max", 5991 5991 .data = &sysctl_mount_max,
+1 -1
fs/nfs/nfs4sysctl.c
··· 17 17 static const int nfs_set_port_max = 65535; 18 18 static struct ctl_table_header *nfs4_callback_sysctl_table; 19 19 20 - static struct ctl_table nfs4_cb_sysctls[] = { 20 + static const struct ctl_table nfs4_cb_sysctls[] = { 21 21 { 22 22 .procname = "nfs_callback_tcpport", 23 23 .data = &nfs_callback_set_tcpport,
+1 -1
fs/nfs/sysctl.c
··· 14 14 15 15 static struct ctl_table_header *nfs_callback_sysctl_table; 16 16 17 - static struct ctl_table nfs_cb_sysctls[] = { 17 + static const struct ctl_table nfs_cb_sysctls[] = { 18 18 { 19 19 .procname = "nfs_mountpoint_timeout", 20 20 .data = &nfs_mountpoint_expiry_timeout,
+1 -1
fs/notify/dnotify/dnotify.c
··· 20 20 21 21 static int dir_notify_enable __read_mostly = 1; 22 22 #ifdef CONFIG_SYSCTL 23 - static struct ctl_table dnotify_sysctls[] = { 23 + static const struct ctl_table dnotify_sysctls[] = { 24 24 { 25 25 .procname = "dir-notify-enable", 26 26 .data = &dir_notify_enable,
+1 -1
fs/notify/fanotify/fanotify_user.c
··· 58 58 static long ft_zero = 0; 59 59 static long ft_int_max = INT_MAX; 60 60 61 - static struct ctl_table fanotify_table[] = { 61 + static const struct ctl_table fanotify_table[] = { 62 62 { 63 63 .procname = "max_user_groups", 64 64 .data = &init_user_ns.ucount_max[UCOUNT_FANOTIFY_GROUPS],
+1 -1
fs/notify/inotify/inotify_user.c
··· 58 58 static long it_zero = 0; 59 59 static long it_int_max = INT_MAX; 60 60 61 - static struct ctl_table inotify_table[] = { 61 + static const struct ctl_table inotify_table[] = { 62 62 { 63 63 .procname = "max_user_instances", 64 64 .data = &init_user_ns.ucount_max[UCOUNT_INOTIFY_INSTANCES],
+1 -1
fs/ocfs2/stackglue.c
··· 650 650 * and easier to preserve the name. 651 651 */ 652 652 653 - static struct ctl_table ocfs2_nm_table[] = { 653 + static const struct ctl_table ocfs2_nm_table[] = { 654 654 { 655 655 .procname = "hb_ctl_path", 656 656 .data = ocfs2_hb_ctl_path,
+1 -1
fs/pipe.c
··· 1478 1478 do_proc_dopipe_max_size_conv, NULL); 1479 1479 } 1480 1480 1481 - static struct ctl_table fs_pipe_sysctls[] = { 1481 + static const struct ctl_table fs_pipe_sysctls[] = { 1482 1482 { 1483 1483 .procname = "pipe-max-size", 1484 1484 .data = &pipe_max_size,
+1 -1
fs/quota/dquot.c
··· 2926 2926 return proc_doulongvec_minmax(table, write, buffer, lenp, ppos); 2927 2927 } 2928 2928 2929 - static struct ctl_table fs_dqstats_table[] = { 2929 + static const struct ctl_table fs_dqstats_table[] = { 2930 2930 { 2931 2931 .procname = "lookups", 2932 2932 .data = &dqstats.stat[DQST_LOOKUPS],
+1 -1
fs/sysctls.c
··· 7 7 #include <linux/init.h> 8 8 #include <linux/sysctl.h> 9 9 10 - static struct ctl_table fs_shared_sysctls[] = { 10 + static const struct ctl_table fs_shared_sysctls[] = { 11 11 { 12 12 .procname = "overflowuid", 13 13 .data = &fs_overflowuid,
+1 -1
fs/userfaultfd.c
··· 36 36 static int sysctl_unprivileged_userfaultfd __read_mostly; 37 37 38 38 #ifdef CONFIG_SYSCTL 39 - static struct ctl_table vm_userfaultfd_table[] = { 39 + static const struct ctl_table vm_userfaultfd_table[] = { 40 40 { 41 41 .procname = "unprivileged_userfaultfd", 42 42 .data = &sysctl_unprivileged_userfaultfd,
+1 -1
fs/verity/init.c
··· 10 10 #include <linux/ratelimit.h> 11 11 12 12 #ifdef CONFIG_SYSCTL 13 - static struct ctl_table fsverity_sysctl_table[] = { 13 + static const struct ctl_table fsverity_sysctl_table[] = { 14 14 #ifdef CONFIG_FS_VERITY_BUILTIN_SIGNATURES 15 15 { 16 16 .procname = "require_signatures",
+1 -1
fs/xfs/xfs_sysctl.c
··· 66 66 return proc_dointvec_minmax(ctl, write, buffer, lenp, ppos); 67 67 } 68 68 69 - static struct ctl_table xfs_table[] = { 69 + static const struct ctl_table xfs_table[] = { 70 70 { 71 71 .procname = "irix_sgid_inherit", 72 72 .data = &xfs_params.sgid_inherit.val,
+1 -1
init/do_mounts_initrd.c
··· 21 21 unsigned long phys_initrd_size __initdata; 22 22 23 23 #ifdef CONFIG_SYSCTL 24 - static struct ctl_table kern_do_mounts_initrd_table[] = { 24 + static const struct ctl_table kern_do_mounts_initrd_table[] = { 25 25 { 26 26 .procname = "real-root-dev", 27 27 .data = &real_root_dev,
+1 -1
io_uring/io_uring.c
··· 157 157 static int __read_mostly sysctl_io_uring_group = -1; 158 158 159 159 #ifdef CONFIG_SYSCTL 160 - static struct ctl_table kernel_io_uring_disabled_table[] = { 160 + static const struct ctl_table kernel_io_uring_disabled_table[] = { 161 161 { 162 162 .procname = "io_uring_disabled", 163 163 .data = &sysctl_io_uring_disabled,
+1 -1
ipc/ipc_sysctl.c
··· 73 73 int ipc_mni_shift = IPCMNI_SHIFT; 74 74 int ipc_min_cycle = RADIX_TREE_MAP_SIZE; 75 75 76 - static struct ctl_table ipc_sysctls[] = { 76 + static const struct ctl_table ipc_sysctls[] = { 77 77 { 78 78 .procname = "shmmax", 79 79 .data = &init_ipc_ns.shm_ctlmax,
+1 -1
ipc/mq_sysctl.c
··· 20 20 static int msg_maxsize_limit_min = MIN_MSGSIZEMAX; 21 21 static int msg_maxsize_limit_max = HARD_MSGSIZEMAX; 22 22 23 - static struct ctl_table mq_sysctls[] = { 23 + static const struct ctl_table mq_sysctls[] = { 24 24 { 25 25 .procname = "queues_max", 26 26 .data = &init_ipc_ns.mq_queues_max,
+1 -1
kernel/acct.c
··· 76 76 #define ACCT_TIMEOUT (acct_parm[2]) /* foo second timeout between checks */ 77 77 78 78 #ifdef CONFIG_SYSCTL 79 - static struct ctl_table kern_acct_table[] = { 79 + static const struct ctl_table kern_acct_table[] = { 80 80 { 81 81 .procname = "acct", 82 82 .data = &acct_parm,
+1 -1
kernel/bpf/syscall.c
··· 6128 6128 return ret; 6129 6129 } 6130 6130 6131 - static struct ctl_table bpf_syscall_table[] = { 6131 + static const struct ctl_table bpf_syscall_table[] = { 6132 6132 { 6133 6133 .procname = "unprivileged_bpf_disabled", 6134 6134 .data = &sysctl_unprivileged_bpf_disabled,
+1 -1
kernel/delayacct.c
··· 64 64 return err; 65 65 } 66 66 67 - static struct ctl_table kern_delayacct_table[] = { 67 + static const struct ctl_table kern_delayacct_table[] = { 68 68 { 69 69 .procname = "task_delayacct", 70 70 .data = NULL,
+1 -1
kernel/exit.c
··· 85 85 static unsigned int oops_limit = 10000; 86 86 87 87 #ifdef CONFIG_SYSCTL 88 - static struct ctl_table kern_exit_table[] = { 88 + static const struct ctl_table kern_exit_table[] = { 89 89 { 90 90 .procname = "oops_limit", 91 91 .data = &oops_limit,
+1 -1
kernel/hung_task.c
··· 274 274 * and hung_task_check_interval_secs 275 275 */ 276 276 static const unsigned long hung_task_timeout_max = (LONG_MAX / HZ); 277 - static struct ctl_table hung_task_sysctls[] = { 277 + static const struct ctl_table hung_task_sysctls[] = { 278 278 #ifdef CONFIG_SMP 279 279 { 280 280 .procname = "hung_task_all_cpu_backtrace",
+1 -1
kernel/kexec_core.c
··· 925 925 return proc_dointvec(&tmp, write, buffer, lenp, ppos); 926 926 } 927 927 928 - static struct ctl_table kexec_core_sysctls[] = { 928 + static const struct ctl_table kexec_core_sysctls[] = { 929 929 { 930 930 .procname = "kexec_load_disabled", 931 931 .data = &kexec_load_disabled,
+1 -1
kernel/kprobes.c
··· 946 946 return ret; 947 947 } 948 948 949 - static struct ctl_table kprobe_sysctls[] = { 949 + static const struct ctl_table kprobe_sysctls[] = { 950 950 { 951 951 .procname = "kprobes-optimization", 952 952 .data = &sysctl_kprobes_optimization,
+1 -1
kernel/latencytop.c
··· 77 77 return err; 78 78 } 79 79 80 - static struct ctl_table latencytop_sysctl[] = { 80 + static const struct ctl_table latencytop_sysctl[] = { 81 81 { 82 82 .procname = "latencytop", 83 83 .data = &latencytop_enabled,
+1 -1
kernel/locking/lockdep.c
··· 79 79 #endif 80 80 81 81 #ifdef CONFIG_SYSCTL 82 - static struct ctl_table kern_lockdep_table[] = { 82 + static const struct ctl_table kern_lockdep_table[] = { 83 83 #ifdef CONFIG_PROVE_LOCKING 84 84 { 85 85 .procname = "prove_locking",
+1 -1
kernel/panic.c
··· 84 84 EXPORT_SYMBOL(panic_notifier_list); 85 85 86 86 #ifdef CONFIG_SYSCTL 87 - static struct ctl_table kern_panic_table[] = { 87 + static const struct ctl_table kern_panic_table[] = { 88 88 #ifdef CONFIG_SMP 89 89 { 90 90 .procname = "oops_all_cpu_backtrace",
+1 -1
kernel/pid.c
··· 695 695 .set_ownership = pid_table_root_set_ownership, 696 696 }; 697 697 698 - static struct ctl_table pid_table[] = { 698 + static const struct ctl_table pid_table[] = { 699 699 { 700 700 .procname = "pid_max", 701 701 .data = &init_pid_ns.pid_max,
+1 -1
kernel/pid_namespace.c
··· 303 303 return ret; 304 304 } 305 305 306 - static struct ctl_table pid_ns_ctl_table[] = { 306 + static const struct ctl_table pid_ns_ctl_table[] = { 307 307 { 308 308 .procname = "ns_last_pid", 309 309 .maxlen = sizeof(int),
+1 -1
kernel/pid_sysctl.h
··· 31 31 return err; 32 32 } 33 33 34 - static struct ctl_table pid_ns_ctl_table_vm[] = { 34 + static const struct ctl_table pid_ns_ctl_table_vm[] = { 35 35 { 36 36 .procname = "memfd_noexec", 37 37 .data = &init_pid_ns.memfd_noexec_scope,
+1 -1
kernel/printk/sysctl.c
··· 20 20 return proc_dointvec_minmax(table, write, buffer, lenp, ppos); 21 21 } 22 22 23 - static struct ctl_table printk_sysctls[] = { 23 + static const struct ctl_table printk_sysctls[] = { 24 24 { 25 25 .procname = "printk", 26 26 .data = &console_loglevel,
+1 -1
kernel/reboot.c
··· 1287 1287 }; 1288 1288 1289 1289 #ifdef CONFIG_SYSCTL 1290 - static struct ctl_table kern_reboot_table[] = { 1290 + static const struct ctl_table kern_reboot_table[] = { 1291 1291 { 1292 1292 .procname = "poweroff_cmd", 1293 1293 .data = &poweroff_cmd,
+1 -1
kernel/sched/autogroup.c
··· 9 9 static atomic_t autogroup_seq_nr; 10 10 11 11 #ifdef CONFIG_SYSCTL 12 - static struct ctl_table sched_autogroup_sysctls[] = { 12 + static const struct ctl_table sched_autogroup_sysctls[] = { 13 13 { 14 14 .procname = "sched_autogroup_enabled", 15 15 .data = &sysctl_sched_autogroup_enabled,
+1 -1
kernel/sched/core.c
··· 4654 4654 #endif /* CONFIG_SCHEDSTATS */ 4655 4655 4656 4656 #ifdef CONFIG_SYSCTL 4657 - static struct ctl_table sched_core_sysctls[] = { 4657 + static const struct ctl_table sched_core_sysctls[] = { 4658 4658 #ifdef CONFIG_SCHEDSTATS 4659 4659 { 4660 4660 .procname = "sched_schedstats",
+1 -1
kernel/sched/deadline.c
··· 26 26 static unsigned int sysctl_sched_dl_period_max = 1 << 22; /* ~4 seconds */ 27 27 static unsigned int sysctl_sched_dl_period_min = 100; /* 100 us */ 28 28 #ifdef CONFIG_SYSCTL 29 - static struct ctl_table sched_dl_sysctls[] = { 29 + static const struct ctl_table sched_dl_sysctls[] = { 30 30 { 31 31 .procname = "sched_deadline_period_max_us", 32 32 .data = &sysctl_sched_dl_period_max,
+1 -1
kernel/sched/fair.c
··· 133 133 #endif 134 134 135 135 #ifdef CONFIG_SYSCTL 136 - static struct ctl_table sched_fair_sysctls[] = { 136 + static const struct ctl_table sched_fair_sysctls[] = { 137 137 #ifdef CONFIG_CFS_BANDWIDTH 138 138 { 139 139 .procname = "sched_cfs_bandwidth_slice_us",
+1 -1
kernel/sched/rt.c
··· 26 26 size_t *lenp, loff_t *ppos); 27 27 static int sched_rr_handler(const struct ctl_table *table, int write, void *buffer, 28 28 size_t *lenp, loff_t *ppos); 29 - static struct ctl_table sched_rt_sysctls[] = { 29 + static const struct ctl_table sched_rt_sysctls[] = { 30 30 { 31 31 .procname = "sched_rt_period_us", 32 32 .data = &sysctl_sched_rt_period,
+1 -1
kernel/sched/topology.c
··· 312 312 return ret; 313 313 } 314 314 315 - static struct ctl_table sched_energy_aware_sysctls[] = { 315 + static const struct ctl_table sched_energy_aware_sysctls[] = { 316 316 { 317 317 .procname = "sched_energy_aware", 318 318 .data = &sysctl_sched_energy_aware,
+1 -1
kernel/seccomp.c
··· 2450 2450 return ret; 2451 2451 } 2452 2452 2453 - static struct ctl_table seccomp_sysctl_table[] = { 2453 + static const struct ctl_table seccomp_sysctl_table[] = { 2454 2454 { 2455 2455 .procname = "actions_avail", 2456 2456 .data = (void *) &seccomp_actions_avail,
+1 -1
kernel/signal.c
··· 4950 4950 } 4951 4951 4952 4952 #if defined(CONFIG_SYSCTL) 4953 - static struct ctl_table signal_debug_table[] = { 4953 + static const struct ctl_table signal_debug_table[] = { 4954 4954 #ifdef CONFIG_SYSCTL_EXCEPTION_TRACE 4955 4955 { 4956 4956 .procname = "exception-trace",
+1 -1
kernel/stackleak.c
··· 45 45 str_enabled_disabled(state)); 46 46 return ret; 47 47 } 48 - static struct ctl_table stackleak_sysctls[] = { 48 + static const struct ctl_table stackleak_sysctls[] = { 49 49 { 50 50 .procname = "stack_erasing", 51 51 .data = NULL,
+3 -3
kernel/sysctl-test.c
··· 374 374 struct kunit *test) 375 375 { 376 376 unsigned char data = 0; 377 - struct ctl_table table_foo[] = { 377 + const struct ctl_table table_foo[] = { 378 378 { 379 379 .procname = "foo", 380 380 .data = &data, ··· 386 386 }, 387 387 }; 388 388 389 - struct ctl_table table_bar[] = { 389 + const struct ctl_table table_bar[] = { 390 390 { 391 391 .procname = "bar", 392 392 .data = &data, ··· 398 398 }, 399 399 }; 400 400 401 - struct ctl_table table_qux[] = { 401 + const struct ctl_table table_qux[] = { 402 402 { 403 403 .procname = "qux", 404 404 .data = &data,
+2 -2
kernel/sysctl.c
··· 1609 1609 return ret; 1610 1610 } 1611 1611 1612 - static struct ctl_table kern_table[] = { 1612 + static const struct ctl_table kern_table[] = { 1613 1613 { 1614 1614 .procname = "panic", 1615 1615 .data = &panic_timeout, ··· 2021 2021 #endif 2022 2022 }; 2023 2023 2024 - static struct ctl_table vm_table[] = { 2024 + static const struct ctl_table vm_table[] = { 2025 2025 { 2026 2026 .procname = "overcommit_memory", 2027 2027 .data = &sysctl_overcommit_memory,
+1 -1
kernel/time/timer.c
··· 301 301 return ret; 302 302 } 303 303 304 - static struct ctl_table timer_sysctl[] = { 304 + static const struct ctl_table timer_sysctl[] = { 305 305 { 306 306 .procname = "timer_migration", 307 307 .data = &sysctl_timer_migration,
+1 -1
kernel/trace/ftrace.c
··· 8780 8780 return 0; 8781 8781 } 8782 8782 8783 - static struct ctl_table ftrace_sysctls[] = { 8783 + static const struct ctl_table ftrace_sysctls[] = { 8784 8784 { 8785 8785 .procname = "ftrace_enabled", 8786 8786 .data = &ftrace_enabled,
+1 -1
kernel/trace/trace_events_user.c
··· 2899 2899 return ret; 2900 2900 } 2901 2901 2902 - static struct ctl_table user_event_sysctls[] = { 2902 + static const struct ctl_table user_event_sysctls[] = { 2903 2903 { 2904 2904 .procname = "user_events_max", 2905 2905 .data = &max_user_events,
+1 -1
kernel/umh.c
··· 544 544 return 0; 545 545 } 546 546 547 - static struct ctl_table usermodehelper_table[] = { 547 + static const struct ctl_table usermodehelper_table[] = { 548 548 { 549 549 .procname = "bset", 550 550 .data = &usermodehelper_bset,
+2 -2
kernel/utsname_sysctl.c
··· 75 75 static DEFINE_CTL_TABLE_POLL(domainname_poll); 76 76 77 77 // Note: update 'enum uts_proc' to match any changes to this table 78 - static struct ctl_table uts_kern_table[] = { 78 + static const struct ctl_table uts_kern_table[] = { 79 79 { 80 80 .procname = "arch", 81 81 .data = init_uts_ns.name.machine, ··· 129 129 */ 130 130 void uts_proc_notify(enum uts_proc proc) 131 131 { 132 - struct ctl_table *table = &uts_kern_table[proc]; 132 + const struct ctl_table *table = &uts_kern_table[proc]; 133 133 134 134 proc_sys_poll_notify(table->poll); 135 135 }
+1 -1
kernel/watchdog.c
··· 1094 1094 1095 1095 static const int sixty = 60; 1096 1096 1097 - static struct ctl_table watchdog_sysctls[] = { 1097 + static const struct ctl_table watchdog_sysctls[] = { 1098 1098 { 1099 1099 .procname = "watchdog", 1100 1100 .data = &watchdog_user_enabled,
+3 -3
lib/test_sysctl.c
··· 71 71 }; 72 72 73 73 /* These are all under /proc/sys/debug/test_sysctl/ */ 74 - static struct ctl_table test_table[] = { 74 + static const struct ctl_table test_table[] = { 75 75 { 76 76 .procname = "int_0001", 77 77 .data = &test_data.int_0001, ··· 177 177 } 178 178 179 179 /* Used to test that unregister actually removes the directory */ 180 - static struct ctl_table test_table_unregister[] = { 180 + static const struct ctl_table test_table_unregister[] = { 181 181 { 182 182 .procname = "unregister_error", 183 183 .data = &test_data.int_0001, ··· 220 220 return 0; 221 221 } 222 222 223 - static struct ctl_table test_table_empty[] = { }; 223 + static const struct ctl_table test_table_empty[] = { }; 224 224 225 225 static int test_sysctl_run_register_empty(void) 226 226 {
+1 -1
mm/compaction.c
··· 3272 3272 return ret; 3273 3273 } 3274 3274 3275 - static struct ctl_table vm_compaction[] = { 3275 + static const struct ctl_table vm_compaction[] = { 3276 3276 { 3277 3277 .procname = "compact_memory", 3278 3278 .data = &sysctl_compact_memory,
+1 -1
mm/hugetlb.c
··· 4867 4867 return ret; 4868 4868 } 4869 4869 4870 - static struct ctl_table hugetlb_table[] = { 4870 + static const struct ctl_table hugetlb_table[] = { 4871 4871 { 4872 4872 .procname = "nr_hugepages", 4873 4873 .data = NULL,
+1 -1
mm/hugetlb_vmemmap.c
··· 693 693 free_vmemmap_page_list(&vmemmap_pages); 694 694 } 695 695 696 - static struct ctl_table hugetlb_vmemmap_sysctls[] = { 696 + static const struct ctl_table hugetlb_vmemmap_sysctls[] = { 697 697 { 698 698 .procname = "hugetlb_optimize_vmemmap", 699 699 .data = &vmemmap_optimize_enabled,
+1 -1
mm/memory-failure.c
··· 124 124 .attrs = memory_failure_attr, 125 125 }; 126 126 127 - static struct ctl_table memory_failure_table[] = { 127 + static const struct ctl_table memory_failure_table[] = { 128 128 { 129 129 .procname = "memory_failure_early_kill", 130 130 .data = &sysctl_memory_failure_early_kill,
+1 -1
mm/oom_kill.c
··· 705 705 } 706 706 707 707 #ifdef CONFIG_SYSCTL 708 - static struct ctl_table vm_oom_kill_table[] = { 708 + static const struct ctl_table vm_oom_kill_table[] = { 709 709 { 710 710 .procname = "panic_on_oom", 711 711 .data = &sysctl_panic_on_oom,
+1 -1
mm/page-writeback.c
··· 2298 2298 /* this is needed for the proc_doulongvec_minmax of vm_dirty_bytes */ 2299 2299 static const unsigned long dirty_bytes_min = 2 * PAGE_SIZE; 2300 2300 2301 - static struct ctl_table vm_page_writeback_sysctls[] = { 2301 + static const struct ctl_table vm_page_writeback_sysctls[] = { 2302 2302 { 2303 2303 .procname = "dirty_background_ratio", 2304 2304 .data = &dirty_background_ratio,
+1 -1
mm/page_alloc.c
··· 6166 6166 return ret; 6167 6167 } 6168 6168 6169 - static struct ctl_table page_alloc_sysctl_table[] = { 6169 + static const struct ctl_table page_alloc_sysctl_table[] = { 6170 6170 { 6171 6171 .procname = "min_free_kbytes", 6172 6172 .data = &min_free_kbytes,
+1 -1
security/apparmor/lsm.c
··· 2038 2038 return proc_dointvec(table, write, buffer, lenp, ppos); 2039 2039 } 2040 2040 2041 - static struct ctl_table apparmor_sysctl_table[] = { 2041 + static const struct ctl_table apparmor_sysctl_table[] = { 2042 2042 #ifdef CONFIG_USER_NS 2043 2043 { 2044 2044 .procname = "unprivileged_userns_apparmor_policy",
+1 -1
security/keys/sysctl.c
··· 9 9 #include <linux/sysctl.h> 10 10 #include "internal.h" 11 11 12 - static struct ctl_table key_sysctls[] = { 12 + static const struct ctl_table key_sysctls[] = { 13 13 { 14 14 .procname = "maxkeys", 15 15 .data = &key_quota_maxkeys,
+1 -1
security/yama/yama_lsm.c
··· 452 452 453 453 static int max_scope = YAMA_SCOPE_NO_ATTACH; 454 454 455 - static struct ctl_table yama_sysctl_table[] = { 455 + static const struct ctl_table yama_sysctl_table[] = { 456 456 { 457 457 .procname = "ptrace_scope", 458 458 .data = &ptrace_scope,