History

sysctl: treewide: constify the ctl_table argument of proc_handlers

const qualify the struct ctl_table argument in the proc_handler function signatures. This is a prerequisite to moving the static ctl_table structs into .rodata data which will ensure that proc_handler function pointers cannot be modified. This patch has been generated by the following coccinelle script: ``` virtual patch @r1@ identifier ctl, write, buffer, lenp, ppos; identifier func !~ "appldata_(timer|interval)_handler|sched_(rt|rr)_handler|rds_tcp_skbuf_handler|proc_sctp_do_(hmac_alg|rto_min|rto_max|udp_port|alpha_beta|auth|probe_interval)"; @@ int func( - struct ctl_table *ctl + const struct ctl_table *ctl ,int write, void *buffer, size_t *lenp, loff_t *ppos); @r2@ identifier func, ctl, write, buffer, lenp, ppos; @@ int func( - struct ctl_table *ctl + const struct ctl_table *ctl ,int write, void *buffer, size_t *lenp, loff_t *ppos) { ... } @r3@ identifier func; @@ int func( - struct ctl_table * + const struct ctl_table * ,int , void *, size_t *, loff_t *); @r4@ identifier func, ctl; @@ int func( - struct ctl_table *ctl + const struct ctl_table *ctl ,int , void *, size_t *, loff_t *); @r5@ identifier func, write, buffer, lenp, ppos; @@ int func( - struct ctl_table * + const struct ctl_table * ,int write, void *buffer, size_t *lenp, loff_t *ppos); ``` * Code formatting was adjusted in xfs_sysctl.c to comply with code conventions. The xfs_stats_clear_proc_handler, xfs_panic_mask_proc_handler and xfs_deprecated_dointvec_minmax where adjusted. * The ctl_table argument in proc_watchdog_common was const qualified. This is called from a proc_handler itself and is calling back into another proc_handler, making it necessary to change it as part of the proc_handler migration.

Joel Granados committed 2 years ago

Commit 78eb4ea1 parent 7a3fad393 files · +258 −258Browse files

Unified · Split

93 files
  1. arch/arm64/kernel/armv8_deprecated.c +1 −1
  2. arch/arm64/kernel/fpsimd.c +1 −1
  3. arch/s390/appldata/appldata_base.c +5 −5
  4. arch/s390/kernel/debug.c +1 −1
  5. arch/s390/kernel/topology.c +1 −1
  6. arch/s390/mm/cmm.c +3 −3
  7. arch/x86/kernel/itmt.c +1 −1
  8. drivers/cdrom/cdrom.c +2 −2
  9. drivers/char/random.c +2 −2
  10. drivers/macintosh/mac_hid.c +1 −1
  11. drivers/net/vrf.c +1 −1
  12. drivers/parport/procfs.c +6 −6
  13. drivers/perf/arm_pmuv3.c +1 −1
  14. drivers/perf/riscv_pmu_sbi.c +1 −1
  15. fs/coredump.c +1 −1
  16. fs/dcache.c +1 −1
  17. fs/drop_caches.c +1 −1
  18. fs/exec.c +1 −1
  19. fs/file_table.c +1 −1
  20. fs/fs-writeback.c +1 −1
  21. fs/inode.c +1 −1
  22. fs/pipe.c +1 −1
  23. fs/quota/dquot.c +1 −1
  24. fs/xfs/xfs_sysctl.c +3 −3
  25. include/linux/ftrace.h +2 −2
  26. include/linux/mm.h +4 −4
  27. include/linux/perf_event.h +3 −3
  28. include/linux/security.h +1 −1
  29. include/linux/sysctl.h +17 −17
  30. include/linux/vmstat.h +2 −2
  31. include/linux/writeback.h +1 −1
  32. include/net/ndisc.h +1 −1
  33. include/net/neighbour.h +3 −3
  34. include/net/netfilter/nf_hooks_lwtunnel.h +1 −1
  35. ipc/ipc_sysctl.c +3 −3
  36. kernel/bpf/syscall.c +2 −2
  37. kernel/delayacct.c +1 −1
  38. kernel/events/callchain.c +1 −1
  39. kernel/events/core.c +2 −2
  40. kernel/fork.c +1 −1
  41. kernel/hung_task.c +1 −1
  42. kernel/kexec_core.c +1 −1
  43. kernel/kprobes.c +1 −1
  44. kernel/latencytop.c +1 −1
  45. kernel/pid_namespace.c +1 −1
  46. kernel/pid_sysctl.h +1 −1
  47. kernel/printk/internal.h +1 −1
  48. kernel/printk/printk.c +1 −1
  49. kernel/printk/sysctl.c +1 −1
  50. kernel/sched/core.c +3 −3
  51. kernel/sched/rt.c +4 −4
  52. kernel/sched/topology.c +1 −1
  53. kernel/seccomp.c +1 −1
  54. kernel/stackleak.c +1 −1
  55. kernel/sysctl.c +32 −32
  56. kernel/time/timer.c +1 −1
  57. kernel/trace/ftrace.c +1 −1
  58. kernel/trace/trace.c +1 −1
  59. kernel/trace/trace_events_user.c +1 −1
  60. kernel/trace/trace_stack.c +1 −1
  61. kernel/umh.c +1 −1
  62. kernel/utsname_sysctl.c +1 −1
  63. kernel/watchdog.c +6 −6
  64. mm/compaction.c +3 −3
  65. mm/hugetlb.c +3 −3
  66. mm/page-writeback.c +5 −5
  67. mm/page_alloc.c +7 −7
  68. mm/util.c +3 −3
  69. mm/vmstat.c +2 −2
  70. net/bridge/br_netfilter_hooks.c +1 −1
  71. net/core/neighbour.c +9 −9
  72. net/core/sysctl_net_core.c +10 −10
  73. net/ipv4/devinet.c +3 −3
  74. net/ipv4/route.c +1 −1
  75. net/ipv4/sysctl_net_ipv4.c +15 −15
  76. net/ipv6/addrconf.c +8 −8
  77. net/ipv6/ndisc.c +1 −1
  78. net/ipv6/route.c +1 −1
  79. net/ipv6/sysctl_net_ipv6.c +2 −2
  80. net/mpls/af_mpls.c +2 −2
  81. net/mptcp/ctrl.c +2 −2
  82. net/netfilter/ipvs/ip_vs_ctl.c +6 −6
  83. net/netfilter/nf_conntrack_standalone.c +1 −1
  84. net/netfilter/nf_hooks_lwtunnel.c +1 −1
  85. net/netfilter/nf_log.c +1 −1
  86. net/phonet/sysctl.c +1 −1
  87. net/rds/tcp.c +2 −2
  88. net/sctp/sysctl.c +14 −14
  89. net/sunrpc/sysctl.c +2 −2
  90. net/sunrpc/xprtrdma/svc_rdma.c +1 −1
  91. security/apparmor/lsm.c +1 −1
  92. security/min_addr.c +1 −1
  93. security/yama/yama_lsm.c +1 −1
