kernel-hacking-2024-linux-s.../kernel/trace
Joel Granados 78eb4ea25c 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.

Co-developed-by: Thomas Weißschuh <linux@weissschuh.net>
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Co-developed-by: Joel Granados <j.granados@samsung.com>
Signed-off-by: Joel Granados <j.granados@samsung.com>
2024-07-24 20:59:29 +02:00
..
rv rv: Update rv_en(dis)able_monitor doc to match kernel-doc 2024-05-21 19:03:35 -04:00
blktrace.c blktrace: convert strncpy() to strscpy_pad() 2024-04-25 21:07:08 -07:00
bpf_trace.c bpf: Change bpf_session_cookie return value to __u64 * 2024-06-21 19:32:36 +02:00
bpf_trace.h tracing/treewide: Remove second parameter of __assign_str() 2024-05-22 20:14:47 -04:00
error_report-traces.c
fgraph.c function_graph: Add READ_ONCE() when accessing fgraph_array[] 2024-06-14 12:37:08 -04:00
fprobe.c
ftrace.c sysctl: treewide: constify the ctl_table argument of proc_handlers 2024-07-24 20:59:29 +02:00
ftrace_internal.h function_graph: Make fgraph_update_pid_func() a stub for !DYNAMIC_FTRACE 2024-06-10 18:08:23 -04:00
Kconfig tracing: Build event generation tests only as modules 2024-06-12 08:43:12 +09:00
kprobe_event_gen_test.c
Makefile
pid_list.c trace/pid_list: Change gfp flags in pid_list_fill_irq() 2024-07-15 15:07:14 -04:00
pid_list.h
power-traces.c
preemptirq_delay_test.c tracing: Add MODULE_DESCRIPTION() to preemptirq_delay_test 2024-05-21 19:03:35 -04:00
rethook.c rethook: honor CONFIG_FTRACE_VALIDATE_RCU_IS_WATCHING in rethook_try_get() 2024-05-01 23:18:48 +09:00
ring_buffer.c ring-buffer: Fix a race between readers and resize checks 2024-05-21 19:03:35 -04:00
ring_buffer_benchmark.c
rpm-traces.c
synth_event_gen_test.c
trace.c sysctl: treewide: constify the ctl_table argument of proc_handlers 2024-07-24 20:59:29 +02:00
trace.h ftrace: Fix prototypes for ftrace_startup/shutdown_subops() 2024-06-06 15:22:18 -04:00
trace_benchmark.c tracing: Improve benchmark test performance by using do_div() 2024-05-13 20:00:57 -04:00
trace_benchmark.h
trace_boot.c
trace_branch.c
trace_btf.c
trace_btf.h
trace_clock.c
trace_dynevent.c
trace_dynevent.h
trace_entries.h
trace_eprobe.c
trace_event_perf.c
trace_events.c eventfs/tracing: Add callback for release of an eventfs_inode 2024-05-04 04:25:37 -04:00
trace_events_filter.c
trace_events_filter_test.h
trace_events_hist.c
trace_events_inject.c
trace_events_synth.c
trace_events_trigger.c
trace_events_user.c sysctl: treewide: constify the ctl_table argument of proc_handlers 2024-07-24 20:59:29 +02:00
trace_export.c
trace_fprobe.c tracing/probes: support '%pd' type for print struct dentry's name 2024-05-01 23:18:47 +09:00
trace_functions.c ftrace: Hide one more entry in stack trace when ftrace_pid is enabled 2024-06-06 15:22:18 -04:00
trace_functions_graph.c function_graph: Move graph notrace bit to shadow stack global var 2024-06-04 10:37:44 -04:00
trace_hwlat.c
trace_irqsoff.c function_graph: Move set_graph_function tests to shadow stack global var 2024-06-04 10:37:35 -04:00
trace_kdb.c
trace_kprobe.c tracing/kprobes: Fix build error when find_module() is not available 2024-07-10 09:47:00 +09:00
trace_kprobe_selftest.c
trace_kprobe_selftest.h
trace_mmiotrace.c
trace_nop.c
trace_osnoise.c rtla/osnoise: set the default threshold to 1us 2024-07-01 18:54:31 -04:00
trace_output.c
trace_output.h
trace_preemptirq.c
trace_printk.c
trace_probe.c tracing/probes: fix error check in parse_btf_field() 2024-05-27 21:32:35 +09:00
trace_probe.h tracing/probes: support '%pd' type for print struct dentry's name 2024-05-01 23:18:47 +09:00
trace_probe_kernel.h
trace_probe_tmpl.h
trace_recursion_record.c
trace_sched_switch.c
trace_sched_wakeup.c function_graph: Move set_graph_function tests to shadow stack global var 2024-06-04 10:37:35 -04:00
trace_selftest.c fgraph: Use str_plural() in test_graph_storage_single() 2024-07-01 19:57:51 -04:00
trace_selftest_dynamic.c
trace_seq.c
trace_stack.c sysctl: treewide: constify the ctl_table argument of proc_handlers 2024-07-24 20:59:29 +02:00
trace_stat.c
trace_stat.h
trace_synth.h
trace_syscalls.c
trace_uprobe.c uprobes: prevent mutex_lock() under rcu_read_lock() 2024-05-24 07:44:44 +09:00
tracing_map.c
tracing_map.h