arch/arm64/kernel/armv8_deprecated.c+1−1
@@ -507,7 +507,7 @@ static int update_insn_emulation_mode(struct insn_emulation *insn, · 506 unmodified lines
507 return ret;507 return ret;
508}508}
509 509
510static int emulation_proc_handler(struct ctl_table *table, int write,510static int emulation_proc_handler(const struct ctl_table *table, int write,
511 void *buffer, size_t *lenp,511 void *buffer, size_t *lenp,
512 loff_t *ppos)512 loff_t *ppos)
513{513{
arch/arm64/kernel/fpsimd.c+1−1
@@ -535,7 +535,7 @@ static unsigned int find_supported_vector_length(enum vec_type type, · 534 unmodified lines
535 535
536#if defined(CONFIG_ARM64_SVE) && defined(CONFIG_SYSCTL)536#if defined(CONFIG_ARM64_SVE) && defined(CONFIG_SYSCTL)
537 537
538static int vec_proc_do_default_vl(struct ctl_table *table, int write,538static int vec_proc_do_default_vl(const struct ctl_table *table, int write,
539 void *buffer, size_t *lenp, loff_t *ppos)539 void *buffer, size_t *lenp, loff_t *ppos)
540{540{
541 struct vl_info *info = table->extra1;541 struct vl_info *info = table->extra1;
arch/s390/appldata/appldata_base.c+5−5
@@ -46,9 +46,9 @@ · 45 unmodified lines
46 * /proc entries (sysctl)46 * /proc entries (sysctl)
47 */47 */
48static const char appldata_proc_name[APPLDATA_PROC_NAME_LENGTH] = "appldata";48static const char appldata_proc_name[APPLDATA_PROC_NAME_LENGTH] = "appldata";
49static int appldata_timer_handler(struct ctl_table *ctl, int write,49static int appldata_timer_handler(const struct ctl_table *ctl, int write,
50 void *buffer, size_t *lenp, loff_t *ppos);50 void *buffer, size_t *lenp, loff_t *ppos);
51static int appldata_interval_handler(struct ctl_table *ctl, int write,51static int appldata_interval_handler(const struct ctl_table *ctl, int write,
52 void *buffer, size_t *lenp, loff_t *ppos);52 void *buffer, size_t *lenp, loff_t *ppos);
53 53
54static struct ctl_table_header *appldata_sysctl_header;54static struct ctl_table_header *appldata_sysctl_header;
@@ -199,7 +199,7 @@ static void __appldata_vtimer_setup(int cmd) · 144 unmodified lines
199 * Start/Stop timer, show status of timer (0 = not active, 1 = active)199 * Start/Stop timer, show status of timer (0 = not active, 1 = active)
200 */200 */
201static int201static int
202appldata_timer_handler(struct ctl_table *ctl, int write,202appldata_timer_handler(const struct ctl_table *ctl, int write,
203 void *buffer, size_t *lenp, loff_t *ppos)203 void *buffer, size_t *lenp, loff_t *ppos)
204{204{
205 int timer_active = appldata_timer_active;205 int timer_active = appldata_timer_active;
@@ -232,7 +232,7 @@ appldata_timer_handler(struct ctl_table *ctl, int write, · 26 unmodified lines
232 * current timer interval.232 * current timer interval.
233 */233 */
234static int234static int
235appldata_interval_handler(struct ctl_table *ctl, int write,235appldata_interval_handler(const struct ctl_table *ctl, int write,
236 void *buffer, size_t *lenp, loff_t *ppos)236 void *buffer, size_t *lenp, loff_t *ppos)
237{237{
238 int interval = appldata_interval;238 int interval = appldata_interval;
@@ -262,7 +262,7 @@ appldata_interval_handler(struct ctl_table *ctl, int write, · 23 unmodified lines
262 * monitoring (0 = not in process, 1 = in process)262 * monitoring (0 = not in process, 1 = in process)
263 */263 */
264static int264static int
265appldata_generic_handler(struct ctl_table *ctl, int write,265appldata_generic_handler(const struct ctl_table *ctl, int write,
266 void *buffer, size_t *lenp, loff_t *ppos)266 void *buffer, size_t *lenp, loff_t *ppos)
267{267{
268 struct appldata_ops *ops = NULL, *tmp_ops;268 struct appldata_ops *ops = NULL, *tmp_ops;
arch/s390/kernel/debug.c+1−1
@@ -954,7 +954,7 @@ static int debug_active = 1; · 953 unmodified lines
954 * always allow read, allow write only if debug_stoppable is set or954 * always allow read, allow write only if debug_stoppable is set or
955 * if debug_active is already off955 * if debug_active is already off
956 */956 */
957static int s390dbf_procactive(struct ctl_table *table, int write,957static int s390dbf_procactive(const struct ctl_table *table, int write,
958 void *buffer, size_t *lenp, loff_t *ppos)958 void *buffer, size_t *lenp, loff_t *ppos)
959{959{
960 if (!write || debug_stoppable || !debug_active)960 if (!write || debug_stoppable || !debug_active)
arch/s390/kernel/topology.c+1−1
@@ -594,7 +594,7 @@ static int __init topology_setup(char *str) · 593 unmodified lines
594}594}
595early_param("topology", topology_setup);595early_param("topology", topology_setup);
596 596
597static int topology_ctl_handler(struct ctl_table *ctl, int write,597static int topology_ctl_handler(const struct ctl_table *ctl, int write,
598 void *buffer, size_t *lenp, loff_t *ppos)598 void *buffer, size_t *lenp, loff_t *ppos)
599{599{
600 int enabled = topology_is_enabled();600 int enabled = topology_is_enabled();
arch/s390/mm/cmm.c+3−3
@@ -243,7 +243,7 @@ static int cmm_skip_blanks(char *cp, char **endp) · 242 unmodified lines
243 return str != cp;243 return str != cp;
244}244}
245 245
246static int cmm_pages_handler(struct ctl_table *ctl, int write,246static int cmm_pages_handler(const struct ctl_table *ctl, int write,
247 void *buffer, size_t *lenp, loff_t *ppos)247 void *buffer, size_t *lenp, loff_t *ppos)
248{248{
249 long nr = cmm_get_pages();249 long nr = cmm_get_pages();
@@ -262,7 +262,7 @@ static int cmm_pages_handler(struct ctl_table *ctl, int write, · 12 unmodified lines
262 return 0;262 return 0;
263}263}
264 264
265static int cmm_timed_pages_handler(struct ctl_table *ctl, int write,265static int cmm_timed_pages_handler(const struct ctl_table *ctl, int write,
266 void *buffer, size_t *lenp,266 void *buffer, size_t *lenp,
267 loff_t *ppos)267 loff_t *ppos)
268{268{
@@ -282,7 +282,7 @@ static int cmm_timed_pages_handler(struct ctl_table *ctl, int write, · 13 unmodified lines
282 return 0;282 return 0;
283}283}
284 284
285static int cmm_timeout_handler(struct ctl_table *ctl, int write,285static int cmm_timeout_handler(const struct ctl_table *ctl, int write,
286 void *buffer, size_t *lenp, loff_t *ppos)286 void *buffer, size_t *lenp, loff_t *ppos)
287{287{
288 char buf[64], *p;288 char buf[64], *p;
arch/x86/kernel/itmt.c+1−1
@@ -38,7 +38,7 @@ static bool __read_mostly sched_itmt_capable; · 37 unmodified lines
38 */38 */
39unsigned int __read_mostly sysctl_sched_itmt_enabled;39unsigned int __read_mostly sysctl_sched_itmt_enabled;
40 40
41static int sched_itmt_update_handler(struct ctl_table *table, int write,41static int sched_itmt_update_handler(const struct ctl_table *table, int write,
42 void *buffer, size_t *lenp, loff_t *ppos)42 void *buffer, size_t *lenp, loff_t *ppos)
43{43{
44 unsigned int old_sysctl;44 unsigned int old_sysctl;
drivers/cdrom/cdrom.c+2−2
@@ -3473,7 +3473,7 @@ static int cdrom_print_info(const char *header, int val, char *info, · 3472 unmodified lines
3473 return 0;3473 return 0;
3474}3474}
3475 3475
3476static int cdrom_sysctl_info(struct ctl_table *ctl, int write,3476static int cdrom_sysctl_info(const struct ctl_table *ctl, int write,
3477 void *buffer, size_t *lenp, loff_t *ppos)3477 void *buffer, size_t *lenp, loff_t *ppos)
3478{3478{
3479 int pos;3479 int pos;
@@ -3586,7 +3586,7 @@ static void cdrom_update_settings(void) · 106 unmodified lines
3586 mutex_unlock(&cdrom_mutex);3586 mutex_unlock(&cdrom_mutex);
3587}3587}
3588 3588
3589static int cdrom_sysctl_handler(struct ctl_table *ctl, int write,3589static int cdrom_sysctl_handler(const struct ctl_table *ctl, int write,
3590 void *buffer, size_t *lenp, loff_t *ppos)3590 void *buffer, size_t *lenp, loff_t *ppos)
3591{3591{
3592 int ret;3592 int ret;
drivers/char/random.c+2−2
@@ -1620,7 +1620,7 @@ static u8 sysctl_bootid[UUID_SIZE]; · 1619 unmodified lines
1620 * UUID. The difference is in whether table->data is NULL; if it is,1620 * UUID. The difference is in whether table->data is NULL; if it is,
1621 * then a new UUID is generated and returned to the user.1621 * then a new UUID is generated and returned to the user.
1622 */1622 */
1623static int proc_do_uuid(struct ctl_table *table, int write, void *buf,1623static int proc_do_uuid(const struct ctl_table *table, int write, void *buf,
1624 size_t *lenp, loff_t *ppos)1624 size_t *lenp, loff_t *ppos)
1625{1625{
1626 u8 tmp_uuid[UUID_SIZE], *uuid;1626 u8 tmp_uuid[UUID_SIZE], *uuid;
@@ -1651,7 +1651,7 @@ static int proc_do_uuid(struct ctl_table *table, int write, void *buf, · 24 unmodified lines
1651}1651}
1652 1652
1653/* The same as proc_dointvec, but writes don't change anything. */1653/* The same as proc_dointvec, but writes don't change anything. */
1654static int proc_do_rointvec(struct ctl_table *table, int write, void *buf,1654static int proc_do_rointvec(const struct ctl_table *table, int write, void *buf,
1655 size_t *lenp, loff_t *ppos)1655 size_t *lenp, loff_t *ppos)
1656{1656{
1657 return write ? 0 : proc_dointvec(table, 0, buf, lenp, ppos);1657 return write ? 0 : proc_dointvec(table, 0, buf, lenp, ppos);
drivers/macintosh/mac_hid.c+1−1
@@ -183,7 +183,7 @@ static void mac_hid_stop_emulation(void) · 182 unmodified lines
183 mac_hid_destroy_emumouse();183 mac_hid_destroy_emumouse();
184}184}
185 185
186static int mac_hid_toggle_emumouse(struct ctl_table *table, int write,186static int mac_hid_toggle_emumouse(const struct ctl_table *table, int write,
187 void *buffer, size_t *lenp, loff_t *ppos)187 void *buffer, size_t *lenp, loff_t *ppos)
188{188{
189 int *valp = table->data;189 int *valp = table->data;
drivers/net/vrf.c+1−1
@@ -1886,7 +1886,7 @@ unlock: · 1885 unmodified lines
1886 return res;1886 return res;
1887}1887}
1888 1888
1889static int vrf_shared_table_handler(struct ctl_table *table, int write,1889static int vrf_shared_table_handler(const struct ctl_table *table, int write,
1890 void *buffer, size_t *lenp, loff_t *ppos)1890 void *buffer, size_t *lenp, loff_t *ppos)
1891{1891{
1892 struct net *net = (struct net *)table->extra1;1892 struct net *net = (struct net *)table->extra1;
drivers/parport/procfs.c+6−6
@@ -33,7 +33,7 @@ · 32 unmodified lines
33#define PARPORT_MIN_SPINTIME_VALUE 133#define PARPORT_MIN_SPINTIME_VALUE 1
34#define PARPORT_MAX_SPINTIME_VALUE 100034#define PARPORT_MAX_SPINTIME_VALUE 1000
35 35
36static int do_active_device(struct ctl_table *table, int write,36static int do_active_device(const struct ctl_table *table, int write,
37 void *result, size_t *lenp, loff_t *ppos)37 void *result, size_t *lenp, loff_t *ppos)
38{38{
39 struct parport *port = (struct parport *)table->extra1;39 struct parport *port = (struct parport *)table->extra1;
@@ -70,7 +70,7 @@ static int do_active_device(struct ctl_table *table, int write, · 30 unmodified lines
70}70}
71 71
72#ifdef CONFIG_PARPORT_128472#ifdef CONFIG_PARPORT_1284
73static int do_autoprobe(struct ctl_table *table, int write,73static int do_autoprobe(const struct ctl_table *table, int write,
74 void *result, size_t *lenp, loff_t *ppos)74 void *result, size_t *lenp, loff_t *ppos)
75{75{
76 struct parport_device_info *info = table->extra2;76 struct parport_device_info *info = table->extra2;
@@ -113,7 +113,7 @@ static int do_autoprobe(struct ctl_table *table, int write, · 36 unmodified lines
113}113}
114#endif /* IEEE1284.3 support. */114#endif /* IEEE1284.3 support. */
115 115
116static int do_hardware_base_addr(struct ctl_table *table, int write,116static int do_hardware_base_addr(const struct ctl_table *table, int write,
117 void *result, size_t *lenp, loff_t *ppos)117 void *result, size_t *lenp, loff_t *ppos)
118{118{
119 struct parport *port = (struct parport *)table->extra1;119 struct parport *port = (struct parport *)table->extra1;
@@ -140,7 +140,7 @@ static int do_hardware_base_addr(struct ctl_table *table, int write, · 20 unmodified lines
140 return 0;140 return 0;
141}141}
142 142
143static int do_hardware_irq(struct ctl_table *table, int write,143static int do_hardware_irq(const struct ctl_table *table, int write,
144 void *result, size_t *lenp, loff_t *ppos)144 void *result, size_t *lenp, loff_t *ppos)
145{145{
146 struct parport *port = (struct parport *)table->extra1;146 struct parport *port = (struct parport *)table->extra1;
@@ -167,7 +167,7 @@ static int do_hardware_irq(struct ctl_table *table, int write, · 20 unmodified lines
167 return 0;167 return 0;
168}168}
169 169
170static int do_hardware_dma(struct ctl_table *table, int write,170static int do_hardware_dma(const struct ctl_table *table, int write,
171 void *result, size_t *lenp, loff_t *ppos)171 void *result, size_t *lenp, loff_t *ppos)
172{172{
173 struct parport *port = (struct parport *)table->extra1;173 struct parport *port = (struct parport *)table->extra1;
@@ -194,7 +194,7 @@ static int do_hardware_dma(struct ctl_table *table, int write, · 20 unmodified lines
194 return 0;194 return 0;
195}195}
196 196
197static int do_hardware_modes(struct ctl_table *table, int write,197static int do_hardware_modes(const struct ctl_table *table, int write,
198 void *result, size_t *lenp, loff_t *ppos)198 void *result, size_t *lenp, loff_t *ppos)
199{199{
200 struct parport *port = (struct parport *)table->extra1;200 struct parport *port = (struct parport *)table->extra1;
drivers/perf/arm_pmuv3.c+1−1
@@ -1257,7 +1257,7 @@ static void armv8pmu_disable_user_access_ipi(void *unused) · 1256 unmodified lines
1257 armv8pmu_disable_user_access();1257 armv8pmu_disable_user_access();
1258}1258}
1259 1259
1260static int armv8pmu_proc_user_access_handler(struct ctl_table *table, int write,1260static int armv8pmu_proc_user_access_handler(const struct ctl_table *table, int write,
1261 void *buffer, size_t *lenp, loff_t *ppos)1261 void *buffer, size_t *lenp, loff_t *ppos)
1262{1262{
1263 int ret = proc_dointvec_minmax(table, write, buffer, lenp, ppos);1263 int ret = proc_dointvec_minmax(table, write, buffer, lenp, ppos);
drivers/perf/riscv_pmu_sbi.c+1−1
@@ -1277,7 +1277,7 @@ static void riscv_pmu_update_counter_access(void *info) · 1276 unmodified lines
1277 csr_write(CSR_SCOUNTEREN, 0x2);1277 csr_write(CSR_SCOUNTEREN, 0x2);
1278}1278}
1279 1279
1280static int riscv_pmu_proc_user_access_handler(struct ctl_table *table,1280static int riscv_pmu_proc_user_access_handler(const struct ctl_table *table,
1281 int write, void *buffer,1281 int write, void *buffer,
1282 size_t *lenp, loff_t *ppos)1282 size_t *lenp, loff_t *ppos)
1283{1283{
fs/coredump.c+1−1
@@ -991,7 +991,7 @@ void validate_coredump_safety(void) · 990 unmodified lines
991 }991 }
992}992}
993 993
994static int proc_dostring_coredump(struct ctl_table *table, int write,994static int proc_dostring_coredump(const struct ctl_table *table, int write,
995 void *buffer, size_t *lenp, loff_t *ppos)995 void *buffer, size_t *lenp, loff_t *ppos)
996{996{
997 int error = proc_dostring(table, write, buffer, lenp, ppos);997 int error = proc_dostring(table, write, buffer, lenp, ppos);
fs/dcache.c+1−1
@@ -177,7 +177,7 @@ static long get_nr_dentry_negative(void) · 176 unmodified lines
177 return sum < 0 ? 0 : sum;177 return sum < 0 ? 0 : sum;
178}178}
179 179
180static int proc_nr_dentry(struct ctl_table *table, int write, void *buffer,180static int proc_nr_dentry(const struct ctl_table *table, int write, void *buffer,
181 size_t *lenp, loff_t *ppos)181 size_t *lenp, loff_t *ppos)
182{182{
183 dentry_stat.nr_dentry = get_nr_dentry();183 dentry_stat.nr_dentry = get_nr_dentry();
fs/drop_caches.c+1−1
@@ -48,7 +48,7 @@ static void drop_pagecache_sb(struct super_block *sb, void *unused) · 47 unmodified lines
48 iput(toput_inode);48 iput(toput_inode);
49}49}
50 50
51int drop_caches_sysctl_handler(struct ctl_table *table, int write,51int drop_caches_sysctl_handler(const struct ctl_table *table, int write,
52 void *buffer, size_t *length, loff_t *ppos)52 void *buffer, size_t *length, loff_t *ppos)
53{53{
54 int ret;54 int ret;
fs/exec.c+1−1
@@ -2204,7 +2204,7 @@ COMPAT_SYSCALL_DEFINE5(execveat, int, fd, · 2203 unmodified lines
2204 2204
2205#ifdef CONFIG_SYSCTL2205#ifdef CONFIG_SYSCTL
2206 2206
2207static int proc_dointvec_minmax_coredump(struct ctl_table *table, int write,2207static int proc_dointvec_minmax_coredump(const struct ctl_table *table, int write,
2208 void *buffer, size_t *lenp, loff_t *ppos)2208 void *buffer, size_t *lenp, loff_t *ppos)
2209{2209{
2210 int error = proc_dointvec_minmax(table, write, buffer, lenp, ppos);2210 int error = proc_dointvec_minmax(table, write, buffer, lenp, ppos);
fs/file_table.c+1−1
@@ -96,7 +96,7 @@ EXPORT_SYMBOL_GPL(get_max_files); · 95 unmodified lines
96/*96/*
97 * Handle nr_files sysctl97 * Handle nr_files sysctl
98 */98 */
99static int proc_nr_files(struct ctl_table *table, int write, void *buffer,99static int proc_nr_files(const struct ctl_table *table, int write, void *buffer,
100 size_t *lenp, loff_t *ppos)100 size_t *lenp, loff_t *ppos)
101{101{
102 files_stat.nr_files = get_nr_files();102 files_stat.nr_files = get_nr_files();
fs/fs-writeback.c+1−1
@@ -2413,7 +2413,7 @@ static int __init start_dirtytime_writeback(void) · 2412 unmodified lines
2413}2413}
2414__initcall(start_dirtytime_writeback);2414__initcall(start_dirtytime_writeback);
2415 2415
2416int dirtytime_interval_handler(struct ctl_table *table, int write,2416int dirtytime_interval_handler(const struct ctl_table *table, int write,
2417 void *buffer, size_t *lenp, loff_t *ppos)2417 void *buffer, size_t *lenp, loff_t *ppos)
2418{2418{
2419 int ret;2419 int ret;
fs/inode.c+1−1
@@ -107,7 +107,7 @@ long get_nr_dirty_inodes(void) · 106 unmodified lines
107 */107 */
108static struct inodes_stat_t inodes_stat;108static struct inodes_stat_t inodes_stat;
109 109
110static int proc_nr_inodes(struct ctl_table *table, int write, void *buffer,110static int proc_nr_inodes(const struct ctl_table *table, int write, void *buffer,
111 size_t *lenp, loff_t *ppos)111 size_t *lenp, loff_t *ppos)
112{112{
113 inodes_stat.nr_inodes = get_nr_inodes();113 inodes_stat.nr_inodes = get_nr_inodes();
fs/pipe.c+1−1
@@ -1469,7 +1469,7 @@ static int do_proc_dopipe_max_size_conv(unsigned long *lvalp, · 1468 unmodified lines
1469 return 0;1469 return 0;
1470}1470}
1471 1471
1472static int proc_dopipe_max_size(struct ctl_table *table, int write,1472static int proc_dopipe_max_size(const struct ctl_table *table, int write,
1473 void *buffer, size_t *lenp, loff_t *ppos)1473 void *buffer, size_t *lenp, loff_t *ppos)
1474{1474{
1475 return do_proc_douintvec(table, write, buffer, lenp, ppos,1475 return do_proc_douintvec(table, write, buffer, lenp, ppos,
fs/quota/dquot.c+1−1
@@ -2913,7 +2913,7 @@ const struct quotactl_ops dquot_quotactl_sysfile_ops = { · 2912 unmodified lines
2913};2913};
2914EXPORT_SYMBOL(dquot_quotactl_sysfile_ops);2914EXPORT_SYMBOL(dquot_quotactl_sysfile_ops);
2915 2915
2916static int do_proc_dqstats(struct ctl_table *table, int write,2916static int do_proc_dqstats(const struct ctl_table *table, int write,
2917 void *buffer, size_t *lenp, loff_t *ppos)2917 void *buffer, size_t *lenp, loff_t *ppos)
2918{2918{
2919 unsigned int type = (unsigned long *)table->data - dqstats.stat;2919 unsigned int type = (unsigned long *)table->data - dqstats.stat;
fs/xfs/xfs_sysctl.c+3−3
@@ -11,7 +11,7 @@ static struct ctl_table_header *xfs_table_header; · 10 unmodified lines
11#ifdef CONFIG_PROC_FS11#ifdef CONFIG_PROC_FS
12STATIC int12STATIC int
13xfs_stats_clear_proc_handler(13xfs_stats_clear_proc_handler(
14 struct ctl_table *ctl,14 const struct ctl_table *ctl,
15 int write,15 int write,
16 void *buffer,16 void *buffer,
17 size_t *lenp,17 size_t *lenp,
@@ -31,7 +31,7 @@ xfs_stats_clear_proc_handler( · 13 unmodified lines
31 31
32STATIC int32STATIC int
33xfs_panic_mask_proc_handler(33xfs_panic_mask_proc_handler(
34 struct ctl_table *ctl,34 const struct ctl_table *ctl,
35 int write,35 int write,
36 void *buffer,36 void *buffer,
37 size_t *lenp,37 size_t *lenp,
@@ -52,7 +52,7 @@ xfs_panic_mask_proc_handler( · 14 unmodified lines
52 52
53STATIC int53STATIC int
54xfs_deprecated_dointvec_minmax(54xfs_deprecated_dointvec_minmax(
55 struct ctl_table *ctl,55 const struct ctl_table *ctl,
56 int write,56 int write,
57 void *buffer,57 void *buffer,
58 size_t *lenp,58 size_t *lenp,
include/linux/ftrace.h+2−2
@@ -471,7 +471,7 @@ static inline void arch_ftrace_set_direct_caller(struct ftrace_regs *fregs, · 470 unmodified lines
471 471
472extern int stack_tracer_enabled;472extern int stack_tracer_enabled;
473 473
474int stack_trace_sysctl(struct ctl_table *table, int write, void *buffer,474int stack_trace_sysctl(const struct ctl_table *table, int write, void *buffer,
475 size_t *lenp, loff_t *ppos);475 size_t *lenp, loff_t *ppos);
476 476
477/* DO NOT MODIFY THIS VARIABLE DIRECTLY! */477/* DO NOT MODIFY THIS VARIABLE DIRECTLY! */
@@ -1175,7 +1175,7 @@ extern int tracepoint_printk; · 697 unmodified lines
1175extern void disable_trace_on_warning(void);1175extern void disable_trace_on_warning(void);
1176extern int __disable_trace_on_warning;1176extern int __disable_trace_on_warning;
1177 1177
1178int tracepoint_printk_sysctl(struct ctl_table *table, int write,1178int tracepoint_printk_sysctl(const struct ctl_table *table, int write,
1179 void *buffer, size_t *lenp, loff_t *ppos);1179 void *buffer, size_t *lenp, loff_t *ppos);
1180 1180
1181#else /* CONFIG_TRACING */1181#else /* CONFIG_TRACING */
include/linux/mm.h+4−4
@@ -204,11 +204,11 @@ extern int sysctl_overcommit_memory; · 203 unmodified lines
204extern int sysctl_overcommit_ratio;204extern int sysctl_overcommit_ratio;
205extern unsigned long sysctl_overcommit_kbytes;205extern unsigned long sysctl_overcommit_kbytes;
206 206
207int overcommit_ratio_handler(struct ctl_table *, int, void *, size_t *,207int overcommit_ratio_handler(const struct ctl_table *, int, void *, size_t *,
208 loff_t *);208 loff_t *);
209int overcommit_kbytes_handler(struct ctl_table *, int, void *, size_t *,209int overcommit_kbytes_handler(const struct ctl_table *, int, void *, size_t *,
210 loff_t *);210 loff_t *);
211int overcommit_policy_handler(struct ctl_table *, int, void *, size_t *,211int overcommit_policy_handler(const struct ctl_table *, int, void *, size_t *,
212 loff_t *);212 loff_t *);
213 213
214#if defined(CONFIG_SPARSEMEM) && !defined(CONFIG_SPARSEMEM_VMEMMAP)214#if defined(CONFIG_SPARSEMEM) && !defined(CONFIG_SPARSEMEM_VMEMMAP)
@@ -3854,7 +3854,7 @@ extern bool process_shares_mm(struct task_struct *p, struct mm_struct *mm); · 3639 unmodified lines
3854 3854
3855#ifdef CONFIG_SYSCTL3855#ifdef CONFIG_SYSCTL
3856extern int sysctl_drop_caches;3856extern int sysctl_drop_caches;
3857int drop_caches_sysctl_handler(struct ctl_table *, int, void *, size_t *,3857int drop_caches_sysctl_handler(const struct ctl_table *, int, void *, size_t *,
3858 loff_t *);3858 loff_t *);
3859#endif3859#endif
3860 3860
include/linux/perf_event.h+3−3
@@ -1582,11 +1582,11 @@ extern int sysctl_perf_cpu_time_max_percent; · 1581 unmodified lines
1582 1582
1583extern void perf_sample_event_took(u64 sample_len_ns);1583extern void perf_sample_event_took(u64 sample_len_ns);
1584 1584
1585int perf_event_max_sample_rate_handler(struct ctl_table *table, int write,1585int perf_event_max_sample_rate_handler(const struct ctl_table *table, int write,
1586 void *buffer, size_t *lenp, loff_t *ppos);1586 void *buffer, size_t *lenp, loff_t *ppos);
1587int perf_cpu_time_max_percent_handler(struct ctl_table *table, int write,1587int perf_cpu_time_max_percent_handler(const struct ctl_table *table, int write,
1588 void *buffer, size_t *lenp, loff_t *ppos);1588 void *buffer, size_t *lenp, loff_t *ppos);
1589int perf_event_max_stack_handler(struct ctl_table *table, int write,1589int perf_event_max_stack_handler(const struct ctl_table *table, int write,
1590 void *buffer, size_t *lenp, loff_t *ppos);1590 void *buffer, size_t *lenp, loff_t *ppos);
1591 1591
1592/* Access to perf_event_open(2) syscall. */1592/* Access to perf_event_open(2) syscall. */
include/linux/security.h+1−1
@@ -228,7 +228,7 @@ struct request_sock; · 227 unmodified lines
228#define LSM_UNSAFE_NO_NEW_PRIVS 4228#define LSM_UNSAFE_NO_NEW_PRIVS 4
229 229
230#ifdef CONFIG_MMU230#ifdef CONFIG_MMU
231extern int mmap_min_addr_handler(struct ctl_table *table, int write,231extern int mmap_min_addr_handler(const struct ctl_table *table, int write,
232 void *buffer, size_t *lenp, loff_t *ppos);232 void *buffer, size_t *lenp, loff_t *ppos);
233#endif233#endif
234 234
include/linux/sysctl.h+17−17
@@ -61,31 +61,31 @@ extern const int sysctl_vals[]; · 60 unmodified lines
61 61
62extern const unsigned long sysctl_long_vals[];62extern const unsigned long sysctl_long_vals[];
63 63
64typedef int proc_handler(struct ctl_table *ctl, int write, void *buffer,64typedef int proc_handler(const struct ctl_table *ctl, int write, void *buffer,
65 size_t *lenp, loff_t *ppos);65 size_t *lenp, loff_t *ppos);
66 66
67int proc_dostring(struct ctl_table *, int, void *, size_t *, loff_t *);67int proc_dostring(const struct ctl_table *, int, void *, size_t *, loff_t *);
68int proc_dobool(struct ctl_table *table, int write, void *buffer,68int proc_dobool(const struct ctl_table *table, int write, void *buffer,
69 size_t *lenp, loff_t *ppos);69 size_t *lenp, loff_t *ppos);
70int proc_dointvec(struct ctl_table *, int, void *, size_t *, loff_t *);70int proc_dointvec(const struct ctl_table *, int, void *, size_t *, loff_t *);
71int proc_douintvec(struct ctl_table *, int, void *, size_t *, loff_t *);71int proc_douintvec(const struct ctl_table *, int, void *, size_t *, loff_t *);
72int proc_dointvec_minmax(struct ctl_table *, int, void *, size_t *, loff_t *);72int proc_dointvec_minmax(const struct ctl_table *, int, void *, size_t *, loff_t *);
73int proc_douintvec_minmax(struct ctl_table *table, int write, void *buffer,73int proc_douintvec_minmax(const struct ctl_table *table, int write, void *buffer,
74 size_t *lenp, loff_t *ppos);74 size_t *lenp, loff_t *ppos);
75int proc_dou8vec_minmax(struct ctl_table *table, int write, void *buffer,75int proc_dou8vec_minmax(const struct ctl_table *table, int write, void *buffer,
76 size_t *lenp, loff_t *ppos);76 size_t *lenp, loff_t *ppos);
77int proc_dointvec_jiffies(struct ctl_table *, int, void *, size_t *, loff_t *);77int proc_dointvec_jiffies(const struct ctl_table *, int, void *, size_t *, loff_t *);
78int proc_dointvec_ms_jiffies_minmax(struct ctl_table *table, int write,78int proc_dointvec_ms_jiffies_minmax(const struct ctl_table *table, int write,
79 void *buffer, size_t *lenp, loff_t *ppos);79 void *buffer, size_t *lenp, loff_t *ppos);
80int proc_dointvec_userhz_jiffies(struct ctl_table *, int, void *, size_t *,80int proc_dointvec_userhz_jiffies(const struct ctl_table *, int, void *, size_t *,
81 loff_t *);81 loff_t *);
82int proc_dointvec_ms_jiffies(struct ctl_table *, int, void *, size_t *,82int proc_dointvec_ms_jiffies(const struct ctl_table *, int, void *, size_t *,
83 loff_t *);83 loff_t *);
84int proc_doulongvec_minmax(struct ctl_table *, int, void *, size_t *, loff_t *);84int proc_doulongvec_minmax(const struct ctl_table *, int, void *, size_t *, loff_t *);
85int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int, void *,85int proc_doulongvec_ms_jiffies_minmax(const struct ctl_table *table, int, void *,
86 size_t *, loff_t *);86 size_t *, loff_t *);
87int proc_do_large_bitmap(struct ctl_table *, int, void *, size_t *, loff_t *);87int proc_do_large_bitmap(const struct ctl_table *, int, void *, size_t *, loff_t *);
88int proc_do_static_key(struct ctl_table *table, int write, void *buffer,88int proc_do_static_key(const struct ctl_table *table, int write, void *buffer,
89 size_t *lenp, loff_t *ppos);89 size_t *lenp, loff_t *ppos);
90 90
91/*91/*
@@ -287,7 +287,7 @@ static inline bool sysctl_is_alias(char *param) · 195 unmodified lines
287}287}
288#endif /* CONFIG_SYSCTL */288#endif /* CONFIG_SYSCTL */
289 289
290int sysctl_max_threads(struct ctl_table *table, int write, void *buffer,290int sysctl_max_threads(const struct ctl_table *table, int write, void *buffer,
291 size_t *lenp, loff_t *ppos);291 size_t *lenp, loff_t *ppos);
292 292
293#endif /* _LINUX_SYSCTL_H */293#endif /* _LINUX_SYSCTL_H */
include/linux/vmstat.h+2−2
@@ -17,7 +17,7 @@ extern int sysctl_stat_interval; · 16 unmodified lines
17#define DISABLE_NUMA_STAT 017#define DISABLE_NUMA_STAT 0
18extern int sysctl_vm_numa_stat;18extern int sysctl_vm_numa_stat;
19DECLARE_STATIC_KEY_TRUE(vm_numa_stat_key);19DECLARE_STATIC_KEY_TRUE(vm_numa_stat_key);
20int sysctl_vm_numa_stat_handler(struct ctl_table *table, int write,20int sysctl_vm_numa_stat_handler(const struct ctl_table *table, int write,
21 void *buffer, size_t *length, loff_t *ppos);21 void *buffer, size_t *length, loff_t *ppos);
22#endif22#endif
23 23
@@ -301,7 +301,7 @@ void cpu_vm_stats_fold(int cpu); · 277 unmodified lines
301void refresh_zone_stat_thresholds(void);301void refresh_zone_stat_thresholds(void);
302 302
303struct ctl_table;303struct ctl_table;
304int vmstat_refresh(struct ctl_table *, int write, void *buffer, size_t *lenp,304int vmstat_refresh(const struct ctl_table *, int write, void *buffer, size_t *lenp,
305 loff_t *ppos);305 loff_t *ppos);
306 306
307void drain_zonestat(struct zone *zone, struct per_cpu_zonestat *);307void drain_zonestat(struct zone *zone, struct per_cpu_zonestat *);
include/linux/writeback.h+1−1
@@ -350,7 +350,7 @@ extern unsigned int dirty_expire_interval; · 349 unmodified lines
350extern unsigned int dirtytime_expire_interval;350extern unsigned int dirtytime_expire_interval;
351extern int laptop_mode;351extern int laptop_mode;
352 352
353int dirtytime_interval_handler(struct ctl_table *table, int write,353int dirtytime_interval_handler(const struct ctl_table *table, int write,
354 void *buffer, size_t *lenp, loff_t *ppos);354 void *buffer, size_t *lenp, loff_t *ppos);
355 355
356void global_dirty_limits(unsigned long *pbackground, unsigned long *pdirty);356void global_dirty_limits(unsigned long *pbackground, unsigned long *pdirty);
include/net/ndisc.h+1−1
@@ -486,7 +486,7 @@ void igmp6_event_report(struct sk_buff *skb); · 485 unmodified lines
486 486
487 487
488#ifdef CONFIG_SYSCTL488#ifdef CONFIG_SYSCTL
489int ndisc_ifinfo_sysctl_change(struct ctl_table *ctl, int write,489int ndisc_ifinfo_sysctl_change(const struct ctl_table *ctl, int write,
490 void *buffer, size_t *lenp, loff_t *ppos);490 void *buffer, size_t *lenp, loff_t *ppos);
491#endif491#endif
492 492
include/net/neighbour.h+3−3
@@ -412,12 +412,12 @@ void *neigh_seq_start(struct seq_file *, loff_t *, struct neigh_table *, · 411 unmodified lines
412void *neigh_seq_next(struct seq_file *, void *, loff_t *);412void *neigh_seq_next(struct seq_file *, void *, loff_t *);
413void neigh_seq_stop(struct seq_file *, void *);413void neigh_seq_stop(struct seq_file *, void *);
414 414
415int neigh_proc_dointvec(struct ctl_table *ctl, int write,415int neigh_proc_dointvec(const struct ctl_table *ctl, int write,
416 void *buffer, size_t *lenp, loff_t *ppos);416 void *buffer, size_t *lenp, loff_t *ppos);
417int neigh_proc_dointvec_jiffies(struct ctl_table *ctl, int write,417int neigh_proc_dointvec_jiffies(const struct ctl_table *ctl, int write,
418 void *buffer,418 void *buffer,
419 size_t *lenp, loff_t *ppos);419 size_t *lenp, loff_t *ppos);
420int neigh_proc_dointvec_ms_jiffies(struct ctl_table *ctl, int write,420int neigh_proc_dointvec_ms_jiffies(const struct ctl_table *ctl, int write,
421 void *buffer, size_t *lenp, loff_t *ppos);421 void *buffer, size_t *lenp, loff_t *ppos);
422 422
423int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p,423int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p,
include/net/netfilter/nf_hooks_lwtunnel.h+1−1
@@ -2,6 +2,6 @@ · 1 unmodified line
2#include <linux/types.h>2#include <linux/types.h>
3 3
4#ifdef CONFIG_SYSCTL4#ifdef CONFIG_SYSCTL
5int nf_hooks_lwtunnel_sysctl_handler(struct ctl_table *table, int write,5int nf_hooks_lwtunnel_sysctl_handler(const struct ctl_table *table, int write,
6 void *buffer, size_t *lenp, loff_t *ppos);6 void *buffer, size_t *lenp, loff_t *ppos);
7#endif7#endif
ipc/ipc_sysctl.c+3−3
@@ -17,7 +17,7 @@ · 16 unmodified lines
17#include <linux/cred.h>17#include <linux/cred.h>
18#include "util.h"18#include "util.h"
19 19
20static int proc_ipc_dointvec_minmax_orphans(struct ctl_table *table, int write,20static int proc_ipc_dointvec_minmax_orphans(const struct ctl_table *table, int write,
21 void *buffer, size_t *lenp, loff_t *ppos)21 void *buffer, size_t *lenp, loff_t *ppos)
22{22{
23 struct ipc_namespace *ns =23 struct ipc_namespace *ns =
@@ -33,7 +33,7 @@ static int proc_ipc_dointvec_minmax_orphans(struct ctl_table *table, int write, · 9 unmodified lines
33 return err;33 return err;
34}34}
35 35
36static int proc_ipc_auto_msgmni(struct ctl_table *table, int write,36static int proc_ipc_auto_msgmni(const struct ctl_table *table, int write,
37 void *buffer, size_t *lenp, loff_t *ppos)37 void *buffer, size_t *lenp, loff_t *ppos)
38{38{
39 struct ctl_table ipc_table;39 struct ctl_table ipc_table;
@@ -48,7 +48,7 @@ static int proc_ipc_auto_msgmni(struct ctl_table *table, int write, · 8 unmodified lines
48 return proc_dointvec_minmax(&ipc_table, write, buffer, lenp, ppos);48 return proc_dointvec_minmax(&ipc_table, write, buffer, lenp, ppos);
49}49}
50 50
51static int proc_ipc_sem_dointvec(struct ctl_table *table, int write,51static int proc_ipc_sem_dointvec(const struct ctl_table *table, int write,
52 void *buffer, size_t *lenp, loff_t *ppos)52 void *buffer, size_t *lenp, loff_t *ppos)
53{53{
54 struct ipc_namespace *ns =54 struct ipc_namespace *ns =
kernel/bpf/syscall.c+2−2
@@ -5983,7 +5983,7 @@ const struct bpf_prog_ops bpf_syscall_prog_ops = { · 5982 unmodified lines
5983};5983};
5984 5984
5985#ifdef CONFIG_SYSCTL5985#ifdef CONFIG_SYSCTL
5986static int bpf_stats_handler(struct ctl_table *table, int write,5986static int bpf_stats_handler(const struct ctl_table *table, int write,
5987 void *buffer, size_t *lenp, loff_t *ppos)5987 void *buffer, size_t *lenp, loff_t *ppos)
5988{5988{
5989 struct static_key *key = (struct static_key *)table->data;5989 struct static_key *key = (struct static_key *)table->data;
@@ -6018,7 +6018,7 @@ void __weak unpriv_ebpf_notify(int new_state) · 28 unmodified lines
6018{6018{
6019}6019}
6020 6020
6021static int bpf_unpriv_handler(struct ctl_table *table, int write,6021static int bpf_unpriv_handler(const struct ctl_table *table, int write,
6022 void *buffer, size_t *lenp, loff_t *ppos)6022 void *buffer, size_t *lenp, loff_t *ppos)
6023{6023{
6024 int ret, unpriv_enable = *(int *)table->data;6024 int ret, unpriv_enable = *(int *)table->data;
kernel/delayacct.c+1−1
@@ -44,7 +44,7 @@ void delayacct_init(void) · 43 unmodified lines
44}44}
45 45
46#ifdef CONFIG_PROC_SYSCTL46#ifdef CONFIG_PROC_SYSCTL
47static int sysctl_delayacct(struct ctl_table *table, int write, void *buffer,47static int sysctl_delayacct(const struct ctl_table *table, int write, void *buffer,
48 size_t *lenp, loff_t *ppos)48 size_t *lenp, loff_t *ppos)
49{49{
50 int state = delayacct_on;50 int state = delayacct_on;
kernel/events/callchain.c+1−1
@@ -270,7 +270,7 @@ exit_put: · 269 unmodified lines
270 * Used for sysctl_perf_event_max_stack and270 * Used for sysctl_perf_event_max_stack and
271 * sysctl_perf_event_max_contexts_per_stack.271 * sysctl_perf_event_max_contexts_per_stack.
272 */272 */
273int perf_event_max_stack_handler(struct ctl_table *table, int write,273int perf_event_max_stack_handler(const struct ctl_table *table, int write,
274 void *buffer, size_t *lenp, loff_t *ppos)274 void *buffer, size_t *lenp, loff_t *ppos)
275{275{
276 int *value = table->data;276 int *value = table->data;
kernel/events/core.c+2−2
@@ -450,7 +450,7 @@ static void update_perf_cpu_limits(void) · 449 unmodified lines
450 450
451static bool perf_rotate_context(struct perf_cpu_pmu_context *cpc);451static bool perf_rotate_context(struct perf_cpu_pmu_context *cpc);
452 452
453int perf_event_max_sample_rate_handler(struct ctl_table *table, int write,453int perf_event_max_sample_rate_handler(const struct ctl_table *table, int write,
454 void *buffer, size_t *lenp, loff_t *ppos)454 void *buffer, size_t *lenp, loff_t *ppos)
455{455{
456 int ret;456 int ret;
@@ -474,7 +474,7 @@ int perf_event_max_sample_rate_handler(struct ctl_table *table, int write, · 17 unmodified lines
474 474
475int sysctl_perf_cpu_time_max_percent __read_mostly = DEFAULT_CPU_TIME_MAX_PERCENT;475int sysctl_perf_cpu_time_max_percent __read_mostly = DEFAULT_CPU_TIME_MAX_PERCENT;
476 476
477int perf_cpu_time_max_percent_handler(struct ctl_table *table, int write,477int perf_cpu_time_max_percent_handler(const struct ctl_table *table, int write,
478 void *buffer, size_t *lenp, loff_t *ppos)478 void *buffer, size_t *lenp, loff_t *ppos)
479{479{
480 int ret = proc_dointvec_minmax(table, write, buffer, lenp, ppos);480 int ret = proc_dointvec_minmax(table, write, buffer, lenp, ppos);
kernel/fork.c+1−1
@@ -3404,7 +3404,7 @@ int unshare_files(void) · 3403 unmodified lines
3404 return 0;3404 return 0;
3405}3405}
3406 3406
3407int sysctl_max_threads(struct ctl_table *table, int write,3407int sysctl_max_threads(const struct ctl_table *table, int write,
3408 void *buffer, size_t *lenp, loff_t *ppos)3408 void *buffer, size_t *lenp, loff_t *ppos)
3409{3409{
3410 struct ctl_table t;3410 struct ctl_table t;
kernel/hung_task.c+1−1
@@ -239,7 +239,7 @@ static long hung_timeout_jiffies(unsigned long last_checked, · 238 unmodified lines
239/*239/*
240 * Process updating of timeout sysctl240 * Process updating of timeout sysctl
241 */241 */
242static int proc_dohung_task_timeout_secs(struct ctl_table *table, int write,242static int proc_dohung_task_timeout_secs(const struct ctl_table *table, int write,
243 void *buffer,243 void *buffer,
244 size_t *lenp, loff_t *ppos)244 size_t *lenp, loff_t *ppos)
245{245{
kernel/kexec_core.c+1−1
@@ -888,7 +888,7 @@ struct kimage *kexec_crash_image; · 887 unmodified lines
888static int kexec_load_disabled;888static int kexec_load_disabled;
889 889
890#ifdef CONFIG_SYSCTL890#ifdef CONFIG_SYSCTL
891static int kexec_limit_handler(struct ctl_table *table, int write,891static int kexec_limit_handler(const struct ctl_table *table, int write,
892 void *buffer, size_t *lenp, loff_t *ppos)892 void *buffer, size_t *lenp, loff_t *ppos)
893{893{
894 struct kexec_load_limit *limit = table->data;894 struct kexec_load_limit *limit = table->data;
kernel/kprobes.c+1−1
@@ -939,7 +939,7 @@ static void unoptimize_all_kprobes(void) · 938 unmodified lines
939 939
940static DEFINE_MUTEX(kprobe_sysctl_mutex);940static DEFINE_MUTEX(kprobe_sysctl_mutex);
941static int sysctl_kprobes_optimization;941static int sysctl_kprobes_optimization;
942static int proc_kprobes_optimization_handler(struct ctl_table *table,942static int proc_kprobes_optimization_handler(const struct ctl_table *table,
943 int write, void *buffer,943 int write, void *buffer,
944 size_t *length, loff_t *ppos)944 size_t *length, loff_t *ppos)
945{945{
kernel/latencytop.c+1−1
@@ -65,7 +65,7 @@ static struct latency_record latency_record[MAXLR]; · 64 unmodified lines
65int latencytop_enabled;65int latencytop_enabled;
66 66
67#ifdef CONFIG_SYSCTL67#ifdef CONFIG_SYSCTL
68static int sysctl_latencytop(struct ctl_table *table, int write, void *buffer,68static int sysctl_latencytop(const struct ctl_table *table, int write, void *buffer,
69 size_t *lenp, loff_t *ppos)69 size_t *lenp, loff_t *ppos)
70{70{
71 int err;71 int err;
kernel/pid_namespace.c+1−1
@@ -261,7 +261,7 @@ void zap_pid_ns_processes(struct pid_namespace *pid_ns) · 260 unmodified lines
261}261}
262 262
263#ifdef CONFIG_CHECKPOINT_RESTORE263#ifdef CONFIG_CHECKPOINT_RESTORE
264static int pid_ns_ctl_handler(struct ctl_table *table, int write,264static int pid_ns_ctl_handler(const struct ctl_table *table, int write,
265 void *buffer, size_t *lenp, loff_t *ppos)265 void *buffer, size_t *lenp, loff_t *ppos)
266{266{
267 struct pid_namespace *pid_ns = task_active_pid_ns(current);267 struct pid_namespace *pid_ns = task_active_pid_ns(current);
kernel/pid_sysctl.h+1−1
@@ -5,7 +5,7 @@ · 4 unmodified lines
5#include <linux/pid_namespace.h>5#include <linux/pid_namespace.h>
6 6
7#if defined(CONFIG_SYSCTL) && defined(CONFIG_MEMFD_CREATE)7#if defined(CONFIG_SYSCTL) && defined(CONFIG_MEMFD_CREATE)
8static int pid_mfd_noexec_dointvec_minmax(struct ctl_table *table,8static int pid_mfd_noexec_dointvec_minmax(const struct ctl_table *table,
9 int write, void *buf, size_t *lenp, loff_t *ppos)9 int write, void *buf, size_t *lenp, loff_t *ppos)
10{10{
11 struct pid_namespace *ns = task_active_pid_ns(current);11 struct pid_namespace *ns = task_active_pid_ns(current);
kernel/printk/internal.h+1−1
@@ -8,7 +8,7 @@ · 7 unmodified lines
8 8
9#if defined(CONFIG_PRINTK) && defined(CONFIG_SYSCTL)9#if defined(CONFIG_PRINTK) && defined(CONFIG_SYSCTL)
10void __init printk_sysctl_init(void);10void __init printk_sysctl_init(void);
11int devkmsg_sysctl_set_loglvl(struct ctl_table *table, int write,11int devkmsg_sysctl_set_loglvl(const struct ctl_table *table, int write,
12 void *buffer, size_t *lenp, loff_t *ppos);12 void *buffer, size_t *lenp, loff_t *ppos);
13#else13#else
14#define printk_sysctl_init() do { } while (0)14#define printk_sysctl_init() do { } while (0)
kernel/printk/printk.c+1−1
@@ -197,7 +197,7 @@ __setup("printk.devkmsg=", control_devkmsg); · 196 unmodified lines
197 197
198char devkmsg_log_str[DEVKMSG_STR_MAX_SIZE] = "ratelimit";198char devkmsg_log_str[DEVKMSG_STR_MAX_SIZE] = "ratelimit";
199#if defined(CONFIG_PRINTK) && defined(CONFIG_SYSCTL)199#if defined(CONFIG_PRINTK) && defined(CONFIG_SYSCTL)
200int devkmsg_sysctl_set_loglvl(struct ctl_table *table, int write,200int devkmsg_sysctl_set_loglvl(const struct ctl_table *table, int write,
201 void *buffer, size_t *lenp, loff_t *ppos)201 void *buffer, size_t *lenp, loff_t *ppos)
202{202{
203 char old_str[DEVKMSG_STR_MAX_SIZE];203 char old_str[DEVKMSG_STR_MAX_SIZE];
kernel/printk/sysctl.c+1−1
@@ -11,7 +11,7 @@ · 10 unmodified lines
11 11
12static const int ten_thousand = 10000;12static const int ten_thousand = 10000;
13 13
14static int proc_dointvec_minmax_sysadmin(struct ctl_table *table, int write,14static int proc_dointvec_minmax_sysadmin(const struct ctl_table *table, int write,
15 void *buffer, size_t *lenp, loff_t *ppos)15 void *buffer, size_t *lenp, loff_t *ppos)
16{16{
17 if (write && !capable(CAP_SYS_ADMIN))17 if (write && !capable(CAP_SYS_ADMIN))
kernel/sched/core.c+3−3
@@ -1806,7 +1806,7 @@ static void uclamp_sync_util_min_rt_default(void) · 1805 unmodified lines
1806 uclamp_update_util_min_rt_default(p);1806 uclamp_update_util_min_rt_default(p);
1807}1807}
1808 1808
1809static int sysctl_sched_uclamp_handler(struct ctl_table *table, int write,1809static int sysctl_sched_uclamp_handler(const struct ctl_table *table, int write,
1810 void *buffer, size_t *lenp, loff_t *ppos)1810 void *buffer, size_t *lenp, loff_t *ppos)
1811{1811{
1812 bool update_root_tg = false;1812 bool update_root_tg = false;
@@ -4392,7 +4392,7 @@ static void reset_memory_tiering(void) · 2579 unmodified lines
4392 }4392 }
4393}4393}
4394 4394
4395static int sysctl_numa_balancing(struct ctl_table *table, int write,4395static int sysctl_numa_balancing(const struct ctl_table *table, int write,
4396 void *buffer, size_t *lenp, loff_t *ppos)4396 void *buffer, size_t *lenp, loff_t *ppos)
4397{4397{
4398 struct ctl_table t;4398 struct ctl_table t;
@@ -4461,7 +4461,7 @@ out: · 62 unmodified lines
4461__setup("schedstats=", setup_schedstats);4461__setup("schedstats=", setup_schedstats);
4462 4462
4463#ifdef CONFIG_PROC_SYSCTL4463#ifdef CONFIG_PROC_SYSCTL
4464static int sysctl_schedstats(struct ctl_table *table, int write, void *buffer,4464static int sysctl_schedstats(const struct ctl_table *table, int write, void *buffer,
4465 size_t *lenp, loff_t *ppos)4465 size_t *lenp, loff_t *ppos)
4466{4466{
4467 struct ctl_table t;4467 struct ctl_table t;
kernel/sched/rt.c+4−4
@@ -26,9 +26,9 @@ int sysctl_sched_rt_runtime = 950000; · 25 unmodified lines
26 26
27#ifdef CONFIG_SYSCTL27#ifdef CONFIG_SYSCTL
28static int sysctl_sched_rr_timeslice = (MSEC_PER_SEC * RR_TIMESLICE) / HZ;28static int sysctl_sched_rr_timeslice = (MSEC_PER_SEC * RR_TIMESLICE) / HZ;
29static int sched_rt_handler(struct ctl_table *table, int write, void *buffer,29static int sched_rt_handler(const struct ctl_table *table, int write, void *buffer,
30 size_t *lenp, loff_t *ppos);30 size_t *lenp, loff_t *ppos);
31static int sched_rr_handler(struct ctl_table *table, int write, void *buffer,31static int sched_rr_handler(const struct ctl_table *table, int write, void *buffer,
32 size_t *lenp, loff_t *ppos);32 size_t *lenp, loff_t *ppos);
33static struct ctl_table sched_rt_sysctls[] = {33static struct ctl_table sched_rt_sysctls[] = {
34 {34 {
@@ -2952,7 +2952,7 @@ static void sched_rt_do_global(void) · 2917 unmodified lines
2952 raw_spin_unlock_irqrestore(&def_rt_bandwidth.rt_runtime_lock, flags);2952 raw_spin_unlock_irqrestore(&def_rt_bandwidth.rt_runtime_lock, flags);
2953}2953}
2954 2954
2955static int sched_rt_handler(struct ctl_table *table, int write, void *buffer,2955static int sched_rt_handler(const struct ctl_table *table, int write, void *buffer,
2956 size_t *lenp, loff_t *ppos)2956 size_t *lenp, loff_t *ppos)
2957{2957{
2958 int old_period, old_runtime;2958 int old_period, old_runtime;
@@ -2991,7 +2991,7 @@ undo: · 32 unmodified lines
2991 return ret;2991 return ret;
2992}2992}
2993 2993
2994static int sched_rr_handler(struct ctl_table *table, int write, void *buffer,2994static int sched_rr_handler(const struct ctl_table *table, int write, void *buffer,
2995 size_t *lenp, loff_t *ppos)2995 size_t *lenp, loff_t *ppos)
2996{2996{
2997 int ret;2997 int ret;
kernel/sched/topology.c+1−1
@@ -285,7 +285,7 @@ void rebuild_sched_domains_energy(void) · 284 unmodified lines
285}285}
286 286
287#ifdef CONFIG_PROC_SYSCTL287#ifdef CONFIG_PROC_SYSCTL
288static int sched_energy_aware_handler(struct ctl_table *table, int write,288static int sched_energy_aware_handler(const struct ctl_table *table, int write,
289 void *buffer, size_t *lenp, loff_t *ppos)289 void *buffer, size_t *lenp, loff_t *ppos)
290{290{
291 int ret, state;291 int ret, state;
kernel/seccomp.c+1−1
@@ -2431,7 +2431,7 @@ static void audit_actions_logged(u32 actions_logged, u32 old_actions_logged, · 2430 unmodified lines
2431 return audit_seccomp_actions_logged(new, old, !ret);2431 return audit_seccomp_actions_logged(new, old, !ret);
2432}2432}
2433 2433
2434static int seccomp_actions_logged_handler(struct ctl_table *ro_table, int write,2434static int seccomp_actions_logged_handler(const struct ctl_table *ro_table, int write,
2435 void *buffer, size_t *lenp,2435 void *buffer, size_t *lenp,
2436 loff_t *ppos)2436 loff_t *ppos)
2437{2437{
kernel/stackleak.c+1−1
@@ -21,7 +21,7 @@ · 20 unmodified lines
21static DEFINE_STATIC_KEY_FALSE(stack_erasing_bypass);21static DEFINE_STATIC_KEY_FALSE(stack_erasing_bypass);
22 22
23#ifdef CONFIG_SYSCTL23#ifdef CONFIG_SYSCTL
24static int stack_erasing_sysctl(struct ctl_table *table, int write,24static int stack_erasing_sysctl(const struct ctl_table *table, int write,
25 void __user *buffer, size_t *lenp, loff_t *ppos)25 void __user *buffer, size_t *lenp, loff_t *ppos)
26{26{
27 int ret = 0;27 int ret = 0;
kernel/sysctl.c+32−32
@@ -256,7 +256,7 @@ static bool proc_first_pos_non_zero_ignore(loff_t *ppos, · 255 unmodified lines
256 *256 *
257 * Returns 0 on success.257 * Returns 0 on success.
258 */258 */
259int proc_dostring(struct ctl_table *table, int write,259int proc_dostring(const struct ctl_table *table, int write,
260 void *buffer, size_t *lenp, loff_t *ppos)260 void *buffer, size_t *lenp, loff_t *ppos)
261{261{
262 if (write)262 if (write)
@@ -702,7 +702,7 @@ int do_proc_douintvec(const struct ctl_table *table, int write, · 439 unmodified lines
702 *702 *
703 * Returns 0 on success.703 * Returns 0 on success.
704 */704 */
705int proc_dobool(struct ctl_table *table, int write, void *buffer,705int proc_dobool(const struct ctl_table *table, int write, void *buffer,
706 size_t *lenp, loff_t *ppos)706 size_t *lenp, loff_t *ppos)
707{707{
708 struct ctl_table tmp;708 struct ctl_table tmp;
@@ -739,7 +739,7 @@ int proc_dobool(struct ctl_table *table, int write, void *buffer, · 30 unmodified lines
739 *739 *
740 * Returns 0 on success.740 * Returns 0 on success.
741 */741 */
742int proc_dointvec(struct ctl_table *table, int write, void *buffer,742int proc_dointvec(const struct ctl_table *table, int write, void *buffer,
743 size_t *lenp, loff_t *ppos)743 size_t *lenp, loff_t *ppos)
744{744{
745 return do_proc_dointvec(table, write, buffer, lenp, ppos, NULL, NULL);745 return do_proc_dointvec(table, write, buffer, lenp, ppos, NULL, NULL);
@@ -758,7 +758,7 @@ int proc_dointvec(struct ctl_table *table, int write, void *buffer, · 12 unmodified lines
758 *758 *
759 * Returns 0 on success.759 * Returns 0 on success.
760 */760 */
761int proc_douintvec(struct ctl_table *table, int write, void *buffer,761int proc_douintvec(const struct ctl_table *table, int write, void *buffer,
762 size_t *lenp, loff_t *ppos)762 size_t *lenp, loff_t *ppos)
763{763{
764 return do_proc_douintvec(table, write, buffer, lenp, ppos,764 return do_proc_douintvec(table, write, buffer, lenp, ppos,
@@ -769,7 +769,7 @@ int proc_douintvec(struct ctl_table *table, int write, void *buffer, · 4 unmodified lines
769 * Taint values can only be increased769 * Taint values can only be increased
770 * This means we can safely use a temporary.770 * This means we can safely use a temporary.
771 */771 */
772static int proc_taint(struct ctl_table *table, int write,772static int proc_taint(const struct ctl_table *table, int write,
773 void *buffer, size_t *lenp, loff_t *ppos)773 void *buffer, size_t *lenp, loff_t *ppos)
774{774{
775 struct ctl_table t;775 struct ctl_table t;
@@ -864,7 +864,7 @@ static int do_proc_dointvec_minmax_conv(bool *negp, unsigned long *lvalp, · 88 unmodified lines
864 *864 *
865 * Returns 0 on success or -EINVAL on write when the range check fails.865 * Returns 0 on success or -EINVAL on write when the range check fails.
866 */866 */
867int proc_dointvec_minmax(struct ctl_table *table, int write,867int proc_dointvec_minmax(const struct ctl_table *table, int write,
868 void *buffer, size_t *lenp, loff_t *ppos)868 void *buffer, size_t *lenp, loff_t *ppos)
869{869{
870 struct do_proc_dointvec_minmax_conv_param param = {870 struct do_proc_dointvec_minmax_conv_param param = {
@@ -933,7 +933,7 @@ static int do_proc_douintvec_minmax_conv(unsigned long *lvalp, · 62 unmodified lines
933 *933 *
934 * Returns 0 on success or -ERANGE on write when the range check fails.934 * Returns 0 on success or -ERANGE on write when the range check fails.
935 */935 */
936int proc_douintvec_minmax(struct ctl_table *table, int write,936int proc_douintvec_minmax(const struct ctl_table *table, int write,
937 void *buffer, size_t *lenp, loff_t *ppos)937 void *buffer, size_t *lenp, loff_t *ppos)
938{938{
939 struct do_proc_douintvec_minmax_conv_param param = {939 struct do_proc_douintvec_minmax_conv_param param = {
@@ -961,7 +961,7 @@ int proc_douintvec_minmax(struct ctl_table *table, int write, · 21 unmodified lines
961 *961 *
962 * Returns 0 on success or an error on write when the range check fails.962 * Returns 0 on success or an error on write when the range check fails.
963 */963 */
964int proc_dou8vec_minmax(struct ctl_table *table, int write,964int proc_dou8vec_minmax(const struct ctl_table *table, int write,
965 void *buffer, size_t *lenp, loff_t *ppos)965 void *buffer, size_t *lenp, loff_t *ppos)
966{966{
967 struct ctl_table tmp;967 struct ctl_table tmp;
@@ -998,7 +998,7 @@ int proc_dou8vec_minmax(struct ctl_table *table, int write, · 30 unmodified lines
998EXPORT_SYMBOL_GPL(proc_dou8vec_minmax);998EXPORT_SYMBOL_GPL(proc_dou8vec_minmax);
999 999
1000#ifdef CONFIG_MAGIC_SYSRQ1000#ifdef CONFIG_MAGIC_SYSRQ
1001static int sysrq_sysctl_handler(struct ctl_table *table, int write,1001static int sysrq_sysctl_handler(const struct ctl_table *table, int write,
1002 void *buffer, size_t *lenp, loff_t *ppos)1002 void *buffer, size_t *lenp, loff_t *ppos)
1003{1003{
1004 int tmp, ret;1004 int tmp, ret;
@@ -1115,7 +1115,7 @@ static int do_proc_doulongvec_minmax(const struct ctl_table *table, int write, · 110 unmodified lines
1115 *1115 *
1116 * Returns 0 on success.1116 * Returns 0 on success.
1117 */1117 */
1118int proc_doulongvec_minmax(struct ctl_table *table, int write,1118int proc_doulongvec_minmax(const struct ctl_table *table, int write,
1119 void *buffer, size_t *lenp, loff_t *ppos)1119 void *buffer, size_t *lenp, loff_t *ppos)
1120{1120{
1121 return do_proc_doulongvec_minmax(table, write, buffer, lenp, ppos, 1l, 1l);1121 return do_proc_doulongvec_minmax(table, write, buffer, lenp, ppos, 1l, 1l);
@@ -1138,7 +1138,7 @@ int proc_doulongvec_minmax(struct ctl_table *table, int write, · 16 unmodified lines
1138 *1138 *
1139 * Returns 0 on success.1139 * Returns 0 on success.
1140 */1140 */
1141int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int write,1141int proc_doulongvec_ms_jiffies_minmax(const struct ctl_table *table, int write,
1142 void *buffer, size_t *lenp, loff_t *ppos)1142 void *buffer, size_t *lenp, loff_t *ppos)
1143{1143{
1144 return do_proc_doulongvec_minmax(table, write, buffer,1144 return do_proc_doulongvec_minmax(table, write, buffer,
@@ -1259,14 +1259,14 @@ static int do_proc_dointvec_ms_jiffies_minmax_conv(bool *negp, unsigned long *lv · 114 unmodified lines
1259 *1259 *
1260 * Returns 0 on success.1260 * Returns 0 on success.
1261 */1261 */
1262int proc_dointvec_jiffies(struct ctl_table *table, int write,1262int proc_dointvec_jiffies(const struct ctl_table *table, int write,
1263 void *buffer, size_t *lenp, loff_t *ppos)1263 void *buffer, size_t *lenp, loff_t *ppos)
1264{1264{
1265 return do_proc_dointvec(table,write,buffer,lenp,ppos,1265 return do_proc_dointvec(table,write,buffer,lenp,ppos,
1266 do_proc_dointvec_jiffies_conv,NULL);1266 do_proc_dointvec_jiffies_conv,NULL);
1267}1267}
1268 1268
1269int proc_dointvec_ms_jiffies_minmax(struct ctl_table *table, int write,1269int proc_dointvec_ms_jiffies_minmax(const struct ctl_table *table, int write,
1270 void *buffer, size_t *lenp, loff_t *ppos)1270 void *buffer, size_t *lenp, loff_t *ppos)
1271{1271{
1272 struct do_proc_dointvec_minmax_conv_param param = {1272 struct do_proc_dointvec_minmax_conv_param param = {
@@ -1292,7 +1292,7 @@ int proc_dointvec_ms_jiffies_minmax(struct ctl_table *table, int write, · 19 unmodified lines
1292 *1292 *
1293 * Returns 0 on success.1293 * Returns 0 on success.
1294 */1294 */
1295int proc_dointvec_userhz_jiffies(struct ctl_table *table, int write,1295int proc_dointvec_userhz_jiffies(const struct ctl_table *table, int write,
1296 void *buffer, size_t *lenp, loff_t *ppos)1296 void *buffer, size_t *lenp, loff_t *ppos)
1297{1297{
1298 return do_proc_dointvec(table, write, buffer, lenp, ppos,1298 return do_proc_dointvec(table, write, buffer, lenp, ppos,
@@ -1315,14 +1315,14 @@ int proc_dointvec_userhz_jiffies(struct ctl_table *table, int write, · 16 unmodified lines
1315 *1315 *
1316 * Returns 0 on success.1316 * Returns 0 on success.
1317 */1317 */
1318int proc_dointvec_ms_jiffies(struct ctl_table *table, int write, void *buffer,1318int proc_dointvec_ms_jiffies(const struct ctl_table *table, int write, void *buffer,
1319 size_t *lenp, loff_t *ppos)1319 size_t *lenp, loff_t *ppos)
1320{1320{
1321 return do_proc_dointvec(table, write, buffer, lenp, ppos,1321 return do_proc_dointvec(table, write, buffer, lenp, ppos,
1322 do_proc_dointvec_ms_jiffies_conv, NULL);1322 do_proc_dointvec_ms_jiffies_conv, NULL);
1323}1323}
1324 1324
1325static int proc_do_cad_pid(struct ctl_table *table, int write, void *buffer,1325static int proc_do_cad_pid(const struct ctl_table *table, int write, void *buffer,
1326 size_t *lenp, loff_t *ppos)1326 size_t *lenp, loff_t *ppos)
1327{1327{
1328 struct pid *new_pid;1328 struct pid *new_pid;
@@ -1361,7 +1361,7 @@ static int proc_do_cad_pid(struct ctl_table *table, int write, void *buffer, · 32 unmodified lines
1361 *1361 *
1362 * Returns 0 on success.1362 * Returns 0 on success.
1363 */1363 */
1364int proc_do_large_bitmap(struct ctl_table *table, int write,1364int proc_do_large_bitmap(const struct ctl_table *table, int write,
1365 void *buffer, size_t *lenp, loff_t *ppos)1365 void *buffer, size_t *lenp, loff_t *ppos)
1366{1366{
1367 int err = 0;1367 int err = 0;
@@ -1493,85 +1493,85 @@ int proc_do_large_bitmap(struct ctl_table *table, int write, · 125 unmodified lines
1493 1493
1494#else /* CONFIG_PROC_SYSCTL */1494#else /* CONFIG_PROC_SYSCTL */
1495 1495
1496int proc_dostring(struct ctl_table *table, int write,1496int proc_dostring(const struct ctl_table *table, int write,
1497 void *buffer, size_t *lenp, loff_t *ppos)1497 void *buffer, size_t *lenp, loff_t *ppos)
1498{1498{
1499 return -ENOSYS;1499 return -ENOSYS;
1500}1500}
1501 1501
1502int proc_dobool(struct ctl_table *table, int write,1502int proc_dobool(const struct ctl_table *table, int write,
1503 void *buffer, size_t *lenp, loff_t *ppos)1503 void *buffer, size_t *lenp, loff_t *ppos)
1504{1504{
1505 return -ENOSYS;1505 return -ENOSYS;
1506}1506}
1507 1507
1508int proc_dointvec(struct ctl_table *table, int write,1508int proc_dointvec(const struct ctl_table *table, int write,
1509 void *buffer, size_t *lenp, loff_t *ppos)1509 void *buffer, size_t *lenp, loff_t *ppos)
1510{1510{
1511 return -ENOSYS;1511 return -ENOSYS;
1512}1512}
1513 1513
1514int proc_douintvec(struct ctl_table *table, int write,1514int proc_douintvec(const struct ctl_table *table, int write,
1515 void *buffer, size_t *lenp, loff_t *ppos)1515 void *buffer, size_t *lenp, loff_t *ppos)
1516{1516{
1517 return -ENOSYS;1517 return -ENOSYS;
1518}1518}
1519 1519
1520int proc_dointvec_minmax(struct ctl_table *table, int write,1520int proc_dointvec_minmax(const struct ctl_table *table, int write,
1521 void *buffer, size_t *lenp, loff_t *ppos)1521 void *buffer, size_t *lenp, loff_t *ppos)
1522{1522{
1523 return -ENOSYS;1523 return -ENOSYS;
1524}1524}
1525 1525
1526int proc_douintvec_minmax(struct ctl_table *table, int write,1526int proc_douintvec_minmax(const struct ctl_table *table, int write,
1527 void *buffer, size_t *lenp, loff_t *ppos)1527 void *buffer, size_t *lenp, loff_t *ppos)
1528{1528{
1529 return -ENOSYS;1529 return -ENOSYS;
1530}1530}
1531 1531
1532int proc_dou8vec_minmax(struct ctl_table *table, int write,1532int proc_dou8vec_minmax(const struct ctl_table *table, int write,
1533 void *buffer, size_t *lenp, loff_t *ppos)1533 void *buffer, size_t *lenp, loff_t *ppos)
1534{1534{
1535 return -ENOSYS;1535 return -ENOSYS;
1536}1536}
1537 1537
1538int proc_dointvec_jiffies(struct ctl_table *table, int write,1538int proc_dointvec_jiffies(const struct ctl_table *table, int write,
1539 void *buffer, size_t *lenp, loff_t *ppos)1539 void *buffer, size_t *lenp, loff_t *ppos)
1540{1540{
1541 return -ENOSYS;1541 return -ENOSYS;
1542}1542}
1543 1543
1544int proc_dointvec_ms_jiffies_minmax(struct ctl_table *table, int write,1544int proc_dointvec_ms_jiffies_minmax(const struct ctl_table *table, int write,
1545 void *buffer, size_t *lenp, loff_t *ppos)1545 void *buffer, size_t *lenp, loff_t *ppos)
1546{1546{
1547 return -ENOSYS;1547 return -ENOSYS;
1548}1548}
1549 1549
1550int proc_dointvec_userhz_jiffies(struct ctl_table *table, int write,1550int proc_dointvec_userhz_jiffies(const struct ctl_table *table, int write,
1551 void *buffer, size_t *lenp, loff_t *ppos)1551 void *buffer, size_t *lenp, loff_t *ppos)
1552{1552{
1553 return -ENOSYS;1553 return -ENOSYS;
1554}1554}
1555 1555
1556int proc_dointvec_ms_jiffies(struct ctl_table *table, int write,1556int proc_dointvec_ms_jiffies(const struct ctl_table *table, int write,
1557 void *buffer, size_t *lenp, loff_t *ppos)1557 void *buffer, size_t *lenp, loff_t *ppos)
1558{1558{
1559 return -ENOSYS;1559 return -ENOSYS;
1560}1560}
1561 1561
1562int proc_doulongvec_minmax(struct ctl_table *table, int write,1562int proc_doulongvec_minmax(const struct ctl_table *table, int write,
1563 void *buffer, size_t *lenp, loff_t *ppos)1563 void *buffer, size_t *lenp, loff_t *ppos)
1564{1564{
1565 return -ENOSYS;1565 return -ENOSYS;
1566}1566}
1567 1567
1568int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int write,1568int proc_doulongvec_ms_jiffies_minmax(const struct ctl_table *table, int write,
1569 void *buffer, size_t *lenp, loff_t *ppos)1569 void *buffer, size_t *lenp, loff_t *ppos)
1570{1570{
1571 return -ENOSYS;1571 return -ENOSYS;
1572}1572}
1573 1573
1574int proc_do_large_bitmap(struct ctl_table *table, int write,1574int proc_do_large_bitmap(const struct ctl_table *table, int write,
1575 void *buffer, size_t *lenp, loff_t *ppos)1575 void *buffer, size_t *lenp, loff_t *ppos)
1576{1576{
1577 return -ENOSYS;1577 return -ENOSYS;
@@ -1580,7 +1580,7 @@ int proc_do_large_bitmap(struct ctl_table *table, int write, · 2 unmodified lines
1580#endif /* CONFIG_PROC_SYSCTL */1580#endif /* CONFIG_PROC_SYSCTL */
1581 1581
1582#if defined(CONFIG_SYSCTL)1582#if defined(CONFIG_SYSCTL)
1583int proc_do_static_key(struct ctl_table *table, int write,1583int proc_do_static_key(const struct ctl_table *table, int write,
1584 void *buffer, size_t *lenp, loff_t *ppos)1584 void *buffer, size_t *lenp, loff_t *ppos)
1585{1585{
1586 struct static_key *key = (struct static_key *)table->data;1586 struct static_key *key = (struct static_key *)table->data;
kernel/time/timer.c+1−1
@@ -289,7 +289,7 @@ static void timers_update_migration(void) · 288 unmodified lines
289}289}
290 290
291#ifdef CONFIG_SYSCTL291#ifdef CONFIG_SYSCTL
292static int timer_migration_handler(struct ctl_table *table, int write,292static int timer_migration_handler(const struct ctl_table *table, int write,
293 void *buffer, size_t *lenp, loff_t *ppos)293 void *buffer, size_t *lenp, loff_t *ppos)
294{294{
295 int ret;295 int ret;
kernel/trace/ftrace.c+1−1
@@ -8735,7 +8735,7 @@ static bool is_permanent_ops_registered(void) · 8734 unmodified lines
8735}8735}
8736 8736
8737static int8737static int
8738ftrace_enable_sysctl(struct ctl_table *table, int write,8738ftrace_enable_sysctl(const struct ctl_table *table, int write,
8739 void *buffer, size_t *lenp, loff_t *ppos)8739 void *buffer, size_t *lenp, loff_t *ppos)
8740{8740{
8741 int ret = -ENODEV;8741 int ret = -ENODEV;
kernel/trace/trace.c+1−1
@@ -2767,7 +2767,7 @@ static void output_printk(struct trace_event_buffer *fbuffer) · 2766 unmodified lines
2767 raw_spin_unlock_irqrestore(&tracepoint_iter_lock, flags);2767 raw_spin_unlock_irqrestore(&tracepoint_iter_lock, flags);
2768}2768}
2769 2769
2770int tracepoint_printk_sysctl(struct ctl_table *table, int write,2770int tracepoint_printk_sysctl(const struct ctl_table *table, int write,
2771 void *buffer, size_t *lenp,2771 void *buffer, size_t *lenp,
2772 loff_t *ppos)2772 loff_t *ppos)
2773{2773{
kernel/trace/trace_events_user.c+1−1
@@ -2885,7 +2885,7 @@ err: · 2884 unmodified lines
2885 return -ENODEV;2885 return -ENODEV;
2886}2886}
2887 2887
2888static int set_max_user_events_sysctl(struct ctl_table *table, int write,2888static int set_max_user_events_sysctl(const struct ctl_table *table, int write,
2889 void *buffer, size_t *lenp, loff_t *ppos)2889 void *buffer, size_t *lenp, loff_t *ppos)
2890{2890{
2891 int ret;2891 int ret;
kernel/trace/trace_stack.c+1−1
@@ -514,7 +514,7 @@ static const struct file_operations stack_trace_filter_fops = { · 513 unmodified lines
514#endif /* CONFIG_DYNAMIC_FTRACE */514#endif /* CONFIG_DYNAMIC_FTRACE */
515 515
516int516int
517stack_trace_sysctl(struct ctl_table *table, int write, void *buffer,517stack_trace_sysctl(const struct ctl_table *table, int write, void *buffer,
518 size_t *lenp, loff_t *ppos)518 size_t *lenp, loff_t *ppos)
519{519{
520 int was_enabled;520 int was_enabled;
kernel/umh.c+1−1
@@ -495,7 +495,7 @@ int call_usermodehelper(const char *path, char **argv, char **envp, int wait) · 494 unmodified lines
495EXPORT_SYMBOL(call_usermodehelper);495EXPORT_SYMBOL(call_usermodehelper);
496 496
497#if defined(CONFIG_SYSCTL)497#if defined(CONFIG_SYSCTL)
498static int proc_cap_handler(struct ctl_table *table, int write,498static int proc_cap_handler(const struct ctl_table *table, int write,
499 void *buffer, size_t *lenp, loff_t *ppos)499 void *buffer, size_t *lenp, loff_t *ppos)
500{500{
501 struct ctl_table t;501 struct ctl_table t;
kernel/utsname_sysctl.c+1−1
@@ -30,7 +30,7 @@ static void *get_uts(const struct ctl_table *table) · 29 unmodified lines
30 * Special case of dostring for the UTS structure. This has locks30 * Special case of dostring for the UTS structure. This has locks
31 * to observe. Should this be in kernel/sys.c ????31 * to observe. Should this be in kernel/sys.c ????
32 */32 */
33static int proc_do_uts_string(struct ctl_table *table, int write,33static int proc_do_uts_string(const struct ctl_table *table, int write,
34 void *buffer, size_t *lenp, loff_t *ppos)34 void *buffer, size_t *lenp, loff_t *ppos)
35{35{
36 struct ctl_table uts_table;36 struct ctl_table uts_table;
kernel/watchdog.c+6−6
@@ -983,7 +983,7 @@ static void proc_watchdog_update(void) · 982 unmodified lines
983 * -------------------|----------------------------------|-------------------------------983 * -------------------|----------------------------------|-------------------------------
984 * proc_soft_watchdog | watchdog_softlockup_user_enabled | WATCHDOG_SOFTOCKUP_ENABLED984 * proc_soft_watchdog | watchdog_softlockup_user_enabled | WATCHDOG_SOFTOCKUP_ENABLED
985 */985 */
986static int proc_watchdog_common(int which, struct ctl_table *table, int write,986static int proc_watchdog_common(int which, const struct ctl_table *table, int write,
987 void *buffer, size_t *lenp, loff_t *ppos)987 void *buffer, size_t *lenp, loff_t *ppos)
988{988{
989 int err, old, *param = table->data;989 int err, old, *param = table->data;
@@ -1010,7 +1010,7 @@ static int proc_watchdog_common(int which, struct ctl_table *table, int write, · 20 unmodified lines
1010/*1010/*
1011 * /proc/sys/kernel/watchdog1011 * /proc/sys/kernel/watchdog
1012 */1012 */
1013static int proc_watchdog(struct ctl_table *table, int write,1013static int proc_watchdog(const struct ctl_table *table, int write,
1014 void *buffer, size_t *lenp, loff_t *ppos)1014 void *buffer, size_t *lenp, loff_t *ppos)
1015{1015{
1016 return proc_watchdog_common(WATCHDOG_HARDLOCKUP_ENABLED |1016 return proc_watchdog_common(WATCHDOG_HARDLOCKUP_ENABLED |
@@ -1021,7 +1021,7 @@ static int proc_watchdog(struct ctl_table *table, int write, · 4 unmodified lines
1021/*1021/*
1022 * /proc/sys/kernel/nmi_watchdog1022 * /proc/sys/kernel/nmi_watchdog
1023 */1023 */
1024static int proc_nmi_watchdog(struct ctl_table *table, int write,1024static int proc_nmi_watchdog(const struct ctl_table *table, int write,
1025 void *buffer, size_t *lenp, loff_t *ppos)1025 void *buffer, size_t *lenp, loff_t *ppos)
1026{1026{
1027 if (!watchdog_hardlockup_available && write)1027 if (!watchdog_hardlockup_available && write)
@@ -1034,7 +1034,7 @@ static int proc_nmi_watchdog(struct ctl_table *table, int write, · 6 unmodified lines
1034/*1034/*
1035 * /proc/sys/kernel/soft_watchdog1035 * /proc/sys/kernel/soft_watchdog
1036 */1036 */
1037static int proc_soft_watchdog(struct ctl_table *table, int write,1037static int proc_soft_watchdog(const struct ctl_table *table, int write,
1038 void *buffer, size_t *lenp, loff_t *ppos)1038 void *buffer, size_t *lenp, loff_t *ppos)
1039{1039{
1040 return proc_watchdog_common(WATCHDOG_SOFTOCKUP_ENABLED,1040 return proc_watchdog_common(WATCHDOG_SOFTOCKUP_ENABLED,
@@ -1045,7 +1045,7 @@ static int proc_soft_watchdog(struct ctl_table *table, int write, · 4 unmodified lines
1045/*1045/*
1046 * /proc/sys/kernel/watchdog_thresh1046 * /proc/sys/kernel/watchdog_thresh
1047 */1047 */
1048static int proc_watchdog_thresh(struct ctl_table *table, int write,1048static int proc_watchdog_thresh(const struct ctl_table *table, int write,
1049 void *buffer, size_t *lenp, loff_t *ppos)1049 void *buffer, size_t *lenp, loff_t *ppos)
1050{1050{
1051 int err, old;1051 int err, old;
@@ -1068,7 +1068,7 @@ static int proc_watchdog_thresh(struct ctl_table *table, int write, · 16 unmodified lines
1068 * user to specify a mask that will include cpus that have not yet1068 * user to specify a mask that will include cpus that have not yet
1069 * been brought online, if desired.1069 * been brought online, if desired.
1070 */1070 */
1071static int proc_watchdog_cpumask(struct ctl_table *table, int write,1071static int proc_watchdog_cpumask(const struct ctl_table *table, int write,
1072 void *buffer, size_t *lenp, loff_t *ppos)1072 void *buffer, size_t *lenp, loff_t *ppos)
1073{1073{
1074 int err;1074 int err;
mm/compaction.c+3−3
@@ -2962,7 +2962,7 @@ static int compact_nodes(void) · 2961 unmodified lines
2962 return 0;2962 return 0;
2963}2963}
2964 2964
2965static int compaction_proactiveness_sysctl_handler(struct ctl_table *table, int write,2965static int compaction_proactiveness_sysctl_handler(const struct ctl_table *table, int write,
2966 void *buffer, size_t *length, loff_t *ppos)2966 void *buffer, size_t *length, loff_t *ppos)
2967{2967{
2968 int rc, nid;2968 int rc, nid;
@@ -2992,7 +2992,7 @@ static int compaction_proactiveness_sysctl_handler(struct ctl_table *table, int · 23 unmodified lines
2992 * This is the entry point for compacting all nodes via2992 * This is the entry point for compacting all nodes via
2993 * /proc/sys/vm/compact_memory2993 * /proc/sys/vm/compact_memory
2994 */2994 */
2995static int sysctl_compaction_handler(struct ctl_table *table, int write,2995static int sysctl_compaction_handler(const struct ctl_table *table, int write,
2996 void *buffer, size_t *length, loff_t *ppos)2996 void *buffer, size_t *length, loff_t *ppos)
2997{2997{
2998 int ret;2998 int ret;
@@ -3303,7 +3303,7 @@ static int kcompactd_cpu_online(unsigned int cpu) · 304 unmodified lines
3303 return 0;3303 return 0;
3304}3304}
3305 3305
3306static int proc_dointvec_minmax_warn_RT_change(struct ctl_table *table,3306static int proc_dointvec_minmax_warn_RT_change(const struct ctl_table *table,
3307 int write, void *buffer, size_t *lenp, loff_t *ppos)3307 int write, void *buffer, size_t *lenp, loff_t *ppos)
3308{3308{
3309 int ret, old;3309 int ret, old;
mm/hugetlb.c+3−3
@@ -4925,7 +4925,7 @@ out: · 4924 unmodified lines
4925 return ret;4925 return ret;
4926}4926}
4927 4927
4928static int hugetlb_sysctl_handler(struct ctl_table *table, int write,4928static int hugetlb_sysctl_handler(const struct ctl_table *table, int write,
4929 void *buffer, size_t *length, loff_t *ppos)4929 void *buffer, size_t *length, loff_t *ppos)
4930{4930{
4931 4931
@@ -4934,7 +4934,7 @@ static int hugetlb_sysctl_handler(struct ctl_table *table, int write, · 2 unmodified lines
4934}4934}
4935 4935
4936#ifdef CONFIG_NUMA4936#ifdef CONFIG_NUMA
4937static int hugetlb_mempolicy_sysctl_handler(struct ctl_table *table, int write,4937static int hugetlb_mempolicy_sysctl_handler(const struct ctl_table *table, int write,
4938 void *buffer, size_t *length, loff_t *ppos)4938 void *buffer, size_t *length, loff_t *ppos)
4939{4939{
4940 return hugetlb_sysctl_handler_common(true, table, write,4940 return hugetlb_sysctl_handler_common(true, table, write,
@@ -4942,7 +4942,7 @@ static int hugetlb_mempolicy_sysctl_handler(struct ctl_table *table, int write, · 1 unmodified line
4942}4942}
4943#endif /* CONFIG_NUMA */4943#endif /* CONFIG_NUMA */
4944 4944
4945static int hugetlb_overcommit_handler(struct ctl_table *table, int write,4945static int hugetlb_overcommit_handler(const struct ctl_table *table, int write,
4946 void *buffer, size_t *length, loff_t *ppos)4946 void *buffer, size_t *length, loff_t *ppos)
4947{4947{
4948 struct hstate *h = &default_hstate;4948 struct hstate *h = &default_hstate;
mm/page-writeback.c+5−5
@@ -506,7 +506,7 @@ bool node_dirty_ok(struct pglist_data *pgdat) · 505 unmodified lines
506}506}
507 507
508#ifdef CONFIG_SYSCTL508#ifdef CONFIG_SYSCTL
509static int dirty_background_ratio_handler(struct ctl_table *table, int write,509static int dirty_background_ratio_handler(const struct ctl_table *table, int write,
510 void *buffer, size_t *lenp, loff_t *ppos)510 void *buffer, size_t *lenp, loff_t *ppos)
511{511{
512 int ret;512 int ret;
@@ -517,7 +517,7 @@ static int dirty_background_ratio_handler(struct ctl_table *table, int write, · 4 unmodified lines
517 return ret;517 return ret;
518}518}
519 519
520static int dirty_background_bytes_handler(struct ctl_table *table, int write,520static int dirty_background_bytes_handler(const struct ctl_table *table, int write,
521 void *buffer, size_t *lenp, loff_t *ppos)521 void *buffer, size_t *lenp, loff_t *ppos)
522{522{
523 int ret;523 int ret;
@@ -535,7 +535,7 @@ static int dirty_background_bytes_handler(struct ctl_table *table, int write, · 11 unmodified lines
535 return ret;535 return ret;
536}536}
537 537
538static int dirty_ratio_handler(struct ctl_table *table, int write, void *buffer,538static int dirty_ratio_handler(const struct ctl_table *table, int write, void *buffer,
539 size_t *lenp, loff_t *ppos)539 size_t *lenp, loff_t *ppos)
540{540{
541 int old_ratio = vm_dirty_ratio;541 int old_ratio = vm_dirty_ratio;
@@ -549,7 +549,7 @@ static int dirty_ratio_handler(struct ctl_table *table, int write, void *buffer, · 7 unmodified lines
549 return ret;549 return ret;
550}550}
551 551
552static int dirty_bytes_handler(struct ctl_table *table, int write,552static int dirty_bytes_handler(const struct ctl_table *table, int write,
553 void *buffer, size_t *lenp, loff_t *ppos)553 void *buffer, size_t *lenp, loff_t *ppos)
554{554{
555 unsigned long old_bytes = vm_dirty_bytes;555 unsigned long old_bytes = vm_dirty_bytes;
@@ -2203,7 +2203,7 @@ bool wb_over_bg_thresh(struct bdi_writeback *wb) · 1647 unmodified lines
2203/*2203/*
2204 * sysctl handler for /proc/sys/vm/dirty_writeback_centisecs2204 * sysctl handler for /proc/sys/vm/dirty_writeback_centisecs
2205 */2205 */
2206static int dirty_writeback_centisecs_handler(struct ctl_table *table, int write,2206static int dirty_writeback_centisecs_handler(const struct ctl_table *table, int write,
2207 void *buffer, size_t *length, loff_t *ppos)2207 void *buffer, size_t *length, loff_t *ppos)
2208{2208{
2209 unsigned int old_interval = dirty_writeback_interval;2209 unsigned int old_interval = dirty_writeback_interval;
mm/page_alloc.c+7−7
@@ -5127,7 +5127,7 @@ static char numa_zonelist_order[] = "Node"; · 5126 unmodified lines
5127/*5127/*
5128 * sysctl handler for numa_zonelist_order5128 * sysctl handler for numa_zonelist_order
5129 */5129 */
5130static int numa_zonelist_order_handler(struct ctl_table *table, int write,5130static int numa_zonelist_order_handler(const struct ctl_table *table, int write,
5131 void *buffer, size_t *length, loff_t *ppos)5131 void *buffer, size_t *length, loff_t *ppos)
5132{5132{
5133 if (write)5133 if (write)
@@ -6091,7 +6091,7 @@ postcore_initcall(init_per_zone_wmark_min) · 957 unmodified lines
6091 * that we can call two helper functions whenever min_free_kbytes6091 * that we can call two helper functions whenever min_free_kbytes
6092 * changes.6092 * changes.
6093 */6093 */
6094static int min_free_kbytes_sysctl_handler(struct ctl_table *table, int write,6094static int min_free_kbytes_sysctl_handler(const struct ctl_table *table, int write,
6095 void *buffer, size_t *length, loff_t *ppos)6095 void *buffer, size_t *length, loff_t *ppos)
6096{6096{
6097 int rc;6097 int rc;
@@ -6107,7 +6107,7 @@ static int min_free_kbytes_sysctl_handler(struct ctl_table *table, int write, · 9 unmodified lines
6107 return 0;6107 return 0;
6108}6108}
6109 6109
6110static int watermark_scale_factor_sysctl_handler(struct ctl_table *table, int write,6110static int watermark_scale_factor_sysctl_handler(const struct ctl_table *table, int write,
6111 void *buffer, size_t *length, loff_t *ppos)6111 void *buffer, size_t *length, loff_t *ppos)
6112{6112{
6113 int rc;6113 int rc;
@@ -6137,7 +6137,7 @@ static void setup_min_unmapped_ratio(void) · 23 unmodified lines
6137}6137}
6138 6138
6139 6139
6140static int sysctl_min_unmapped_ratio_sysctl_handler(struct ctl_table *table, int write,6140static int sysctl_min_unmapped_ratio_sysctl_handler(const struct ctl_table *table, int write,
6141 void *buffer, size_t *length, loff_t *ppos)6141 void *buffer, size_t *length, loff_t *ppos)
6142{6142{
6143 int rc;6143 int rc;
@@ -6164,7 +6164,7 @@ static void setup_min_slab_ratio(void) · 20 unmodified lines
6164 sysctl_min_slab_ratio) / 100;6164 sysctl_min_slab_ratio) / 100;
6165}6165}
6166 6166
6167static int sysctl_min_slab_ratio_sysctl_handler(struct ctl_table *table, int write,6167static int sysctl_min_slab_ratio_sysctl_handler(const struct ctl_table *table, int write,
6168 void *buffer, size_t *length, loff_t *ppos)6168 void *buffer, size_t *length, loff_t *ppos)
6169{6169{
6170 int rc;6170 int rc;
@@ -6188,7 +6188,7 @@ static int sysctl_min_slab_ratio_sysctl_handler(struct ctl_table *table, int wri · 17 unmodified lines
6188 * minimum watermarks. The lowmem reserve ratio can only make sense6188 * minimum watermarks. The lowmem reserve ratio can only make sense
6189 * if in function of the boot time zone sizes.6189 * if in function of the boot time zone sizes.
6190 */6190 */
6191static int lowmem_reserve_ratio_sysctl_handler(struct ctl_table *table,6191static int lowmem_reserve_ratio_sysctl_handler(const struct ctl_table *table,
6192 int write, void *buffer, size_t *length, loff_t *ppos)6192 int write, void *buffer, size_t *length, loff_t *ppos)
6193{6193{
6194 int i;6194 int i;
@@ -6209,7 +6209,7 @@ static int lowmem_reserve_ratio_sysctl_handler(struct ctl_table *table, · 14 unmodified lines
6209 * cpu. It is the fraction of total pages in each zone that a hot per cpu6209 * cpu. It is the fraction of total pages in each zone that a hot per cpu
6210 * pagelist can have before it gets flushed back to buddy allocator.6210 * pagelist can have before it gets flushed back to buddy allocator.
6211 */6211 */
6212static int percpu_pagelist_high_fraction_sysctl_handler(struct ctl_table *table,6212static int percpu_pagelist_high_fraction_sysctl_handler(const struct ctl_table *table,
6213 int write, void *buffer, size_t *length, loff_t *ppos)6213 int write, void *buffer, size_t *length, loff_t *ppos)
6214{6214{
6215 struct zone *zone;6215 struct zone *zone;
mm/util.c+3−3
@@ -868,7 +868,7 @@ int sysctl_max_map_count __read_mostly = DEFAULT_MAX_MAP_COUNT; · 867 unmodified lines
868unsigned long sysctl_user_reserve_kbytes __read_mostly = 1UL << 17; /* 128MB */868unsigned long sysctl_user_reserve_kbytes __read_mostly = 1UL << 17; /* 128MB */
869unsigned long sysctl_admin_reserve_kbytes __read_mostly = 1UL << 13; /* 8MB */869unsigned long sysctl_admin_reserve_kbytes __read_mostly = 1UL << 13; /* 8MB */
870 870
871int overcommit_ratio_handler(struct ctl_table *table, int write, void *buffer,871int overcommit_ratio_handler(const struct ctl_table *table, int write, void *buffer,
872 size_t *lenp, loff_t *ppos)872 size_t *lenp, loff_t *ppos)
873{873{
874 int ret;874 int ret;
@@ -884,7 +884,7 @@ static void sync_overcommit_as(struct work_struct *dummy) · 9 unmodified lines
884 percpu_counter_sync(&vm_committed_as);884 percpu_counter_sync(&vm_committed_as);
885}885}
886 886
887int overcommit_policy_handler(struct ctl_table *table, int write, void *buffer,887int overcommit_policy_handler(const struct ctl_table *table, int write, void *buffer,
888 size_t *lenp, loff_t *ppos)888 size_t *lenp, loff_t *ppos)
889{889{
890 struct ctl_table t;890 struct ctl_table t;
@@ -920,7 +920,7 @@ int overcommit_policy_handler(struct ctl_table *table, int write, void *buffer, · 29 unmodified lines
920 return ret;920 return ret;
921}921}
922 922
923int overcommit_kbytes_handler(struct ctl_table *table, int write, void *buffer,923int overcommit_kbytes_handler(const struct ctl_table *table, int write, void *buffer,
924 size_t *lenp, loff_t *ppos)924 size_t *lenp, loff_t *ppos)
925{925{
926 int ret;926 int ret;
mm/vmstat.c+2−2
@@ -74,7 +74,7 @@ static void invalid_numa_statistics(void) · 73 unmodified lines
74 74
75static DEFINE_MUTEX(vm_numa_stat_lock);75static DEFINE_MUTEX(vm_numa_stat_lock);
76 76
77int sysctl_vm_numa_stat_handler(struct ctl_table *table, int write,77int sysctl_vm_numa_stat_handler(const struct ctl_table *table, int write,
78 void *buffer, size_t *length, loff_t *ppos)78 void *buffer, size_t *length, loff_t *ppos)
79{79{
80 int ret, oldval;80 int ret, oldval;
@@ -1888,7 +1888,7 @@ static void refresh_vm_stats(struct work_struct *work) · 1807 unmodified lines
1888 refresh_cpu_vm_stats(true);1888 refresh_cpu_vm_stats(true);
1889}1889}
1890 1890
1891int vmstat_refresh(struct ctl_table *table, int write,1891int vmstat_refresh(const struct ctl_table *table, int write,
1892 void *buffer, size_t *lenp, loff_t *ppos)1892 void *buffer, size_t *lenp, loff_t *ppos)
1893{1893{
1894 long val;1894 long val;
net/bridge/br_netfilter_hooks.c+1−1
@@ -1189,7 +1189,7 @@ int br_nf_hook_thresh(unsigned int hook, struct net *net, · 1188 unmodified lines
1189 1189
1190#ifdef CONFIG_SYSCTL1190#ifdef CONFIG_SYSCTL
1191static1191static
1192int brnf_sysctl_call_tables(struct ctl_table *ctl, int write,1192int brnf_sysctl_call_tables(const struct ctl_table *ctl, int write,
1193 void *buffer, size_t *lenp, loff_t *ppos)1193 void *buffer, size_t *lenp, loff_t *ppos)
1194{1194{
1195 int ret;1195 int ret;
net/core/neighbour.c+9−9
@@ -3543,7 +3543,7 @@ EXPORT_SYMBOL(neigh_app_ns); · 3542 unmodified lines
3543#ifdef CONFIG_SYSCTL3543#ifdef CONFIG_SYSCTL
3544static int unres_qlen_max = INT_MAX / SKB_TRUESIZE(ETH_FRAME_LEN);3544static int unres_qlen_max = INT_MAX / SKB_TRUESIZE(ETH_FRAME_LEN);
3545 3545
3546static int proc_unres_qlen(struct ctl_table *ctl, int write,3546static int proc_unres_qlen(const struct ctl_table *ctl, int write,
3547 void *buffer, size_t *lenp, loff_t *ppos)3547 void *buffer, size_t *lenp, loff_t *ppos)
3548{3548{
3549 int size, ret;3549 int size, ret;
@@ -3595,7 +3595,7 @@ static void neigh_proc_update(const struct ctl_table *ctl, int write) · 45 unmodified lines
3595 neigh_copy_dflt_parms(net, p, index);3595 neigh_copy_dflt_parms(net, p, index);
3596}3596}
3597 3597
3598static int neigh_proc_dointvec_zero_intmax(struct ctl_table *ctl, int write,3598static int neigh_proc_dointvec_zero_intmax(const struct ctl_table *ctl, int write,
3599 void *buffer, size_t *lenp,3599 void *buffer, size_t *lenp,
3600 loff_t *ppos)3600 loff_t *ppos)
3601{3601{
@@ -3610,7 +3610,7 @@ static int neigh_proc_dointvec_zero_intmax(struct ctl_table *ctl, int write, · 8 unmodified lines
3610 return ret;3610 return ret;
3611}3611}
3612 3612
3613static int neigh_proc_dointvec_ms_jiffies_positive(struct ctl_table *ctl, int write,3613static int neigh_proc_dointvec_ms_jiffies_positive(const struct ctl_table *ctl, int write,
3614 void *buffer, size_t *lenp, loff_t *ppos)3614 void *buffer, size_t *lenp, loff_t *ppos)
3615{3615{
3616 struct ctl_table tmp = *ctl;3616 struct ctl_table tmp = *ctl;
@@ -3626,7 +3626,7 @@ static int neigh_proc_dointvec_ms_jiffies_positive(struct ctl_table *ctl, int wr · 9 unmodified lines
3626 return ret;3626 return ret;
3627}3627}
3628 3628
3629int neigh_proc_dointvec(struct ctl_table *ctl, int write, void *buffer,3629int neigh_proc_dointvec(const struct ctl_table *ctl, int write, void *buffer,
3630 size_t *lenp, loff_t *ppos)3630 size_t *lenp, loff_t *ppos)
3631{3631{
3632 int ret = proc_dointvec(ctl, write, buffer, lenp, ppos);3632 int ret = proc_dointvec(ctl, write, buffer, lenp, ppos);
@@ -3636,7 +3636,7 @@ int neigh_proc_dointvec(struct ctl_table *ctl, int write, void *buffer, · 3 unmodified lines
3636}3636}
3637EXPORT_SYMBOL(neigh_proc_dointvec);3637EXPORT_SYMBOL(neigh_proc_dointvec);
3638 3638
3639int neigh_proc_dointvec_jiffies(struct ctl_table *ctl, int write, void *buffer,3639int neigh_proc_dointvec_jiffies(const struct ctl_table *ctl, int write, void *buffer,
3640 size_t *lenp, loff_t *ppos)3640 size_t *lenp, loff_t *ppos)
3641{3641{
3642 int ret = proc_dointvec_jiffies(ctl, write, buffer, lenp, ppos);3642 int ret = proc_dointvec_jiffies(ctl, write, buffer, lenp, ppos);
@@ -3646,7 +3646,7 @@ int neigh_proc_dointvec_jiffies(struct ctl_table *ctl, int write, void *buffer, · 3 unmodified lines
3646}3646}
3647EXPORT_SYMBOL(neigh_proc_dointvec_jiffies);3647EXPORT_SYMBOL(neigh_proc_dointvec_jiffies);
3648 3648
3649static int neigh_proc_dointvec_userhz_jiffies(struct ctl_table *ctl, int write,3649static int neigh_proc_dointvec_userhz_jiffies(const struct ctl_table *ctl, int write,
3650 void *buffer, size_t *lenp,3650 void *buffer, size_t *lenp,
3651 loff_t *ppos)3651 loff_t *ppos)
3652{3652{
@@ -3656,7 +3656,7 @@ static int neigh_proc_dointvec_userhz_jiffies(struct ctl_table *ctl, int write, · 3 unmodified lines
3656 return ret;3656 return ret;
3657}3657}
3658 3658
3659int neigh_proc_dointvec_ms_jiffies(struct ctl_table *ctl, int write,3659int neigh_proc_dointvec_ms_jiffies(const struct ctl_table *ctl, int write,
3660 void *buffer, size_t *lenp, loff_t *ppos)3660 void *buffer, size_t *lenp, loff_t *ppos)
3661{3661{
3662 int ret = proc_dointvec_ms_jiffies(ctl, write, buffer, lenp, ppos);3662 int ret = proc_dointvec_ms_jiffies(ctl, write, buffer, lenp, ppos);
@@ -3666,7 +3666,7 @@ int neigh_proc_dointvec_ms_jiffies(struct ctl_table *ctl, int write, · 3 unmodified lines
3666}3666}
3667EXPORT_SYMBOL(neigh_proc_dointvec_ms_jiffies);3667EXPORT_SYMBOL(neigh_proc_dointvec_ms_jiffies);
3668 3668
3669static int neigh_proc_dointvec_unres_qlen(struct ctl_table *ctl, int write,3669static int neigh_proc_dointvec_unres_qlen(const struct ctl_table *ctl, int write,
3670 void *buffer, size_t *lenp,3670 void *buffer, size_t *lenp,
3671 loff_t *ppos)3671 loff_t *ppos)
3672{3672{
@@ -3676,7 +3676,7 @@ static int neigh_proc_dointvec_unres_qlen(struct ctl_table *ctl, int write, · 3 unmodified lines
3676 return ret;3676 return ret;
3677}3677}
3678 3678
3679static int neigh_proc_base_reachable_time(struct ctl_table *ctl, int write,3679static int neigh_proc_base_reachable_time(const struct ctl_table *ctl, int write,
3680 void *buffer, size_t *lenp,3680 void *buffer, size_t *lenp,
3681 loff_t *ppos)3681 loff_t *ppos)
3682{3682{
net/core/sysctl_net_core.c+10−10
@@ -95,7 +95,7 @@ static struct cpumask *rps_default_mask_cow_alloc(struct net *net) · 94 unmodified lines
95 return rps_default_mask;95 return rps_default_mask;
96}96}
97 97
98static int rps_default_mask_sysctl(struct ctl_table *table, int write,98static int rps_default_mask_sysctl(const struct ctl_table *table, int write,
99 void *buffer, size_t *lenp, loff_t *ppos)99 void *buffer, size_t *lenp, loff_t *ppos)
100{100{
101 struct net *net = (struct net *)table->data;101 struct net *net = (struct net *)table->data;
@@ -126,7 +126,7 @@ done: · 24 unmodified lines
126 return err;126 return err;
127}127}
128 128
129static int rps_sock_flow_sysctl(struct ctl_table *table, int write,129static int rps_sock_flow_sysctl(const struct ctl_table *table, int write,
130 void *buffer, size_t *lenp, loff_t *ppos)130 void *buffer, size_t *lenp, loff_t *ppos)
131{131{
132 unsigned int orig_size, size;132 unsigned int orig_size, size;
@@ -198,7 +198,7 @@ static int rps_sock_flow_sysctl(struct ctl_table *table, int write, · 65 unmodified lines
198#ifdef CONFIG_NET_FLOW_LIMIT198#ifdef CONFIG_NET_FLOW_LIMIT
199static DEFINE_MUTEX(flow_limit_update_mutex);199static DEFINE_MUTEX(flow_limit_update_mutex);
200 200
201static int flow_limit_cpu_sysctl(struct ctl_table *table, int write,201static int flow_limit_cpu_sysctl(const struct ctl_table *table, int write,
202 void *buffer, size_t *lenp, loff_t *ppos)202 void *buffer, size_t *lenp, loff_t *ppos)
203{203{
204 struct sd_flow_limit *cur;204 struct sd_flow_limit *cur;
@@ -255,7 +255,7 @@ done: · 50 unmodified lines
255 return ret;255 return ret;
256}256}
257 257
258static int flow_limit_table_len_sysctl(struct ctl_table *table, int write,258static int flow_limit_table_len_sysctl(const struct ctl_table *table, int write,
259 void *buffer, size_t *lenp, loff_t *ppos)259 void *buffer, size_t *lenp, loff_t *ppos)
260{260{
261 unsigned int old, *ptr;261 unsigned int old, *ptr;
@@ -277,7 +277,7 @@ static int flow_limit_table_len_sysctl(struct ctl_table *table, int write, · 15 unmodified lines
277#endif /* CONFIG_NET_FLOW_LIMIT */277#endif /* CONFIG_NET_FLOW_LIMIT */
278 278
279#ifdef CONFIG_NET_SCHED279#ifdef CONFIG_NET_SCHED
280static int set_default_qdisc(struct ctl_table *table, int write,280static int set_default_qdisc(const struct ctl_table *table, int write,
281 void *buffer, size_t *lenp, loff_t *ppos)281 void *buffer, size_t *lenp, loff_t *ppos)
282{282{
283 char id[IFNAMSIZ];283 char id[IFNAMSIZ];
@@ -296,7 +296,7 @@ static int set_default_qdisc(struct ctl_table *table, int write, · 12 unmodified lines
296}296}
297#endif297#endif
298 298
299static int proc_do_dev_weight(struct ctl_table *table, int write,299static int proc_do_dev_weight(const struct ctl_table *table, int write,
300 void *buffer, size_t *lenp, loff_t *ppos)300 void *buffer, size_t *lenp, loff_t *ppos)
301{301{
302 static DEFINE_MUTEX(dev_weight_mutex);302 static DEFINE_MUTEX(dev_weight_mutex);
@@ -314,7 +314,7 @@ static int proc_do_dev_weight(struct ctl_table *table, int write, · 11 unmodified lines
314 return ret;314 return ret;
315}315}
316 316
317static int proc_do_rss_key(struct ctl_table *table, int write,317static int proc_do_rss_key(const struct ctl_table *table, int write,
318 void *buffer, size_t *lenp, loff_t *ppos)318 void *buffer, size_t *lenp, loff_t *ppos)
319{319{
320 struct ctl_table fake_table;320 struct ctl_table fake_table;
@@ -327,7 +327,7 @@ static int proc_do_rss_key(struct ctl_table *table, int write, · 6 unmodified lines
327}327}
328 328
329#ifdef CONFIG_BPF_JIT329#ifdef CONFIG_BPF_JIT
330static int proc_dointvec_minmax_bpf_enable(struct ctl_table *table, int write,330static int proc_dointvec_minmax_bpf_enable(const struct ctl_table *table, int write,
331 void *buffer, size_t *lenp,331 void *buffer, size_t *lenp,
332 loff_t *ppos)332 loff_t *ppos)
333{333{
@@ -360,7 +360,7 @@ static int proc_dointvec_minmax_bpf_enable(struct ctl_table *table, int write, · 26 unmodified lines
360 360
361# ifdef CONFIG_HAVE_EBPF_JIT361# ifdef CONFIG_HAVE_EBPF_JIT
362static int362static int
363proc_dointvec_minmax_bpf_restricted(struct ctl_table *table, int write,363proc_dointvec_minmax_bpf_restricted(const struct ctl_table *table, int write,
364 void *buffer, size_t *lenp, loff_t *ppos)364 void *buffer, size_t *lenp, loff_t *ppos)
365{365{
366 if (!capable(CAP_SYS_ADMIN))366 if (!capable(CAP_SYS_ADMIN))
@@ -371,7 +371,7 @@ proc_dointvec_minmax_bpf_restricted(struct ctl_table *table, int write, · 4 unmodified lines
371# endif /* CONFIG_HAVE_EBPF_JIT */371# endif /* CONFIG_HAVE_EBPF_JIT */
372 372
373static int373static int
374proc_dolongvec_minmax_bpf_restricted(struct ctl_table *table, int write,374proc_dolongvec_minmax_bpf_restricted(const struct ctl_table *table, int write,
375 void *buffer, size_t *lenp, loff_t *ppos)375 void *buffer, size_t *lenp, loff_t *ppos)
376{376{
377 if (!capable(CAP_SYS_ADMIN))377 if (!capable(CAP_SYS_ADMIN))
net/ipv4/devinet.c+3−3
@@ -2390,7 +2390,7 @@ static int devinet_conf_ifindex(struct net *net, struct ipv4_devconf *cnf) · 2389 unmodified lines
2390 }2390 }
2391}2391}
2392 2392
2393static int devinet_conf_proc(struct ctl_table *ctl, int write,2393static int devinet_conf_proc(const struct ctl_table *ctl, int write,
2394 void *buffer, size_t *lenp, loff_t *ppos)2394 void *buffer, size_t *lenp, loff_t *ppos)
2395{2395{
2396 int old_value = *(int *)ctl->data;2396 int old_value = *(int *)ctl->data;
@@ -2442,7 +2442,7 @@ static int devinet_conf_proc(struct ctl_table *ctl, int write, · 45 unmodified lines
2442 return ret;2442 return ret;
2443}2443}
2444 2444
2445static int devinet_sysctl_forward(struct ctl_table *ctl, int write,2445static int devinet_sysctl_forward(const struct ctl_table *ctl, int write,
2446 void *buffer, size_t *lenp, loff_t *ppos)2446 void *buffer, size_t *lenp, loff_t *ppos)
2447{2447{
2448 int *valp = ctl->data;2448 int *valp = ctl->data;
@@ -2489,7 +2489,7 @@ static int devinet_sysctl_forward(struct ctl_table *ctl, int write, · 40 unmodified lines
2489 return ret;2489 return ret;
2490}2490}
2491 2491
2492static int ipv4_doint_and_flush(struct ctl_table *ctl, int write,2492static int ipv4_doint_and_flush(const struct ctl_table *ctl, int write,
2493 void *buffer, size_t *lenp, loff_t *ppos)2493 void *buffer, size_t *lenp, loff_t *ppos)
2494{2494{
2495 int *valp = ctl->data;2495 int *valp = ctl->data;
net/ipv4/route.c+1−1
@@ -3388,7 +3388,7 @@ static int ip_rt_gc_min_interval __read_mostly = HZ / 2; · 3387 unmodified lines
3388static int ip_rt_gc_elasticity __read_mostly = 8;3388static int ip_rt_gc_elasticity __read_mostly = 8;
3389static int ip_min_valid_pmtu __read_mostly = IPV4_MIN_MTU;3389static int ip_min_valid_pmtu __read_mostly = IPV4_MIN_MTU;
3390 3390
3391static int ipv4_sysctl_rtcache_flush(struct ctl_table *__ctl, int write,3391static int ipv4_sysctl_rtcache_flush(const struct ctl_table *__ctl, int write,
3392 void *buffer, size_t *lenp, loff_t *ppos)3392 void *buffer, size_t *lenp, loff_t *ppos)
3393{3393{
3394 struct net *net = (struct net *)__ctl->extra1;3394 struct net *net = (struct net *)__ctl->extra1;
net/ipv4/sysctl_net_ipv4.c+15−15
@@ -62,7 +62,7 @@ static void set_local_port_range(struct net *net, unsigned int low, unsigned int · 61 unmodified lines
62}62}
63 63
64/* Validate changes from /proc interface. */64/* Validate changes from /proc interface. */
65static int ipv4_local_port_range(struct ctl_table *table, int write,65static int ipv4_local_port_range(const struct ctl_table *table, int write,
66 void *buffer, size_t *lenp, loff_t *ppos)66 void *buffer, size_t *lenp, loff_t *ppos)
67{67{
68 struct net *net = table->data;68 struct net *net = table->data;
@@ -96,7 +96,7 @@ static int ipv4_local_port_range(struct ctl_table *table, int write, · 27 unmodified lines
96}96}
97 97
98/* Validate changes from /proc interface. */98/* Validate changes from /proc interface. */
99static int ipv4_privileged_ports(struct ctl_table *table, int write,99static int ipv4_privileged_ports(const struct ctl_table *table, int write,
100 void *buffer, size_t *lenp, loff_t *ppos)100 void *buffer, size_t *lenp, loff_t *ppos)
101{101{
102 struct net *net = container_of(table->data, struct net,102 struct net *net = container_of(table->data, struct net,
@@ -159,7 +159,7 @@ static void set_ping_group_range(const struct ctl_table *table, · 56 unmodified lines
159}159}
160 160
161/* Validate changes from /proc interface. */161/* Validate changes from /proc interface. */
162static int ipv4_ping_group_range(struct ctl_table *table, int write,162static int ipv4_ping_group_range(const struct ctl_table *table, int write,
163 void *buffer, size_t *lenp, loff_t *ppos)163 void *buffer, size_t *lenp, loff_t *ppos)
164{164{
165 struct user_namespace *user_ns = current_user_ns();165 struct user_namespace *user_ns = current_user_ns();
@@ -194,7 +194,7 @@ static int ipv4_ping_group_range(struct ctl_table *table, int write, · 28 unmodified lines
194 return ret;194 return ret;
195}195}
196 196
197static int ipv4_fwd_update_priority(struct ctl_table *table, int write,197static int ipv4_fwd_update_priority(const struct ctl_table *table, int write,
198 void *buffer, size_t *lenp, loff_t *ppos)198 void *buffer, size_t *lenp, loff_t *ppos)
199{199{
200 struct net *net;200 struct net *net;
@@ -210,7 +210,7 @@ static int ipv4_fwd_update_priority(struct ctl_table *table, int write, · 9 unmodified lines
210 return ret;210 return ret;
211}211}
212 212
213static int proc_tcp_congestion_control(struct ctl_table *ctl, int write,213static int proc_tcp_congestion_control(const struct ctl_table *ctl, int write,
214 void *buffer, size_t *lenp, loff_t *ppos)214 void *buffer, size_t *lenp, loff_t *ppos)
215{215{
216 struct net *net = container_of(ctl->data, struct net,216 struct net *net = container_of(ctl->data, struct net,
@@ -230,7 +230,7 @@ static int proc_tcp_congestion_control(struct ctl_table *ctl, int write, · 13 unmodified lines
230 return ret;230 return ret;
231}231}
232 232
233static int proc_tcp_available_congestion_control(struct ctl_table *ctl,233static int proc_tcp_available_congestion_control(const struct ctl_table *ctl,
234 int write, void *buffer,234 int write, void *buffer,
235 size_t *lenp, loff_t *ppos)235 size_t *lenp, loff_t *ppos)
236{236{
@@ -246,7 +246,7 @@ static int proc_tcp_available_congestion_control(struct ctl_table *ctl, · 9 unmodified lines
246 return ret;246 return ret;
247}247}
248 248
249static int proc_allowed_congestion_control(struct ctl_table *ctl,249static int proc_allowed_congestion_control(const struct ctl_table *ctl,
250 int write, void *buffer,250 int write, void *buffer,
251 size_t *lenp, loff_t *ppos)251 size_t *lenp, loff_t *ppos)
252{252{
@@ -283,7 +283,7 @@ static int sscanf_key(char *buf, __le32 *key) · 30 unmodified lines
283 return ret;283 return ret;
284}284}
285 285
286static int proc_tcp_fastopen_key(struct ctl_table *table, int write,286static int proc_tcp_fastopen_key(const struct ctl_table *table, int write,
287 void *buffer, size_t *lenp, loff_t *ppos)287 void *buffer, size_t *lenp, loff_t *ppos)
288{288{
289 struct net *net = container_of(table->data, struct net,289 struct net *net = container_of(table->data, struct net,
@@ -354,7 +354,7 @@ bad_key: · 64 unmodified lines
354 return ret;354 return ret;
355}355}
356 356
357static int proc_tfo_blackhole_detect_timeout(struct ctl_table *table,357static int proc_tfo_blackhole_detect_timeout(const struct ctl_table *table,
358 int write, void *buffer,358 int write, void *buffer,
359 size_t *lenp, loff_t *ppos)359 size_t *lenp, loff_t *ppos)
360{360{
@@ -369,7 +369,7 @@ static int proc_tfo_blackhole_detect_timeout(struct ctl_table *table, · 8 unmodified lines
369 return ret;369 return ret;
370}370}
371 371
372static int proc_tcp_available_ulp(struct ctl_table *ctl,372static int proc_tcp_available_ulp(const struct ctl_table *ctl,
373 int write, void *buffer, size_t *lenp,373 int write, void *buffer, size_t *lenp,
374 loff_t *ppos)374 loff_t *ppos)
375{375{
@@ -386,7 +386,7 @@ static int proc_tcp_available_ulp(struct ctl_table *ctl, · 10 unmodified lines
386 return ret;386 return ret;
387}387}
388 388
389static int proc_tcp_ehash_entries(struct ctl_table *table, int write,389static int proc_tcp_ehash_entries(const struct ctl_table *table, int write,
390 void *buffer, size_t *lenp, loff_t *ppos)390 void *buffer, size_t *lenp, loff_t *ppos)
391{391{
392 struct net *net = container_of(table->data, struct net,392 struct net *net = container_of(table->data, struct net,
@@ -410,7 +410,7 @@ static int proc_tcp_ehash_entries(struct ctl_table *table, int write, · 17 unmodified lines
410 return proc_dointvec(&tbl, write, buffer, lenp, ppos);410 return proc_dointvec(&tbl, write, buffer, lenp, ppos);
411}411}
412 412
413static int proc_udp_hash_entries(struct ctl_table *table, int write,413static int proc_udp_hash_entries(const struct ctl_table *table, int write,
414 void *buffer, size_t *lenp, loff_t *ppos)414 void *buffer, size_t *lenp, loff_t *ppos)
415{415{
416 struct net *net = container_of(table->data, struct net,416 struct net *net = container_of(table->data, struct net,
@@ -434,7 +434,7 @@ static int proc_udp_hash_entries(struct ctl_table *table, int write, · 17 unmodified lines
434}434}
435 435
436#ifdef CONFIG_IP_ROUTE_MULTIPATH436#ifdef CONFIG_IP_ROUTE_MULTIPATH
437static int proc_fib_multipath_hash_policy(struct ctl_table *table, int write,437static int proc_fib_multipath_hash_policy(const struct ctl_table *table, int write,
438 void *buffer, size_t *lenp,438 void *buffer, size_t *lenp,
439 loff_t *ppos)439 loff_t *ppos)
440{440{
@@ -449,7 +449,7 @@ static int proc_fib_multipath_hash_policy(struct ctl_table *table, int write, · 8 unmodified lines
449 return ret;449 return ret;
450}450}
451 451
452static int proc_fib_multipath_hash_fields(struct ctl_table *table, int write,452static int proc_fib_multipath_hash_fields(const struct ctl_table *table, int write,
453 void *buffer, size_t *lenp,453 void *buffer, size_t *lenp,
454 loff_t *ppos)454 loff_t *ppos)
455{455{
@@ -484,7 +484,7 @@ static void proc_fib_multipath_hash_set_seed(struct net *net, u32 user_seed) · 28 unmodified lines
484 WRITE_ONCE(net->ipv4.sysctl_fib_multipath_hash_seed, new);484 WRITE_ONCE(net->ipv4.sysctl_fib_multipath_hash_seed, new);
485}485}
486 486
487static int proc_fib_multipath_hash_seed(struct ctl_table *table, int write,487static int proc_fib_multipath_hash_seed(const struct ctl_table *table, int write,
488 void *buffer, size_t *lenp,488 void *buffer, size_t *lenp,
489 loff_t *ppos)489 loff_t *ppos)
490{490{
net/ipv6/addrconf.c+8−8
@@ -6309,7 +6309,7 @@ static void ipv6_ifa_notify(int event, struct inet6_ifaddr *ifp) · 6308 unmodified lines
6309 6309
6310#ifdef CONFIG_SYSCTL6310#ifdef CONFIG_SYSCTL
6311 6311
6312static int addrconf_sysctl_forward(struct ctl_table *ctl, int write,6312static int addrconf_sysctl_forward(const struct ctl_table *ctl, int write,
6313 void *buffer, size_t *lenp, loff_t *ppos)6313 void *buffer, size_t *lenp, loff_t *ppos)
6314{6314{
6315 int *valp = ctl->data;6315 int *valp = ctl->data;
@@ -6334,7 +6334,7 @@ static int addrconf_sysctl_forward(struct ctl_table *ctl, int write, · 18 unmodified lines
6334 return ret;6334 return ret;
6335}6335}
6336 6336
6337static int addrconf_sysctl_mtu(struct ctl_table *ctl, int write,6337static int addrconf_sysctl_mtu(const struct ctl_table *ctl, int write,
6338 void *buffer, size_t *lenp, loff_t *ppos)6338 void *buffer, size_t *lenp, loff_t *ppos)
6339{6339{
6340 struct inet6_dev *idev = ctl->extra1;6340 struct inet6_dev *idev = ctl->extra1;
@@ -6405,7 +6405,7 @@ static int addrconf_disable_ipv6(const struct ctl_table *table, int *p, int newf · 64 unmodified lines
6405 return 0;6405 return 0;
6406}6406}
6407 6407
6408static int addrconf_sysctl_disable(struct ctl_table *ctl, int write,6408static int addrconf_sysctl_disable(const struct ctl_table *ctl, int write,
6409 void *buffer, size_t *lenp, loff_t *ppos)6409 void *buffer, size_t *lenp, loff_t *ppos)
6410{6410{
6411 int *valp = ctl->data;6411 int *valp = ctl->data;
@@ -6430,7 +6430,7 @@ static int addrconf_sysctl_disable(struct ctl_table *ctl, int write, · 18 unmodified lines
6430 return ret;6430 return ret;
6431}6431}
6432 6432
6433static int addrconf_sysctl_proxy_ndp(struct ctl_table *ctl, int write,6433static int addrconf_sysctl_proxy_ndp(const struct ctl_table *ctl, int write,
6434 void *buffer, size_t *lenp, loff_t *ppos)6434 void *buffer, size_t *lenp, loff_t *ppos)
6435{6435{
6436 int *valp = ctl->data;6436 int *valp = ctl->data;
@@ -6471,7 +6471,7 @@ static int addrconf_sysctl_proxy_ndp(struct ctl_table *ctl, int write, · 34 unmodified lines
6471 return ret;6471 return ret;
6472}6472}
6473 6473
6474static int addrconf_sysctl_addr_gen_mode(struct ctl_table *ctl, int write,6474static int addrconf_sysctl_addr_gen_mode(const struct ctl_table *ctl, int write,
6475 void *buffer, size_t *lenp,6475 void *buffer, size_t *lenp,
6476 loff_t *ppos)6476 loff_t *ppos)
6477{6477{
@@ -6534,7 +6534,7 @@ out: · 56 unmodified lines
6534 return ret;6534 return ret;
6535}6535}
6536 6536
6537static int addrconf_sysctl_stable_secret(struct ctl_table *ctl, int write,6537static int addrconf_sysctl_stable_secret(const struct ctl_table *ctl, int write,
6538 void *buffer, size_t *lenp,6538 void *buffer, size_t *lenp,
6539 loff_t *ppos)6539 loff_t *ppos)
6540{6540{
@@ -6602,7 +6602,7 @@ out: · 61 unmodified lines
6602}6602}
6603 6603
6604static6604static
6605int addrconf_sysctl_ignore_routes_with_linkdown(struct ctl_table *ctl,6605int addrconf_sysctl_ignore_routes_with_linkdown(const struct ctl_table *ctl,
6606 int write, void *buffer,6606 int write, void *buffer,
6607 size_t *lenp,6607 size_t *lenp,
6608 loff_t *ppos)6608 loff_t *ppos)
@@ -6702,7 +6702,7 @@ int addrconf_disable_policy(const struct ctl_table *ctl, int *valp, int val) · 93 unmodified lines
6702 return 0;6702 return 0;
6703}6703}
6704 6704
6705static int addrconf_sysctl_disable_policy(struct ctl_table *ctl, int write,6705static int addrconf_sysctl_disable_policy(const struct ctl_table *ctl, int write,
6706 void *buffer, size_t *lenp, loff_t *ppos)6706 void *buffer, size_t *lenp, loff_t *ppos)
6707{6707{
6708 int *valp = ctl->data;6708 int *valp = ctl->data;
net/ipv6/ndisc.c+1−1
@@ -1951,7 +1951,7 @@ static void ndisc_warn_deprecated_sysctl(const struct ctl_table *ctl, · 1950 unmodified lines
1951 }1951 }
1952}1952}
1953 1953
1954int ndisc_ifinfo_sysctl_change(struct ctl_table *ctl, int write, void *buffer,1954int ndisc_ifinfo_sysctl_change(const struct ctl_table *ctl, int write, void *buffer,
1955 size_t *lenp, loff_t *ppos)1955 size_t *lenp, loff_t *ppos)
1956{1956{
1957 struct net_device *dev = ctl->extra1;1957 struct net_device *dev = ctl->extra1;
net/ipv6/route.c+1−1
@@ -6334,7 +6334,7 @@ static int rt6_stats_seq_show(struct seq_file *seq, void *v) · 6333 unmodified lines
6334 6334
6335#ifdef CONFIG_SYSCTL6335#ifdef CONFIG_SYSCTL
6336 6336
6337static int ipv6_sysctl_rtcache_flush(struct ctl_table *ctl, int write,6337static int ipv6_sysctl_rtcache_flush(const struct ctl_table *ctl, int write,
6338 void *buffer, size_t *lenp, loff_t *ppos)6338 void *buffer, size_t *lenp, loff_t *ppos)
6339{6339{
6340 struct net *net;6340 struct net *net;
net/ipv6/sysctl_net_ipv6.c+2−2
@@ -30,7 +30,7 @@ static u32 rt6_multipath_hash_fields_all_mask = · 29 unmodified lines
30static u32 ioam6_id_max = IOAM6_DEFAULT_ID;30static u32 ioam6_id_max = IOAM6_DEFAULT_ID;
31static u64 ioam6_id_wide_max = IOAM6_DEFAULT_ID_WIDE;31static u64 ioam6_id_wide_max = IOAM6_DEFAULT_ID_WIDE;
32 32
33static int proc_rt6_multipath_hash_policy(struct ctl_table *table, int write,33static int proc_rt6_multipath_hash_policy(const struct ctl_table *table, int write,
34 void *buffer, size_t *lenp, loff_t *ppos)34 void *buffer, size_t *lenp, loff_t *ppos)
35{35{
36 struct net *net;36 struct net *net;
@@ -46,7 +46,7 @@ static int proc_rt6_multipath_hash_policy(struct ctl_table *table, int write, · 9 unmodified lines
46}46}
47 47
48static int48static int
49proc_rt6_multipath_hash_fields(struct ctl_table *table, int write, void *buffer,49proc_rt6_multipath_hash_fields(const struct ctl_table *table, int write, void *buffer,
50 size_t *lenp, loff_t *ppos)50 size_t *lenp, loff_t *ppos)
51{51{
52 struct net *net;52 struct net *net;
net/mpls/af_mpls.c+2−2
@@ -1347,7 +1347,7 @@ static int mpls_netconf_dump_devconf(struct sk_buff *skb, · 1346 unmodified lines
1347#define MPLS_PERDEV_SYSCTL_OFFSET(field) \1347#define MPLS_PERDEV_SYSCTL_OFFSET(field) \
1348 (&((struct mpls_dev *)0)->field)1348 (&((struct mpls_dev *)0)->field)
1349 1349
1350static int mpls_conf_proc(struct ctl_table *ctl, int write,1350static int mpls_conf_proc(const struct ctl_table *ctl, int write,
1351 void *buffer, size_t *lenp, loff_t *ppos)1351 void *buffer, size_t *lenp, loff_t *ppos)
1352{1352{
1353 int oval = *(int *)ctl->data;1353 int oval = *(int *)ctl->data;
@@ -2600,7 +2600,7 @@ nolabels: · 1246 unmodified lines
2600 return -ENOMEM;2600 return -ENOMEM;
2601}2601}
2602 2602
2603static int mpls_platform_labels(struct ctl_table *table, int write,2603static int mpls_platform_labels(const struct ctl_table *table, int write,
2604 void *buffer, size_t *lenp, loff_t *ppos)2604 void *buffer, size_t *lenp, loff_t *ppos)
2605{2605{
2606 struct net *net = table->data;2606 struct net *net = table->data;
net/mptcp/ctrl.c+2−2
@@ -113,7 +113,7 @@ static int mptcp_set_scheduler(const struct net *net, const char *name) · 112 unmodified lines
113 return ret;113 return ret;
114}114}
115 115
116static int proc_scheduler(struct ctl_table *ctl, int write,116static int proc_scheduler(const struct ctl_table *ctl, int write,
117 void *buffer, size_t *lenp, loff_t *ppos)117 void *buffer, size_t *lenp, loff_t *ppos)
118{118{
119 const struct net *net = current->nsproxy->net_ns;119 const struct net *net = current->nsproxy->net_ns;
@@ -133,7 +133,7 @@ static int proc_scheduler(struct ctl_table *ctl, int write, · 13 unmodified lines
133 return ret;133 return ret;
134}134}
135 135
136static int proc_available_schedulers(struct ctl_table *ctl,136static int proc_available_schedulers(const struct ctl_table *ctl,
137 int write, void *buffer,137 int write, void *buffer,
138 size_t *lenp, loff_t *ppos)138 size_t *lenp, loff_t *ppos)
139{139{
net/netfilter/ipvs/ip_vs_ctl.c+6−6
@@ -1846,7 +1846,7 @@ static int ip_vs_zero_all(struct netns_ipvs *ipvs) · 1845 unmodified lines
1846#ifdef CONFIG_SYSCTL1846#ifdef CONFIG_SYSCTL
1847 1847
1848static int1848static int
1849proc_do_defense_mode(struct ctl_table *table, int write,1849proc_do_defense_mode(const struct ctl_table *table, int write,
1850 void *buffer, size_t *lenp, loff_t *ppos)1850 void *buffer, size_t *lenp, loff_t *ppos)
1851{1851{
1852 struct netns_ipvs *ipvs = table->extra2;1852 struct netns_ipvs *ipvs = table->extra2;
@@ -1873,7 +1873,7 @@ proc_do_defense_mode(struct ctl_table *table, int write, · 20 unmodified lines
1873}1873}
1874 1874
1875static int1875static int
1876proc_do_sync_threshold(struct ctl_table *table, int write,1876proc_do_sync_threshold(const struct ctl_table *table, int write,
1877 void *buffer, size_t *lenp, loff_t *ppos)1877 void *buffer, size_t *lenp, loff_t *ppos)
1878{1878{
1879 struct netns_ipvs *ipvs = table->extra2;1879 struct netns_ipvs *ipvs = table->extra2;
@@ -1901,7 +1901,7 @@ proc_do_sync_threshold(struct ctl_table *table, int write, · 21 unmodified lines
1901}1901}
1902 1902
1903static int1903static int
1904proc_do_sync_ports(struct ctl_table *table, int write,1904proc_do_sync_ports(const struct ctl_table *table, int write,
1905 void *buffer, size_t *lenp, loff_t *ppos)1905 void *buffer, size_t *lenp, loff_t *ppos)
1906{1906{
1907 int *valp = table->data;1907 int *valp = table->data;
@@ -1984,7 +1984,7 @@ static int ipvs_proc_est_cpumask_get(const struct ctl_table *table, · 76 unmodified lines
1984 return ret;1984 return ret;
1985}1985}
1986 1986
1987static int ipvs_proc_est_cpulist(struct ctl_table *table, int write,1987static int ipvs_proc_est_cpulist(const struct ctl_table *table, int write,
1988 void *buffer, size_t *lenp, loff_t *ppos)1988 void *buffer, size_t *lenp, loff_t *ppos)
1989{1989{
1990 int ret;1990 int ret;
@@ -2011,7 +2011,7 @@ static int ipvs_proc_est_cpulist(struct ctl_table *table, int write, · 20 unmodified lines
2011 return ret;2011 return ret;
2012}2012}
2013 2013
2014static int ipvs_proc_est_nice(struct ctl_table *table, int write,2014static int ipvs_proc_est_nice(const struct ctl_table *table, int write,
2015 void *buffer, size_t *lenp, loff_t *ppos)2015 void *buffer, size_t *lenp, loff_t *ppos)
2016{2016{
2017 struct netns_ipvs *ipvs = table->extra2;2017 struct netns_ipvs *ipvs = table->extra2;
@@ -2041,7 +2041,7 @@ static int ipvs_proc_est_nice(struct ctl_table *table, int write, · 23 unmodified lines
2041 return ret;2041 return ret;
2042}2042}
2043 2043
2044static int ipvs_proc_run_estimation(struct ctl_table *table, int write,2044static int ipvs_proc_run_estimation(const struct ctl_table *table, int write,
2045 void *buffer, size_t *lenp, loff_t *ppos)2045 void *buffer, size_t *lenp, loff_t *ppos)
2046{2046{
2047 struct netns_ipvs *ipvs = table->extra2;2047 struct netns_ipvs *ipvs = table->extra2;
net/netfilter/nf_conntrack_standalone.c+1−1
@@ -524,7 +524,7 @@ EXPORT_SYMBOL_GPL(nf_conntrack_count); · 523 unmodified lines
524static unsigned int nf_conntrack_htable_size_user __read_mostly;524static unsigned int nf_conntrack_htable_size_user __read_mostly;
525 525
526static int526static int
527nf_conntrack_hash_sysctl(struct ctl_table *table, int write,527nf_conntrack_hash_sysctl(const struct ctl_table *table, int write,
528 void *buffer, size_t *lenp, loff_t *ppos)528 void *buffer, size_t *lenp, loff_t *ppos)
529{529{
530 int ret;530 int ret;
net/netfilter/nf_hooks_lwtunnel.c+1−1
@@ -28,7 +28,7 @@ static inline int nf_hooks_lwtunnel_set(int enable) · 27 unmodified lines
28}28}
29 29
30#ifdef CONFIG_SYSCTL30#ifdef CONFIG_SYSCTL
31int nf_hooks_lwtunnel_sysctl_handler(struct ctl_table *table, int write,31int nf_hooks_lwtunnel_sysctl_handler(const struct ctl_table *table, int write,
32 void *buffer, size_t *lenp, loff_t *ppos)32 void *buffer, size_t *lenp, loff_t *ppos)
33{33{
34 int proc_nf_hooks_lwtunnel_enabled = 0;34 int proc_nf_hooks_lwtunnel_enabled = 0;
net/netfilter/nf_log.c+1−1
@@ -408,7 +408,7 @@ static struct ctl_table nf_log_sysctl_ftable[] = { · 407 unmodified lines
408 },408 },
409};409};
410 410
411static int nf_log_proc_dostring(struct ctl_table *table, int write,411static int nf_log_proc_dostring(const struct ctl_table *table, int write,
412 void *buffer, size_t *lenp, loff_t *ppos)412 void *buffer, size_t *lenp, loff_t *ppos)
413{413{
414 const struct nf_logger *logger;414 const struct nf_logger *logger;
net/phonet/sysctl.c+1−1
@@ -48,7 +48,7 @@ void phonet_get_local_port_range(int *min, int *max) · 47 unmodified lines
48 } while (read_seqretry(&local_port_range_lock, seq));48 } while (read_seqretry(&local_port_range_lock, seq));
49}49}
50 50
51static int proc_local_port_range(struct ctl_table *table, int write,51static int proc_local_port_range(const struct ctl_table *table, int write,
52 void *buffer, size_t *lenp, loff_t *ppos)52 void *buffer, size_t *lenp, loff_t *ppos)
53{53{
54 int ret;54 int ret;
net/rds/tcp.c+2−2
@@ -61,7 +61,7 @@ static atomic_t rds_tcp_unloading = ATOMIC_INIT(0); · 60 unmodified lines
61 61
62static struct kmem_cache *rds_tcp_conn_slab;62static struct kmem_cache *rds_tcp_conn_slab;
63 63
64static int rds_tcp_skbuf_handler(struct ctl_table *ctl, int write,64static int rds_tcp_skbuf_handler(const struct ctl_table *ctl, int write,
65 void *buffer, size_t *lenp, loff_t *fpos);65 void *buffer, size_t *lenp, loff_t *fpos);
66 66
67static int rds_tcp_min_sndbuf = SOCK_MIN_SNDBUF;67static int rds_tcp_min_sndbuf = SOCK_MIN_SNDBUF;
@@ -682,7 +682,7 @@ static void rds_tcp_sysctl_reset(struct net *net) · 614 unmodified lines
682 spin_unlock_irq(&rds_tcp_conn_lock);682 spin_unlock_irq(&rds_tcp_conn_lock);
683}683}
684 684
685static int rds_tcp_skbuf_handler(struct ctl_table *ctl, int write,685static int rds_tcp_skbuf_handler(const struct ctl_table *ctl, int write,
686 void *buffer, size_t *lenp, loff_t *fpos)686 void *buffer, size_t *lenp, loff_t *fpos)
687{687{
688 struct net *net = current->nsproxy->net_ns;688 struct net *net = current->nsproxy->net_ns;
net/sctp/sysctl.c+14−14
@@ -43,19 +43,19 @@ static unsigned long max_autoclose_max = · 42 unmodified lines
43 (MAX_SCHEDULE_TIMEOUT / HZ > UINT_MAX)43 (MAX_SCHEDULE_TIMEOUT / HZ > UINT_MAX)
44 ? UINT_MAX : MAX_SCHEDULE_TIMEOUT / HZ;44 ? UINT_MAX : MAX_SCHEDULE_TIMEOUT / HZ;
45 45
46static int proc_sctp_do_hmac_alg(struct ctl_table *ctl, int write,46static int proc_sctp_do_hmac_alg(const struct ctl_table *ctl, int write,
47 void *buffer, size_t *lenp, loff_t *ppos);47 void *buffer, size_t *lenp, loff_t *ppos);
48static int proc_sctp_do_rto_min(struct ctl_table *ctl, int write,48static int proc_sctp_do_rto_min(const struct ctl_table *ctl, int write,
49 void *buffer, size_t *lenp, loff_t *ppos);49 void *buffer, size_t *lenp, loff_t *ppos);
50static int proc_sctp_do_rto_max(struct ctl_table *ctl, int write, void *buffer,50static int proc_sctp_do_rto_max(const struct ctl_table *ctl, int write, void *buffer,
51 size_t *lenp, loff_t *ppos);51 size_t *lenp, loff_t *ppos);
52static int proc_sctp_do_udp_port(struct ctl_table *ctl, int write, void *buffer,52static int proc_sctp_do_udp_port(const struct ctl_table *ctl, int write, void *buffer,
53 size_t *lenp, loff_t *ppos);53 size_t *lenp, loff_t *ppos);
54static int proc_sctp_do_alpha_beta(struct ctl_table *ctl, int write,54static int proc_sctp_do_alpha_beta(const struct ctl_table *ctl, int write,
55 void *buffer, size_t *lenp, loff_t *ppos);55 void *buffer, size_t *lenp, loff_t *ppos);
56static int proc_sctp_do_auth(struct ctl_table *ctl, int write,56static int proc_sctp_do_auth(const struct ctl_table *ctl, int write,
57 void *buffer, size_t *lenp, loff_t *ppos);57 void *buffer, size_t *lenp, loff_t *ppos);
58static int proc_sctp_do_probe_interval(struct ctl_table *ctl, int write,58static int proc_sctp_do_probe_interval(const struct ctl_table *ctl, int write,
59 void *buffer, size_t *lenp, loff_t *ppos);59 void *buffer, size_t *lenp, loff_t *ppos);
60 60
61static struct ctl_table sctp_table[] = {61static struct ctl_table sctp_table[] = {
@@ -384,7 +384,7 @@ static struct ctl_table sctp_net_table[] = { · 322 unmodified lines
384 },384 },
385};385};
386 386
387static int proc_sctp_do_hmac_alg(struct ctl_table *ctl, int write,387static int proc_sctp_do_hmac_alg(const struct ctl_table *ctl, int write,
388 void *buffer, size_t *lenp, loff_t *ppos)388 void *buffer, size_t *lenp, loff_t *ppos)
389{389{
390 struct net *net = current->nsproxy->net_ns;390 struct net *net = current->nsproxy->net_ns;
@@ -429,7 +429,7 @@ static int proc_sctp_do_hmac_alg(struct ctl_table *ctl, int write, · 38 unmodified lines
429 return ret;429 return ret;
430}430}
431 431
432static int proc_sctp_do_rto_min(struct ctl_table *ctl, int write,432static int proc_sctp_do_rto_min(const struct ctl_table *ctl, int write,
433 void *buffer, size_t *lenp, loff_t *ppos)433 void *buffer, size_t *lenp, loff_t *ppos)
434{434{
435 struct net *net = current->nsproxy->net_ns;435 struct net *net = current->nsproxy->net_ns;
@@ -457,7 +457,7 @@ static int proc_sctp_do_rto_min(struct ctl_table *ctl, int write, · 21 unmodified lines
457 return ret;457 return ret;
458}458}
459 459
460static int proc_sctp_do_rto_max(struct ctl_table *ctl, int write,460static int proc_sctp_do_rto_max(const struct ctl_table *ctl, int write,
461 void *buffer, size_t *lenp, loff_t *ppos)461 void *buffer, size_t *lenp, loff_t *ppos)
462{462{
463 struct net *net = current->nsproxy->net_ns;463 struct net *net = current->nsproxy->net_ns;
@@ -485,7 +485,7 @@ static int proc_sctp_do_rto_max(struct ctl_table *ctl, int write, · 21 unmodified lines
485 return ret;485 return ret;
486}486}
487 487
488static int proc_sctp_do_alpha_beta(struct ctl_table *ctl, int write,488static int proc_sctp_do_alpha_beta(const struct ctl_table *ctl, int write,
489 void *buffer, size_t *lenp, loff_t *ppos)489 void *buffer, size_t *lenp, loff_t *ppos)
490{490{
491 if (write)491 if (write)
@@ -495,7 +495,7 @@ static int proc_sctp_do_alpha_beta(struct ctl_table *ctl, int write, · 3 unmodified lines
495 return proc_dointvec_minmax(ctl, write, buffer, lenp, ppos);495 return proc_dointvec_minmax(ctl, write, buffer, lenp, ppos);
496}496}
497 497
498static int proc_sctp_do_auth(struct ctl_table *ctl, int write,498static int proc_sctp_do_auth(const struct ctl_table *ctl, int write,
499 void *buffer, size_t *lenp, loff_t *ppos)499 void *buffer, size_t *lenp, loff_t *ppos)
500{500{
501 struct net *net = current->nsproxy->net_ns;501 struct net *net = current->nsproxy->net_ns;
@@ -524,7 +524,7 @@ static int proc_sctp_do_auth(struct ctl_table *ctl, int write, · 22 unmodified lines
524 return ret;524 return ret;
525}525}
526 526
527static int proc_sctp_do_udp_port(struct ctl_table *ctl, int write,527static int proc_sctp_do_udp_port(const struct ctl_table *ctl, int write,
528 void *buffer, size_t *lenp, loff_t *ppos)528 void *buffer, size_t *lenp, loff_t *ppos)
529{529{
530 struct net *net = current->nsproxy->net_ns;530 struct net *net = current->nsproxy->net_ns;
@@ -565,7 +565,7 @@ static int proc_sctp_do_udp_port(struct ctl_table *ctl, int write, · 34 unmodified lines
565 return ret;565 return ret;
566}566}
567 567
568static int proc_sctp_do_probe_interval(struct ctl_table *ctl, int write,568static int proc_sctp_do_probe_interval(const struct ctl_table *ctl, int write,
569 void *buffer, size_t *lenp, loff_t *ppos)569 void *buffer, size_t *lenp, loff_t *ppos)
570{570{
571 struct net *net = current->nsproxy->net_ns;571 struct net *net = current->nsproxy->net_ns;
net/sunrpc/sysctl.c+2−2
@@ -40,7 +40,7 @@ EXPORT_SYMBOL_GPL(nlm_debug); · 39 unmodified lines
40 40
41#if IS_ENABLED(CONFIG_SUNRPC_DEBUG)41#if IS_ENABLED(CONFIG_SUNRPC_DEBUG)
42 42
43static int proc_do_xprt(struct ctl_table *table, int write,43static int proc_do_xprt(const struct ctl_table *table, int write,
44 void *buffer, size_t *lenp, loff_t *ppos)44 void *buffer, size_t *lenp, loff_t *ppos)
45{45{
46 char tmpbuf[256];46 char tmpbuf[256];
@@ -62,7 +62,7 @@ static int proc_do_xprt(struct ctl_table *table, int write, · 15 unmodified lines
62}62}
63 63
64static int64static int
65proc_dodebug(struct ctl_table *table, int write, void *buffer, size_t *lenp,65proc_dodebug(const struct ctl_table *table, int write, void *buffer, size_t *lenp,
66 loff_t *ppos)66 loff_t *ppos)
67{67{
68 char tmpbuf[20], *s = NULL;68 char tmpbuf[20], *s = NULL;
net/sunrpc/xprtrdma/svc_rdma.c+1−1
@@ -74,7 +74,7 @@ enum { · 73 unmodified lines
74 SVCRDMA_COUNTER_BUFSIZ = sizeof(unsigned long long),74 SVCRDMA_COUNTER_BUFSIZ = sizeof(unsigned long long),
75};75};
76 76
77static int svcrdma_counter_handler(struct ctl_table *table, int write,77static int svcrdma_counter_handler(const struct ctl_table *table, int write,
78 void *buffer, size_t *lenp, loff_t *ppos)78 void *buffer, size_t *lenp, loff_t *ppos)
79{79{
80 struct percpu_counter *stat = (struct percpu_counter *)table->data;80 struct percpu_counter *stat = (struct percpu_counter *)table->data;
security/apparmor/lsm.c+1−1
@@ -2029,7 +2029,7 @@ static int __init alloc_buffers(void) · 2028 unmodified lines
2029}2029}
2030 2030
2031#ifdef CONFIG_SYSCTL2031#ifdef CONFIG_SYSCTL
2032static int apparmor_dointvec(struct ctl_table *table, int write,2032static int apparmor_dointvec(const struct ctl_table *table, int write,
2033 void *buffer, size_t *lenp, loff_t *ppos)2033 void *buffer, size_t *lenp, loff_t *ppos)
2034{2034{
2035 if (!aa_current_policy_admin_capable(NULL))2035 if (!aa_current_policy_admin_capable(NULL))
security/min_addr.c+1−1
@@ -29,7 +29,7 @@ static void update_mmap_min_addr(void) · 28 unmodified lines
29 * sysctl handler which just sets dac_mmap_min_addr = the new value and then29 * sysctl handler which just sets dac_mmap_min_addr = the new value and then
30 * calls update_mmap_min_addr() so non MAP_FIXED hints get rounded properly30 * calls update_mmap_min_addr() so non MAP_FIXED hints get rounded properly
31 */31 */
32int mmap_min_addr_handler(struct ctl_table *table, int write,32int mmap_min_addr_handler(const struct ctl_table *table, int write,
33 void *buffer, size_t *lenp, loff_t *ppos)33 void *buffer, size_t *lenp, loff_t *ppos)
34{34{
35 int ret;35 int ret;
security/yama/yama_lsm.c+1−1
@@ -436,7 +436,7 @@ static struct security_hook_list yama_hooks[] __ro_after_init = { · 435 unmodified lines
436};436};
437 437
438#ifdef CONFIG_SYSCTL438#ifdef CONFIG_SYSCTL
439static int yama_dointvec_minmax(struct ctl_table *table, int write,439static int yama_dointvec_minmax(const struct ctl_table *table, int write,
440 void *buffer, size_t *lenp, loff_t *ppos)440 void *buffer, size_t *lenp, loff_t *ppos)
441{441{
442 struct ctl_table table_copy;442 struct ctl_table table_copy;