2 * sysctl.c: General linux system control interface
4 * Begun 24 March 1995, Stephen Tweedie
5 * Added /proc support, Dec 1995
6 * Added bdflush entry and intvec min/max checking, 2/23/96, Tom Dyas.
7 * Added hooks for /proc/sys/net (minor, minor patch), 96/4/1, Mike Shaver.
8 * Added kernel/java-{interpreter,appletviewer}, 96/5/10, Mike Shaver.
9 * Dynamic registration fixes, Stephen Tweedie.
10 * Added kswapd-interval, ctrl-alt-del, printk stuff, 1/8/97, Chris Horn.
11 * Made sysctl support optional via CONFIG_SYSCTL, 1/10/97, Chris
13 * Added proc_doulongvec_ms_jiffies_minmax, 09/08/99, Carlos H. Bauer.
14 * Added proc_doulongvec_minmax, 09/08/99, Carlos H. Bauer.
15 * Changed linked lists to use list.h instead of lists.h, 02/24/00, Bill
17 * The list_for_each() macro wasn't appropriate for the sysctl loop.
18 * Removed it and replaced it with older style, 03/23/00, Bill Wendling
21 #include <linux/module.h>
22 #include <linux/aio.h>
24 #include <linux/swap.h>
25 #include <linux/slab.h>
26 #include <linux/sysctl.h>
27 #include <linux/bitmap.h>
28 #include <linux/signal.h>
29 #include <linux/printk.h>
30 #include <linux/proc_fs.h>
31 #include <linux/security.h>
32 #include <linux/ctype.h>
33 #include <linux/kmemcheck.h>
34 #include <linux/kmemleak.h>
36 #include <linux/init.h>
37 #include <linux/kernel.h>
38 #include <linux/kobject.h>
39 #include <linux/net.h>
40 #include <linux/sysrq.h>
41 #include <linux/highuid.h>
42 #include <linux/writeback.h>
43 #include <linux/ratelimit.h>
44 #include <linux/compaction.h>
45 #include <linux/hugetlb.h>
46 #include <linux/initrd.h>
47 #include <linux/key.h>
48 #include <linux/times.h>
49 #include <linux/limits.h>
50 #include <linux/dcache.h>
51 #include <linux/dnotify.h>
52 #include <linux/syscalls.h>
53 #include <linux/vmstat.h>
54 #include <linux/nfs_fs.h>
55 #include <linux/acpi.h>
56 #include <linux/reboot.h>
57 #include <linux/ftrace.h>
58 #include <linux/perf_event.h>
59 #include <linux/kprobes.h>
60 #include <linux/pipe_fs_i.h>
61 #include <linux/oom.h>
62 #include <linux/kmod.h>
63 #include <linux/capability.h>
64 #include <linux/binfmts.h>
65 #include <linux/sched/sysctl.h>
66 #include <linux/kexec.h>
67 #include <linux/bpf.h>
69 #include <asm/uaccess.h>
70 #include <asm/processor.h>
74 #include <asm/stacktrace.h>
78 #include <asm/setup.h>
80 #ifdef CONFIG_BSD_PROCESS_ACCT
81 #include <linux/acct.h>
83 #ifdef CONFIG_RT_MUTEXES
84 #include <linux/rtmutex.h>
86 #if defined(CONFIG_PROVE_LOCKING) || defined(CONFIG_LOCK_STAT)
87 #include <linux/lockdep.h>
89 #ifdef CONFIG_CHR_DEV_SG
93 #ifdef CONFIG_LOCKUP_DETECTOR
94 #include <linux/nmi.h>
97 #if defined(CONFIG_SYSCTL)
99 /* External variables not in a header file. */
100 extern int suid_dumpable
;
101 #ifdef CONFIG_COREDUMP
102 extern int core_uses_pid
;
103 extern char core_pattern
[];
104 extern unsigned int core_pipe_limit
;
107 extern int pid_max_min
, pid_max_max
;
108 extern int percpu_pagelist_fraction
;
109 extern int compat_log
;
110 extern int latencytop_enabled
;
111 extern int sysctl_nr_open_min
, sysctl_nr_open_max
;
113 extern int sysctl_nr_trim_pages
;
116 /* Constants used for minimum and maximum */
117 #ifdef CONFIG_LOCKUP_DETECTOR
118 static int sixty
= 60;
121 static int __maybe_unused neg_one
= -1;
124 static int __maybe_unused one
= 1;
125 static int __maybe_unused two
= 2;
126 static int __maybe_unused four
= 4;
127 static unsigned long one_ul
= 1;
128 static int one_hundred
= 100;
130 static int ten_thousand
= 10000;
133 /* this is needed for the proc_doulongvec_minmax of vm_dirty_bytes */
134 static unsigned long dirty_bytes_min
= 2 * PAGE_SIZE
;
136 /* this is needed for the proc_dointvec_minmax for [fs_]overflow UID and GID */
137 static int maxolduid
= 65535;
138 static int minolduid
;
140 static int ngroups_max
= NGROUPS_MAX
;
141 static const int cap_last_cap
= CAP_LAST_CAP
;
143 /*this is needed for proc_doulongvec_minmax of sysctl_hung_task_timeout_secs */
144 #ifdef CONFIG_DETECT_HUNG_TASK
145 static unsigned long hung_task_timeout_max
= (LONG_MAX
/HZ
);
148 #ifdef CONFIG_INOTIFY_USER
149 #include <linux/inotify.h>
155 extern int pwrsw_enabled
;
158 #ifdef CONFIG_SYSCTL_ARCH_UNALIGN_ALLOW
159 extern int unaligned_enabled
;
163 extern int unaligned_dump_stack
;
166 #ifdef CONFIG_SYSCTL_ARCH_UNALIGN_NO_WARN
167 extern int no_unaligned_warning
;
170 #ifdef CONFIG_PROC_SYSCTL
172 #define SYSCTL_WRITES_LEGACY -1
173 #define SYSCTL_WRITES_WARN 0
174 #define SYSCTL_WRITES_STRICT 1
176 static int sysctl_writes_strict
= SYSCTL_WRITES_STRICT
;
178 static int proc_do_cad_pid(struct ctl_table
*table
, int write
,
179 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
);
180 static int proc_taint(struct ctl_table
*table
, int write
,
181 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
);
185 static int proc_dointvec_minmax_sysadmin(struct ctl_table
*table
, int write
,
186 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
);
189 static int proc_dointvec_minmax_coredump(struct ctl_table
*table
, int write
,
190 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
);
191 #ifdef CONFIG_COREDUMP
192 static int proc_dostring_coredump(struct ctl_table
*table
, int write
,
193 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
);
196 #ifdef CONFIG_MAGIC_SYSRQ
197 /* Note: sysrq code uses it's own private copy */
198 static int __sysrq_enabled
= CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE
;
200 static int sysrq_sysctl_handler(struct ctl_table
*table
, int write
,
201 void __user
*buffer
, size_t *lenp
,
206 error
= proc_dointvec(table
, write
, buffer
, lenp
, ppos
);
211 sysrq_toggle_support(__sysrq_enabled
);
218 static struct ctl_table kern_table
[];
219 static struct ctl_table vm_table
[];
220 static struct ctl_table fs_table
[];
221 static struct ctl_table debug_table
[];
222 static struct ctl_table dev_table
[];
223 extern struct ctl_table random_table
[];
225 extern struct ctl_table epoll_table
[];
228 #ifdef HAVE_ARCH_PICK_MMAP_LAYOUT
229 int sysctl_legacy_va_layout
;
232 /* The default sysctl tables: */
234 static struct ctl_table sysctl_base_table
[] = {
236 .procname
= "kernel",
253 .child
= debug_table
,
263 #ifdef CONFIG_SCHED_DEBUG
264 static int min_sched_granularity_ns
= 100000; /* 100 usecs */
265 static int max_sched_granularity_ns
= NSEC_PER_SEC
; /* 1 second */
266 static int min_wakeup_granularity_ns
; /* 0 usecs */
267 static int max_wakeup_granularity_ns
= NSEC_PER_SEC
; /* 1 second */
269 static int min_sched_tunable_scaling
= SCHED_TUNABLESCALING_NONE
;
270 static int max_sched_tunable_scaling
= SCHED_TUNABLESCALING_END
-1;
271 #endif /* CONFIG_SMP */
272 #endif /* CONFIG_SCHED_DEBUG */
274 #ifdef CONFIG_COMPACTION
275 static int min_extfrag_threshold
;
276 static int max_extfrag_threshold
= 1000;
279 static struct ctl_table kern_table
[] = {
281 .procname
= "sched_child_runs_first",
282 .data
= &sysctl_sched_child_runs_first
,
283 .maxlen
= sizeof(unsigned int),
285 .proc_handler
= proc_dointvec
,
287 #ifdef CONFIG_SCHED_DEBUG
289 .procname
= "sched_min_granularity_ns",
290 .data
= &sysctl_sched_min_granularity
,
291 .maxlen
= sizeof(unsigned int),
293 .proc_handler
= sched_proc_update_handler
,
294 .extra1
= &min_sched_granularity_ns
,
295 .extra2
= &max_sched_granularity_ns
,
298 .procname
= "sched_latency_ns",
299 .data
= &sysctl_sched_latency
,
300 .maxlen
= sizeof(unsigned int),
302 .proc_handler
= sched_proc_update_handler
,
303 .extra1
= &min_sched_granularity_ns
,
304 .extra2
= &max_sched_granularity_ns
,
307 .procname
= "sched_wakeup_granularity_ns",
308 .data
= &sysctl_sched_wakeup_granularity
,
309 .maxlen
= sizeof(unsigned int),
311 .proc_handler
= sched_proc_update_handler
,
312 .extra1
= &min_wakeup_granularity_ns
,
313 .extra2
= &max_wakeup_granularity_ns
,
317 .procname
= "sched_tunable_scaling",
318 .data
= &sysctl_sched_tunable_scaling
,
319 .maxlen
= sizeof(enum sched_tunable_scaling
),
321 .proc_handler
= sched_proc_update_handler
,
322 .extra1
= &min_sched_tunable_scaling
,
323 .extra2
= &max_sched_tunable_scaling
,
326 .procname
= "sched_migration_cost_ns",
327 .data
= &sysctl_sched_migration_cost
,
328 .maxlen
= sizeof(unsigned int),
330 .proc_handler
= proc_dointvec
,
333 .procname
= "sched_nr_migrate",
334 .data
= &sysctl_sched_nr_migrate
,
335 .maxlen
= sizeof(unsigned int),
337 .proc_handler
= proc_dointvec
,
340 .procname
= "sched_time_avg_ms",
341 .data
= &sysctl_sched_time_avg
,
342 .maxlen
= sizeof(unsigned int),
344 .proc_handler
= proc_dointvec
,
347 .procname
= "sched_shares_window_ns",
348 .data
= &sysctl_sched_shares_window
,
349 .maxlen
= sizeof(unsigned int),
351 .proc_handler
= proc_dointvec
,
353 #endif /* CONFIG_SMP */
354 #ifdef CONFIG_NUMA_BALANCING
356 .procname
= "numa_balancing_scan_delay_ms",
357 .data
= &sysctl_numa_balancing_scan_delay
,
358 .maxlen
= sizeof(unsigned int),
360 .proc_handler
= proc_dointvec
,
363 .procname
= "numa_balancing_scan_period_min_ms",
364 .data
= &sysctl_numa_balancing_scan_period_min
,
365 .maxlen
= sizeof(unsigned int),
367 .proc_handler
= proc_dointvec
,
370 .procname
= "numa_balancing_scan_period_max_ms",
371 .data
= &sysctl_numa_balancing_scan_period_max
,
372 .maxlen
= sizeof(unsigned int),
374 .proc_handler
= proc_dointvec
,
377 .procname
= "numa_balancing_scan_size_mb",
378 .data
= &sysctl_numa_balancing_scan_size
,
379 .maxlen
= sizeof(unsigned int),
381 .proc_handler
= proc_dointvec_minmax
,
385 .procname
= "numa_balancing",
386 .data
= NULL
, /* filled in by handler */
387 .maxlen
= sizeof(unsigned int),
389 .proc_handler
= sysctl_numa_balancing
,
393 #endif /* CONFIG_NUMA_BALANCING */
394 #endif /* CONFIG_SCHED_DEBUG */
396 .procname
= "sched_rt_period_us",
397 .data
= &sysctl_sched_rt_period
,
398 .maxlen
= sizeof(unsigned int),
400 .proc_handler
= sched_rt_handler
,
403 .procname
= "sched_rt_runtime_us",
404 .data
= &sysctl_sched_rt_runtime
,
405 .maxlen
= sizeof(int),
407 .proc_handler
= sched_rt_handler
,
410 .procname
= "sched_rr_timeslice_ms",
411 .data
= &sched_rr_timeslice
,
412 .maxlen
= sizeof(int),
414 .proc_handler
= sched_rr_handler
,
416 #ifdef CONFIG_SCHED_AUTOGROUP
418 .procname
= "sched_autogroup_enabled",
419 .data
= &sysctl_sched_autogroup_enabled
,
420 .maxlen
= sizeof(unsigned int),
422 .proc_handler
= proc_dointvec_minmax
,
427 #ifdef CONFIG_CFS_BANDWIDTH
429 .procname
= "sched_cfs_bandwidth_slice_us",
430 .data
= &sysctl_sched_cfs_bandwidth_slice
,
431 .maxlen
= sizeof(unsigned int),
433 .proc_handler
= proc_dointvec_minmax
,
437 #ifdef CONFIG_PROVE_LOCKING
439 .procname
= "prove_locking",
440 .data
= &prove_locking
,
441 .maxlen
= sizeof(int),
443 .proc_handler
= proc_dointvec
,
446 #ifdef CONFIG_LOCK_STAT
448 .procname
= "lock_stat",
450 .maxlen
= sizeof(int),
452 .proc_handler
= proc_dointvec
,
457 .data
= &panic_timeout
,
458 .maxlen
= sizeof(int),
460 .proc_handler
= proc_dointvec
,
462 #ifdef CONFIG_COREDUMP
464 .procname
= "core_uses_pid",
465 .data
= &core_uses_pid
,
466 .maxlen
= sizeof(int),
468 .proc_handler
= proc_dointvec
,
471 .procname
= "core_pattern",
472 .data
= core_pattern
,
473 .maxlen
= CORENAME_MAX_SIZE
,
475 .proc_handler
= proc_dostring_coredump
,
478 .procname
= "core_pipe_limit",
479 .data
= &core_pipe_limit
,
480 .maxlen
= sizeof(unsigned int),
482 .proc_handler
= proc_dointvec
,
485 #ifdef CONFIG_PROC_SYSCTL
487 .procname
= "tainted",
488 .maxlen
= sizeof(long),
490 .proc_handler
= proc_taint
,
493 .procname
= "sysctl_writes_strict",
494 .data
= &sysctl_writes_strict
,
495 .maxlen
= sizeof(int),
497 .proc_handler
= proc_dointvec_minmax
,
502 #ifdef CONFIG_LATENCYTOP
504 .procname
= "latencytop",
505 .data
= &latencytop_enabled
,
506 .maxlen
= sizeof(int),
508 .proc_handler
= proc_dointvec
,
511 #ifdef CONFIG_BLK_DEV_INITRD
513 .procname
= "real-root-dev",
514 .data
= &real_root_dev
,
515 .maxlen
= sizeof(int),
517 .proc_handler
= proc_dointvec
,
521 .procname
= "print-fatal-signals",
522 .data
= &print_fatal_signals
,
523 .maxlen
= sizeof(int),
525 .proc_handler
= proc_dointvec
,
529 .procname
= "reboot-cmd",
530 .data
= reboot_command
,
533 .proc_handler
= proc_dostring
,
536 .procname
= "stop-a",
537 .data
= &stop_a_enabled
,
538 .maxlen
= sizeof (int),
540 .proc_handler
= proc_dointvec
,
543 .procname
= "scons-poweroff",
544 .data
= &scons_pwroff
,
545 .maxlen
= sizeof (int),
547 .proc_handler
= proc_dointvec
,
550 #ifdef CONFIG_SPARC64
552 .procname
= "tsb-ratio",
553 .data
= &sysctl_tsb_ratio
,
554 .maxlen
= sizeof (int),
556 .proc_handler
= proc_dointvec
,
561 .procname
= "soft-power",
562 .data
= &pwrsw_enabled
,
563 .maxlen
= sizeof (int),
565 .proc_handler
= proc_dointvec
,
568 #ifdef CONFIG_SYSCTL_ARCH_UNALIGN_ALLOW
570 .procname
= "unaligned-trap",
571 .data
= &unaligned_enabled
,
572 .maxlen
= sizeof (int),
574 .proc_handler
= proc_dointvec
,
578 .procname
= "ctrl-alt-del",
580 .maxlen
= sizeof(int),
582 .proc_handler
= proc_dointvec
,
584 #ifdef CONFIG_FUNCTION_TRACER
586 .procname
= "ftrace_enabled",
587 .data
= &ftrace_enabled
,
588 .maxlen
= sizeof(int),
590 .proc_handler
= ftrace_enable_sysctl
,
593 #ifdef CONFIG_STACK_TRACER
595 .procname
= "stack_tracer_enabled",
596 .data
= &stack_tracer_enabled
,
597 .maxlen
= sizeof(int),
599 .proc_handler
= stack_trace_sysctl
,
602 #ifdef CONFIG_TRACING
604 .procname
= "ftrace_dump_on_oops",
605 .data
= &ftrace_dump_on_oops
,
606 .maxlen
= sizeof(int),
608 .proc_handler
= proc_dointvec
,
611 .procname
= "traceoff_on_warning",
612 .data
= &__disable_trace_on_warning
,
613 .maxlen
= sizeof(__disable_trace_on_warning
),
615 .proc_handler
= proc_dointvec
,
618 .procname
= "tracepoint_printk",
619 .data
= &tracepoint_printk
,
620 .maxlen
= sizeof(tracepoint_printk
),
622 .proc_handler
= proc_dointvec
,
625 #ifdef CONFIG_KEXEC_CORE
627 .procname
= "kexec_load_disabled",
628 .data
= &kexec_load_disabled
,
629 .maxlen
= sizeof(int),
631 /* only handle a transition from default "0" to "1" */
632 .proc_handler
= proc_dointvec_minmax
,
637 #ifdef CONFIG_MODULES
639 .procname
= "modprobe",
640 .data
= &modprobe_path
,
641 .maxlen
= KMOD_PATH_LEN
,
643 .proc_handler
= proc_dostring
,
646 .procname
= "modules_disabled",
647 .data
= &modules_disabled
,
648 .maxlen
= sizeof(int),
650 /* only handle a transition from default "0" to "1" */
651 .proc_handler
= proc_dointvec_minmax
,
656 #ifdef CONFIG_UEVENT_HELPER
658 .procname
= "hotplug",
659 .data
= &uevent_helper
,
660 .maxlen
= UEVENT_HELPER_PATH_LEN
,
662 .proc_handler
= proc_dostring
,
665 #ifdef CONFIG_CHR_DEV_SG
667 .procname
= "sg-big-buff",
668 .data
= &sg_big_buff
,
669 .maxlen
= sizeof (int),
671 .proc_handler
= proc_dointvec
,
674 #ifdef CONFIG_BSD_PROCESS_ACCT
678 .maxlen
= 3*sizeof(int),
680 .proc_handler
= proc_dointvec
,
683 #ifdef CONFIG_MAGIC_SYSRQ
686 .data
= &__sysrq_enabled
,
687 .maxlen
= sizeof (int),
689 .proc_handler
= sysrq_sysctl_handler
,
692 #ifdef CONFIG_PROC_SYSCTL
694 .procname
= "cad_pid",
696 .maxlen
= sizeof (int),
698 .proc_handler
= proc_do_cad_pid
,
702 .procname
= "threads-max",
704 .maxlen
= sizeof(int),
706 .proc_handler
= sysctl_max_threads
,
709 .procname
= "random",
711 .child
= random_table
,
714 .procname
= "usermodehelper",
716 .child
= usermodehelper_table
,
719 .procname
= "overflowuid",
720 .data
= &overflowuid
,
721 .maxlen
= sizeof(int),
723 .proc_handler
= proc_dointvec_minmax
,
724 .extra1
= &minolduid
,
725 .extra2
= &maxolduid
,
728 .procname
= "overflowgid",
729 .data
= &overflowgid
,
730 .maxlen
= sizeof(int),
732 .proc_handler
= proc_dointvec_minmax
,
733 .extra1
= &minolduid
,
734 .extra2
= &maxolduid
,
737 #ifdef CONFIG_MATHEMU
739 .procname
= "ieee_emulation_warnings",
740 .data
= &sysctl_ieee_emulation_warnings
,
741 .maxlen
= sizeof(int),
743 .proc_handler
= proc_dointvec
,
747 .procname
= "userprocess_debug",
748 .data
= &show_unhandled_signals
,
749 .maxlen
= sizeof(int),
751 .proc_handler
= proc_dointvec
,
755 .procname
= "pid_max",
757 .maxlen
= sizeof (int),
759 .proc_handler
= proc_dointvec_minmax
,
760 .extra1
= &pid_max_min
,
761 .extra2
= &pid_max_max
,
764 .procname
= "panic_on_oops",
765 .data
= &panic_on_oops
,
766 .maxlen
= sizeof(int),
768 .proc_handler
= proc_dointvec
,
770 #if defined CONFIG_PRINTK
772 .procname
= "printk",
773 .data
= &console_loglevel
,
774 .maxlen
= 4*sizeof(int),
776 .proc_handler
= proc_dointvec
,
779 .procname
= "printk_ratelimit",
780 .data
= &printk_ratelimit_state
.interval
,
781 .maxlen
= sizeof(int),
783 .proc_handler
= proc_dointvec_jiffies
,
786 .procname
= "printk_ratelimit_burst",
787 .data
= &printk_ratelimit_state
.burst
,
788 .maxlen
= sizeof(int),
790 .proc_handler
= proc_dointvec
,
793 .procname
= "printk_delay",
794 .data
= &printk_delay_msec
,
795 .maxlen
= sizeof(int),
797 .proc_handler
= proc_dointvec_minmax
,
799 .extra2
= &ten_thousand
,
802 .procname
= "dmesg_restrict",
803 .data
= &dmesg_restrict
,
804 .maxlen
= sizeof(int),
806 .proc_handler
= proc_dointvec_minmax_sysadmin
,
811 .procname
= "kptr_restrict",
812 .data
= &kptr_restrict
,
813 .maxlen
= sizeof(int),
815 .proc_handler
= proc_dointvec_minmax_sysadmin
,
821 .procname
= "ngroups_max",
822 .data
= &ngroups_max
,
823 .maxlen
= sizeof (int),
825 .proc_handler
= proc_dointvec
,
828 .procname
= "cap_last_cap",
829 .data
= (void *)&cap_last_cap
,
830 .maxlen
= sizeof(int),
832 .proc_handler
= proc_dointvec
,
834 #if defined(CONFIG_LOCKUP_DETECTOR)
836 .procname
= "watchdog",
837 .data
= &watchdog_user_enabled
,
838 .maxlen
= sizeof (int),
840 .proc_handler
= proc_watchdog
,
845 .procname
= "watchdog_thresh",
846 .data
= &watchdog_thresh
,
847 .maxlen
= sizeof(int),
849 .proc_handler
= proc_watchdog_thresh
,
854 .procname
= "nmi_watchdog",
855 .data
= &nmi_watchdog_enabled
,
856 .maxlen
= sizeof (int),
858 .proc_handler
= proc_nmi_watchdog
,
860 #if defined(CONFIG_HAVE_NMI_WATCHDOG) || defined(CONFIG_HARDLOCKUP_DETECTOR)
867 .procname
= "soft_watchdog",
868 .data
= &soft_watchdog_enabled
,
869 .maxlen
= sizeof (int),
871 .proc_handler
= proc_soft_watchdog
,
876 .procname
= "watchdog_cpumask",
877 .data
= &watchdog_cpumask_bits
,
880 .proc_handler
= proc_watchdog_cpumask
,
883 .procname
= "softlockup_panic",
884 .data
= &softlockup_panic
,
885 .maxlen
= sizeof(int),
887 .proc_handler
= proc_dointvec_minmax
,
891 #ifdef CONFIG_HARDLOCKUP_DETECTOR
893 .procname
= "hardlockup_panic",
894 .data
= &hardlockup_panic
,
895 .maxlen
= sizeof(int),
897 .proc_handler
= proc_dointvec_minmax
,
904 .procname
= "softlockup_all_cpu_backtrace",
905 .data
= &sysctl_softlockup_all_cpu_backtrace
,
906 .maxlen
= sizeof(int),
908 .proc_handler
= proc_dointvec_minmax
,
913 .procname
= "hardlockup_all_cpu_backtrace",
914 .data
= &sysctl_hardlockup_all_cpu_backtrace
,
915 .maxlen
= sizeof(int),
917 .proc_handler
= proc_dointvec_minmax
,
921 #endif /* CONFIG_SMP */
923 #if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86)
925 .procname
= "unknown_nmi_panic",
926 .data
= &unknown_nmi_panic
,
927 .maxlen
= sizeof (int),
929 .proc_handler
= proc_dointvec
,
932 #if defined(CONFIG_X86)
934 .procname
= "panic_on_unrecovered_nmi",
935 .data
= &panic_on_unrecovered_nmi
,
936 .maxlen
= sizeof(int),
938 .proc_handler
= proc_dointvec
,
941 .procname
= "panic_on_io_nmi",
942 .data
= &panic_on_io_nmi
,
943 .maxlen
= sizeof(int),
945 .proc_handler
= proc_dointvec
,
947 #ifdef CONFIG_DEBUG_STACKOVERFLOW
949 .procname
= "panic_on_stackoverflow",
950 .data
= &sysctl_panic_on_stackoverflow
,
951 .maxlen
= sizeof(int),
953 .proc_handler
= proc_dointvec
,
957 .procname
= "bootloader_type",
958 .data
= &bootloader_type
,
959 .maxlen
= sizeof (int),
961 .proc_handler
= proc_dointvec
,
964 .procname
= "bootloader_version",
965 .data
= &bootloader_version
,
966 .maxlen
= sizeof (int),
968 .proc_handler
= proc_dointvec
,
971 .procname
= "kstack_depth_to_print",
972 .data
= &kstack_depth_to_print
,
973 .maxlen
= sizeof(int),
975 .proc_handler
= proc_dointvec
,
978 .procname
= "io_delay_type",
979 .data
= &io_delay_type
,
980 .maxlen
= sizeof(int),
982 .proc_handler
= proc_dointvec
,
985 #if defined(CONFIG_MMU)
987 .procname
= "randomize_va_space",
988 .data
= &randomize_va_space
,
989 .maxlen
= sizeof(int),
991 .proc_handler
= proc_dointvec
,
994 #if defined(CONFIG_S390) && defined(CONFIG_SMP)
996 .procname
= "spin_retry",
998 .maxlen
= sizeof (int),
1000 .proc_handler
= proc_dointvec
,
1003 #if defined(CONFIG_ACPI_SLEEP) && defined(CONFIG_X86)
1005 .procname
= "acpi_video_flags",
1006 .data
= &acpi_realmode_flags
,
1007 .maxlen
= sizeof (unsigned long),
1009 .proc_handler
= proc_doulongvec_minmax
,
1012 #ifdef CONFIG_SYSCTL_ARCH_UNALIGN_NO_WARN
1014 .procname
= "ignore-unaligned-usertrap",
1015 .data
= &no_unaligned_warning
,
1016 .maxlen
= sizeof (int),
1018 .proc_handler
= proc_dointvec
,
1023 .procname
= "unaligned-dump-stack",
1024 .data
= &unaligned_dump_stack
,
1025 .maxlen
= sizeof (int),
1027 .proc_handler
= proc_dointvec
,
1030 #ifdef CONFIG_DETECT_HUNG_TASK
1032 .procname
= "hung_task_panic",
1033 .data
= &sysctl_hung_task_panic
,
1034 .maxlen
= sizeof(int),
1036 .proc_handler
= proc_dointvec_minmax
,
1041 .procname
= "hung_task_check_count",
1042 .data
= &sysctl_hung_task_check_count
,
1043 .maxlen
= sizeof(int),
1045 .proc_handler
= proc_dointvec_minmax
,
1049 .procname
= "hung_task_timeout_secs",
1050 .data
= &sysctl_hung_task_timeout_secs
,
1051 .maxlen
= sizeof(unsigned long),
1053 .proc_handler
= proc_dohung_task_timeout_secs
,
1054 .extra2
= &hung_task_timeout_max
,
1057 .procname
= "hung_task_warnings",
1058 .data
= &sysctl_hung_task_warnings
,
1059 .maxlen
= sizeof(int),
1061 .proc_handler
= proc_dointvec_minmax
,
1065 #ifdef CONFIG_COMPAT
1067 .procname
= "compat-log",
1068 .data
= &compat_log
,
1069 .maxlen
= sizeof (int),
1071 .proc_handler
= proc_dointvec
,
1074 #ifdef CONFIG_RT_MUTEXES
1076 .procname
= "max_lock_depth",
1077 .data
= &max_lock_depth
,
1078 .maxlen
= sizeof(int),
1080 .proc_handler
= proc_dointvec
,
1084 .procname
= "poweroff_cmd",
1085 .data
= &poweroff_cmd
,
1086 .maxlen
= POWEROFF_CMD_PATH_LEN
,
1088 .proc_handler
= proc_dostring
,
1094 .child
= key_sysctls
,
1097 #ifdef CONFIG_PERF_EVENTS
1099 * User-space scripts rely on the existence of this file
1100 * as a feature check for perf_events being enabled.
1102 * So it's an ABI, do not remove!
1105 .procname
= "perf_event_paranoid",
1106 .data
= &sysctl_perf_event_paranoid
,
1107 .maxlen
= sizeof(sysctl_perf_event_paranoid
),
1109 .proc_handler
= proc_dointvec
,
1112 .procname
= "perf_event_mlock_kb",
1113 .data
= &sysctl_perf_event_mlock
,
1114 .maxlen
= sizeof(sysctl_perf_event_mlock
),
1116 .proc_handler
= proc_dointvec
,
1119 .procname
= "perf_event_max_sample_rate",
1120 .data
= &sysctl_perf_event_sample_rate
,
1121 .maxlen
= sizeof(sysctl_perf_event_sample_rate
),
1123 .proc_handler
= perf_proc_update_handler
,
1127 .procname
= "perf_cpu_time_max_percent",
1128 .data
= &sysctl_perf_cpu_time_max_percent
,
1129 .maxlen
= sizeof(sysctl_perf_cpu_time_max_percent
),
1131 .proc_handler
= perf_cpu_time_max_percent_handler
,
1133 .extra2
= &one_hundred
,
1136 #ifdef CONFIG_KMEMCHECK
1138 .procname
= "kmemcheck",
1139 .data
= &kmemcheck_enabled
,
1140 .maxlen
= sizeof(int),
1142 .proc_handler
= proc_dointvec
,
1146 .procname
= "panic_on_warn",
1147 .data
= &panic_on_warn
,
1148 .maxlen
= sizeof(int),
1150 .proc_handler
= proc_dointvec_minmax
,
1154 #if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ_COMMON)
1156 .procname
= "timer_migration",
1157 .data
= &sysctl_timer_migration
,
1158 .maxlen
= sizeof(unsigned int),
1160 .proc_handler
= timer_migration_handler
,
1163 #ifdef CONFIG_BPF_SYSCALL
1165 .procname
= "unprivileged_bpf_disabled",
1166 .data
= &sysctl_unprivileged_bpf_disabled
,
1167 .maxlen
= sizeof(sysctl_unprivileged_bpf_disabled
),
1169 /* only handle a transition from default "0" to "1" */
1170 .proc_handler
= proc_dointvec_minmax
,
1178 static struct ctl_table vm_table
[] = {
1180 .procname
= "overcommit_memory",
1181 .data
= &sysctl_overcommit_memory
,
1182 .maxlen
= sizeof(sysctl_overcommit_memory
),
1184 .proc_handler
= proc_dointvec_minmax
,
1189 .procname
= "panic_on_oom",
1190 .data
= &sysctl_panic_on_oom
,
1191 .maxlen
= sizeof(sysctl_panic_on_oom
),
1193 .proc_handler
= proc_dointvec_minmax
,
1198 .procname
= "oom_kill_allocating_task",
1199 .data
= &sysctl_oom_kill_allocating_task
,
1200 .maxlen
= sizeof(sysctl_oom_kill_allocating_task
),
1202 .proc_handler
= proc_dointvec
,
1205 .procname
= "oom_dump_tasks",
1206 .data
= &sysctl_oom_dump_tasks
,
1207 .maxlen
= sizeof(sysctl_oom_dump_tasks
),
1209 .proc_handler
= proc_dointvec
,
1212 .procname
= "overcommit_ratio",
1213 .data
= &sysctl_overcommit_ratio
,
1214 .maxlen
= sizeof(sysctl_overcommit_ratio
),
1216 .proc_handler
= overcommit_ratio_handler
,
1219 .procname
= "overcommit_kbytes",
1220 .data
= &sysctl_overcommit_kbytes
,
1221 .maxlen
= sizeof(sysctl_overcommit_kbytes
),
1223 .proc_handler
= overcommit_kbytes_handler
,
1226 .procname
= "page-cluster",
1227 .data
= &page_cluster
,
1228 .maxlen
= sizeof(int),
1230 .proc_handler
= proc_dointvec_minmax
,
1234 .procname
= "dirty_background_ratio",
1235 .data
= &dirty_background_ratio
,
1236 .maxlen
= sizeof(dirty_background_ratio
),
1238 .proc_handler
= dirty_background_ratio_handler
,
1240 .extra2
= &one_hundred
,
1243 .procname
= "dirty_background_bytes",
1244 .data
= &dirty_background_bytes
,
1245 .maxlen
= sizeof(dirty_background_bytes
),
1247 .proc_handler
= dirty_background_bytes_handler
,
1251 .procname
= "dirty_ratio",
1252 .data
= &vm_dirty_ratio
,
1253 .maxlen
= sizeof(vm_dirty_ratio
),
1255 .proc_handler
= dirty_ratio_handler
,
1257 .extra2
= &one_hundred
,
1260 .procname
= "dirty_bytes",
1261 .data
= &vm_dirty_bytes
,
1262 .maxlen
= sizeof(vm_dirty_bytes
),
1264 .proc_handler
= dirty_bytes_handler
,
1265 .extra1
= &dirty_bytes_min
,
1268 .procname
= "dirty_writeback_centisecs",
1269 .data
= &dirty_writeback_interval
,
1270 .maxlen
= sizeof(dirty_writeback_interval
),
1272 .proc_handler
= dirty_writeback_centisecs_handler
,
1275 .procname
= "dirty_expire_centisecs",
1276 .data
= &dirty_expire_interval
,
1277 .maxlen
= sizeof(dirty_expire_interval
),
1279 .proc_handler
= proc_dointvec_minmax
,
1283 .procname
= "dirtytime_expire_seconds",
1284 .data
= &dirtytime_expire_interval
,
1285 .maxlen
= sizeof(dirty_expire_interval
),
1287 .proc_handler
= dirtytime_interval_handler
,
1291 .procname
= "nr_pdflush_threads",
1292 .mode
= 0444 /* read-only */,
1293 .proc_handler
= pdflush_proc_obsolete
,
1296 .procname
= "swappiness",
1297 .data
= &vm_swappiness
,
1298 .maxlen
= sizeof(vm_swappiness
),
1300 .proc_handler
= proc_dointvec_minmax
,
1302 .extra2
= &one_hundred
,
1304 #ifdef CONFIG_HUGETLB_PAGE
1306 .procname
= "nr_hugepages",
1308 .maxlen
= sizeof(unsigned long),
1310 .proc_handler
= hugetlb_sysctl_handler
,
1314 .procname
= "nr_hugepages_mempolicy",
1316 .maxlen
= sizeof(unsigned long),
1318 .proc_handler
= &hugetlb_mempolicy_sysctl_handler
,
1322 .procname
= "hugetlb_shm_group",
1323 .data
= &sysctl_hugetlb_shm_group
,
1324 .maxlen
= sizeof(gid_t
),
1326 .proc_handler
= proc_dointvec
,
1329 .procname
= "hugepages_treat_as_movable",
1330 .data
= &hugepages_treat_as_movable
,
1331 .maxlen
= sizeof(int),
1333 .proc_handler
= proc_dointvec
,
1336 .procname
= "nr_overcommit_hugepages",
1338 .maxlen
= sizeof(unsigned long),
1340 .proc_handler
= hugetlb_overcommit_handler
,
1344 .procname
= "lowmem_reserve_ratio",
1345 .data
= &sysctl_lowmem_reserve_ratio
,
1346 .maxlen
= sizeof(sysctl_lowmem_reserve_ratio
),
1348 .proc_handler
= lowmem_reserve_ratio_sysctl_handler
,
1351 .procname
= "drop_caches",
1352 .data
= &sysctl_drop_caches
,
1353 .maxlen
= sizeof(int),
1355 .proc_handler
= drop_caches_sysctl_handler
,
1359 #ifdef CONFIG_COMPACTION
1361 .procname
= "compact_memory",
1362 .data
= &sysctl_compact_memory
,
1363 .maxlen
= sizeof(int),
1365 .proc_handler
= sysctl_compaction_handler
,
1368 .procname
= "extfrag_threshold",
1369 .data
= &sysctl_extfrag_threshold
,
1370 .maxlen
= sizeof(int),
1372 .proc_handler
= sysctl_extfrag_handler
,
1373 .extra1
= &min_extfrag_threshold
,
1374 .extra2
= &max_extfrag_threshold
,
1377 .procname
= "compact_unevictable_allowed",
1378 .data
= &sysctl_compact_unevictable_allowed
,
1379 .maxlen
= sizeof(int),
1381 .proc_handler
= proc_dointvec
,
1386 #endif /* CONFIG_COMPACTION */
1388 .procname
= "min_free_kbytes",
1389 .data
= &min_free_kbytes
,
1390 .maxlen
= sizeof(min_free_kbytes
),
1392 .proc_handler
= min_free_kbytes_sysctl_handler
,
1396 .procname
= "percpu_pagelist_fraction",
1397 .data
= &percpu_pagelist_fraction
,
1398 .maxlen
= sizeof(percpu_pagelist_fraction
),
1400 .proc_handler
= percpu_pagelist_fraction_sysctl_handler
,
1405 .procname
= "max_map_count",
1406 .data
= &sysctl_max_map_count
,
1407 .maxlen
= sizeof(sysctl_max_map_count
),
1409 .proc_handler
= proc_dointvec_minmax
,
1414 .procname
= "nr_trim_pages",
1415 .data
= &sysctl_nr_trim_pages
,
1416 .maxlen
= sizeof(sysctl_nr_trim_pages
),
1418 .proc_handler
= proc_dointvec_minmax
,
1423 .procname
= "laptop_mode",
1424 .data
= &laptop_mode
,
1425 .maxlen
= sizeof(laptop_mode
),
1427 .proc_handler
= proc_dointvec_jiffies
,
1430 .procname
= "block_dump",
1431 .data
= &block_dump
,
1432 .maxlen
= sizeof(block_dump
),
1434 .proc_handler
= proc_dointvec
,
1438 .procname
= "vfs_cache_pressure",
1439 .data
= &sysctl_vfs_cache_pressure
,
1440 .maxlen
= sizeof(sysctl_vfs_cache_pressure
),
1442 .proc_handler
= proc_dointvec
,
1445 #ifdef HAVE_ARCH_PICK_MMAP_LAYOUT
1447 .procname
= "legacy_va_layout",
1448 .data
= &sysctl_legacy_va_layout
,
1449 .maxlen
= sizeof(sysctl_legacy_va_layout
),
1451 .proc_handler
= proc_dointvec
,
1457 .procname
= "zone_reclaim_mode",
1458 .data
= &zone_reclaim_mode
,
1459 .maxlen
= sizeof(zone_reclaim_mode
),
1461 .proc_handler
= proc_dointvec
,
1465 .procname
= "min_unmapped_ratio",
1466 .data
= &sysctl_min_unmapped_ratio
,
1467 .maxlen
= sizeof(sysctl_min_unmapped_ratio
),
1469 .proc_handler
= sysctl_min_unmapped_ratio_sysctl_handler
,
1471 .extra2
= &one_hundred
,
1474 .procname
= "min_slab_ratio",
1475 .data
= &sysctl_min_slab_ratio
,
1476 .maxlen
= sizeof(sysctl_min_slab_ratio
),
1478 .proc_handler
= sysctl_min_slab_ratio_sysctl_handler
,
1480 .extra2
= &one_hundred
,
1485 .procname
= "stat_interval",
1486 .data
= &sysctl_stat_interval
,
1487 .maxlen
= sizeof(sysctl_stat_interval
),
1489 .proc_handler
= proc_dointvec_jiffies
,
1494 .procname
= "mmap_min_addr",
1495 .data
= &dac_mmap_min_addr
,
1496 .maxlen
= sizeof(unsigned long),
1498 .proc_handler
= mmap_min_addr_handler
,
1503 .procname
= "numa_zonelist_order",
1504 .data
= &numa_zonelist_order
,
1505 .maxlen
= NUMA_ZONELIST_ORDER_LEN
,
1507 .proc_handler
= numa_zonelist_order_handler
,
1510 #if (defined(CONFIG_X86_32) && !defined(CONFIG_UML))|| \
1511 (defined(CONFIG_SUPERH) && defined(CONFIG_VSYSCALL))
1513 .procname
= "vdso_enabled",
1514 #ifdef CONFIG_X86_32
1515 .data
= &vdso32_enabled
,
1516 .maxlen
= sizeof(vdso32_enabled
),
1518 .data
= &vdso_enabled
,
1519 .maxlen
= sizeof(vdso_enabled
),
1522 .proc_handler
= proc_dointvec
,
1526 #ifdef CONFIG_HIGHMEM
1528 .procname
= "highmem_is_dirtyable",
1529 .data
= &vm_highmem_is_dirtyable
,
1530 .maxlen
= sizeof(vm_highmem_is_dirtyable
),
1532 .proc_handler
= proc_dointvec_minmax
,
1537 #ifdef CONFIG_MEMORY_FAILURE
1539 .procname
= "memory_failure_early_kill",
1540 .data
= &sysctl_memory_failure_early_kill
,
1541 .maxlen
= sizeof(sysctl_memory_failure_early_kill
),
1543 .proc_handler
= proc_dointvec_minmax
,
1548 .procname
= "memory_failure_recovery",
1549 .data
= &sysctl_memory_failure_recovery
,
1550 .maxlen
= sizeof(sysctl_memory_failure_recovery
),
1552 .proc_handler
= proc_dointvec_minmax
,
1558 .procname
= "user_reserve_kbytes",
1559 .data
= &sysctl_user_reserve_kbytes
,
1560 .maxlen
= sizeof(sysctl_user_reserve_kbytes
),
1562 .proc_handler
= proc_doulongvec_minmax
,
1565 .procname
= "admin_reserve_kbytes",
1566 .data
= &sysctl_admin_reserve_kbytes
,
1567 .maxlen
= sizeof(sysctl_admin_reserve_kbytes
),
1569 .proc_handler
= proc_doulongvec_minmax
,
1571 #ifdef CONFIG_HAVE_ARCH_MMAP_RND_BITS
1573 .procname
= "mmap_rnd_bits",
1574 .data
= &mmap_rnd_bits
,
1575 .maxlen
= sizeof(mmap_rnd_bits
),
1577 .proc_handler
= proc_dointvec_minmax
,
1578 .extra1
= (void *)&mmap_rnd_bits_min
,
1579 .extra2
= (void *)&mmap_rnd_bits_max
,
1582 #ifdef CONFIG_HAVE_ARCH_MMAP_RND_COMPAT_BITS
1584 .procname
= "mmap_rnd_compat_bits",
1585 .data
= &mmap_rnd_compat_bits
,
1586 .maxlen
= sizeof(mmap_rnd_compat_bits
),
1588 .proc_handler
= proc_dointvec_minmax
,
1589 .extra1
= (void *)&mmap_rnd_compat_bits_min
,
1590 .extra2
= (void *)&mmap_rnd_compat_bits_max
,
1596 static struct ctl_table fs_table
[] = {
1598 .procname
= "inode-nr",
1599 .data
= &inodes_stat
,
1600 .maxlen
= 2*sizeof(long),
1602 .proc_handler
= proc_nr_inodes
,
1605 .procname
= "inode-state",
1606 .data
= &inodes_stat
,
1607 .maxlen
= 7*sizeof(long),
1609 .proc_handler
= proc_nr_inodes
,
1612 .procname
= "file-nr",
1613 .data
= &files_stat
,
1614 .maxlen
= sizeof(files_stat
),
1616 .proc_handler
= proc_nr_files
,
1619 .procname
= "file-max",
1620 .data
= &files_stat
.max_files
,
1621 .maxlen
= sizeof(files_stat
.max_files
),
1623 .proc_handler
= proc_doulongvec_minmax
,
1626 .procname
= "nr_open",
1627 .data
= &sysctl_nr_open
,
1628 .maxlen
= sizeof(int),
1630 .proc_handler
= proc_dointvec_minmax
,
1631 .extra1
= &sysctl_nr_open_min
,
1632 .extra2
= &sysctl_nr_open_max
,
1635 .procname
= "dentry-state",
1636 .data
= &dentry_stat
,
1637 .maxlen
= 6*sizeof(long),
1639 .proc_handler
= proc_nr_dentry
,
1642 .procname
= "overflowuid",
1643 .data
= &fs_overflowuid
,
1644 .maxlen
= sizeof(int),
1646 .proc_handler
= proc_dointvec_minmax
,
1647 .extra1
= &minolduid
,
1648 .extra2
= &maxolduid
,
1651 .procname
= "overflowgid",
1652 .data
= &fs_overflowgid
,
1653 .maxlen
= sizeof(int),
1655 .proc_handler
= proc_dointvec_minmax
,
1656 .extra1
= &minolduid
,
1657 .extra2
= &maxolduid
,
1659 #ifdef CONFIG_FILE_LOCKING
1661 .procname
= "leases-enable",
1662 .data
= &leases_enable
,
1663 .maxlen
= sizeof(int),
1665 .proc_handler
= proc_dointvec
,
1668 #ifdef CONFIG_DNOTIFY
1670 .procname
= "dir-notify-enable",
1671 .data
= &dir_notify_enable
,
1672 .maxlen
= sizeof(int),
1674 .proc_handler
= proc_dointvec
,
1678 #ifdef CONFIG_FILE_LOCKING
1680 .procname
= "lease-break-time",
1681 .data
= &lease_break_time
,
1682 .maxlen
= sizeof(int),
1684 .proc_handler
= proc_dointvec
,
1689 .procname
= "aio-nr",
1691 .maxlen
= sizeof(aio_nr
),
1693 .proc_handler
= proc_doulongvec_minmax
,
1696 .procname
= "aio-max-nr",
1697 .data
= &aio_max_nr
,
1698 .maxlen
= sizeof(aio_max_nr
),
1700 .proc_handler
= proc_doulongvec_minmax
,
1702 #endif /* CONFIG_AIO */
1703 #ifdef CONFIG_INOTIFY_USER
1705 .procname
= "inotify",
1707 .child
= inotify_table
,
1712 .procname
= "epoll",
1714 .child
= epoll_table
,
1719 .procname
= "protected_symlinks",
1720 .data
= &sysctl_protected_symlinks
,
1721 .maxlen
= sizeof(int),
1723 .proc_handler
= proc_dointvec_minmax
,
1728 .procname
= "protected_hardlinks",
1729 .data
= &sysctl_protected_hardlinks
,
1730 .maxlen
= sizeof(int),
1732 .proc_handler
= proc_dointvec_minmax
,
1737 .procname
= "suid_dumpable",
1738 .data
= &suid_dumpable
,
1739 .maxlen
= sizeof(int),
1741 .proc_handler
= proc_dointvec_minmax_coredump
,
1745 #if defined(CONFIG_BINFMT_MISC) || defined(CONFIG_BINFMT_MISC_MODULE)
1747 .procname
= "binfmt_misc",
1749 .child
= sysctl_mount_point
,
1753 .procname
= "pipe-max-size",
1754 .data
= &pipe_max_size
,
1755 .maxlen
= sizeof(int),
1757 .proc_handler
= &pipe_proc_fn
,
1758 .extra1
= &pipe_min_size
,
1763 static struct ctl_table debug_table
[] = {
1764 #ifdef CONFIG_SYSCTL_EXCEPTION_TRACE
1766 .procname
= "exception-trace",
1767 .data
= &show_unhandled_signals
,
1768 .maxlen
= sizeof(int),
1770 .proc_handler
= proc_dointvec
1773 #if defined(CONFIG_OPTPROBES)
1775 .procname
= "kprobes-optimization",
1776 .data
= &sysctl_kprobes_optimization
,
1777 .maxlen
= sizeof(int),
1779 .proc_handler
= proc_kprobes_optimization_handler
,
1787 static struct ctl_table dev_table
[] = {
1791 int __init
sysctl_init(void)
1793 struct ctl_table_header
*hdr
;
1795 hdr
= register_sysctl_table(sysctl_base_table
);
1796 kmemleak_not_leak(hdr
);
1800 #endif /* CONFIG_SYSCTL */
1806 #ifdef CONFIG_PROC_SYSCTL
1808 static int _proc_do_string(char *data
, int maxlen
, int write
,
1809 char __user
*buffer
,
1810 size_t *lenp
, loff_t
*ppos
)
1816 if (!data
|| !maxlen
|| !*lenp
) {
1822 if (sysctl_writes_strict
== SYSCTL_WRITES_STRICT
) {
1823 /* Only continue writes not past the end of buffer. */
1825 if (len
> maxlen
- 1)
1832 /* Start writing from beginning of buffer. */
1838 while ((p
- buffer
) < *lenp
&& len
< maxlen
- 1) {
1839 if (get_user(c
, p
++))
1841 if (c
== 0 || c
== '\n')
1862 if (copy_to_user(buffer
, data
, len
))
1865 if (put_user('\n', buffer
+ len
))
1875 static void warn_sysctl_write(struct ctl_table
*table
)
1877 pr_warn_once("%s wrote to %s when file position was not 0!\n"
1878 "This will not be supported in the future. To silence this\n"
1879 "warning, set kernel.sysctl_writes_strict = -1\n",
1880 current
->comm
, table
->procname
);
1884 * proc_dostring - read a string sysctl
1885 * @table: the sysctl table
1886 * @write: %TRUE if this is a write to the sysctl file
1887 * @buffer: the user buffer
1888 * @lenp: the size of the user buffer
1889 * @ppos: file position
1891 * Reads/writes a string from/to the user buffer. If the kernel
1892 * buffer provided is not large enough to hold the string, the
1893 * string is truncated. The copied string is %NULL-terminated.
1894 * If the string is being read by the user process, it is copied
1895 * and a newline '\n' is added. It is truncated if the buffer is
1898 * Returns 0 on success.
1900 int proc_dostring(struct ctl_table
*table
, int write
,
1901 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
)
1903 if (write
&& *ppos
&& sysctl_writes_strict
== SYSCTL_WRITES_WARN
)
1904 warn_sysctl_write(table
);
1906 return _proc_do_string((char *)(table
->data
), table
->maxlen
, write
,
1907 (char __user
*)buffer
, lenp
, ppos
);
1910 static size_t proc_skip_spaces(char **buf
)
1913 char *tmp
= skip_spaces(*buf
);
1919 static void proc_skip_char(char **buf
, size_t *size
, const char v
)
1929 #define TMPBUFLEN 22
1931 * proc_get_long - reads an ASCII formatted integer from a user buffer
1933 * @buf: a kernel buffer
1934 * @size: size of the kernel buffer
1935 * @val: this is where the number will be stored
1936 * @neg: set to %TRUE if number is negative
1937 * @perm_tr: a vector which contains the allowed trailers
1938 * @perm_tr_len: size of the perm_tr vector
1939 * @tr: pointer to store the trailer character
1941 * In case of success %0 is returned and @buf and @size are updated with
1942 * the amount of bytes read. If @tr is non-NULL and a trailing
1943 * character exists (size is non-zero after returning from this
1944 * function), @tr is updated with the trailing character.
1946 static int proc_get_long(char **buf
, size_t *size
,
1947 unsigned long *val
, bool *neg
,
1948 const char *perm_tr
, unsigned perm_tr_len
, char *tr
)
1951 char *p
, tmp
[TMPBUFLEN
];
1957 if (len
> TMPBUFLEN
- 1)
1958 len
= TMPBUFLEN
- 1;
1960 memcpy(tmp
, *buf
, len
);
1964 if (*p
== '-' && *size
> 1) {
1972 *val
= simple_strtoul(p
, &p
, 0);
1976 /* We don't know if the next char is whitespace thus we may accept
1977 * invalid integers (e.g. 1234...a) or two integers instead of one
1978 * (e.g. 123...1). So lets not allow such large numbers. */
1979 if (len
== TMPBUFLEN
- 1)
1982 if (len
< *size
&& perm_tr_len
&& !memchr(perm_tr
, *p
, perm_tr_len
))
1985 if (tr
&& (len
< *size
))
1995 * proc_put_long - converts an integer to a decimal ASCII formatted string
1997 * @buf: the user buffer
1998 * @size: the size of the user buffer
1999 * @val: the integer to be converted
2000 * @neg: sign of the number, %TRUE for negative
2002 * In case of success %0 is returned and @buf and @size are updated with
2003 * the amount of bytes written.
2005 static int proc_put_long(void __user
**buf
, size_t *size
, unsigned long val
,
2009 char tmp
[TMPBUFLEN
], *p
= tmp
;
2011 sprintf(p
, "%s%lu", neg
? "-" : "", val
);
2015 if (copy_to_user(*buf
, tmp
, len
))
2023 static int proc_put_char(void __user
**buf
, size_t *size
, char c
)
2026 char __user
**buffer
= (char __user
**)buf
;
2027 if (put_user(c
, *buffer
))
2029 (*size
)--, (*buffer
)++;
2035 static int do_proc_dointvec_conv(bool *negp
, unsigned long *lvalp
,
2037 int write
, void *data
)
2041 if (*lvalp
> (unsigned long) INT_MAX
+ 1)
2045 if (*lvalp
> (unsigned long) INT_MAX
)
2053 *lvalp
= -(unsigned long)val
;
2056 *lvalp
= (unsigned long)val
;
2062 static const char proc_wspace_sep
[] = { ' ', '\t', '\n' };
2064 static int __do_proc_dointvec(void *tbl_data
, struct ctl_table
*table
,
2065 int write
, void __user
*buffer
,
2066 size_t *lenp
, loff_t
*ppos
,
2067 int (*conv
)(bool *negp
, unsigned long *lvalp
, int *valp
,
2068 int write
, void *data
),
2071 int *i
, vleft
, first
= 1, err
= 0;
2073 char *kbuf
= NULL
, *p
;
2075 if (!tbl_data
|| !table
->maxlen
|| !*lenp
|| (*ppos
&& !write
)) {
2080 i
= (int *) tbl_data
;
2081 vleft
= table
->maxlen
/ sizeof(*i
);
2085 conv
= do_proc_dointvec_conv
;
2089 switch (sysctl_writes_strict
) {
2090 case SYSCTL_WRITES_STRICT
:
2092 case SYSCTL_WRITES_WARN
:
2093 warn_sysctl_write(table
);
2100 if (left
> PAGE_SIZE
- 1)
2101 left
= PAGE_SIZE
- 1;
2102 p
= kbuf
= memdup_user_nul(buffer
, left
);
2104 return PTR_ERR(kbuf
);
2107 for (; left
&& vleft
--; i
++, first
=0) {
2112 left
-= proc_skip_spaces(&p
);
2116 err
= proc_get_long(&p
, &left
, &lval
, &neg
,
2118 sizeof(proc_wspace_sep
), NULL
);
2121 if (conv(&neg
, &lval
, i
, 1, data
)) {
2126 if (conv(&neg
, &lval
, i
, 0, data
)) {
2131 err
= proc_put_char(&buffer
, &left
, '\t');
2134 err
= proc_put_long(&buffer
, &left
, lval
, neg
);
2140 if (!write
&& !first
&& left
&& !err
)
2141 err
= proc_put_char(&buffer
, &left
, '\n');
2142 if (write
&& !err
&& left
)
2143 left
-= proc_skip_spaces(&p
);
2147 return err
? : -EINVAL
;
2155 static int do_proc_dointvec(struct ctl_table
*table
, int write
,
2156 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
,
2157 int (*conv
)(bool *negp
, unsigned long *lvalp
, int *valp
,
2158 int write
, void *data
),
2161 return __do_proc_dointvec(table
->data
, table
, write
,
2162 buffer
, lenp
, ppos
, conv
, data
);
2166 * proc_dointvec - read a vector of integers
2167 * @table: the sysctl table
2168 * @write: %TRUE if this is a write to the sysctl file
2169 * @buffer: the user buffer
2170 * @lenp: the size of the user buffer
2171 * @ppos: file position
2173 * Reads/writes up to table->maxlen/sizeof(unsigned int) integer
2174 * values from/to the user buffer, treated as an ASCII string.
2176 * Returns 0 on success.
2178 int proc_dointvec(struct ctl_table
*table
, int write
,
2179 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
)
2181 return do_proc_dointvec(table
,write
,buffer
,lenp
,ppos
,
2186 * Taint values can only be increased
2187 * This means we can safely use a temporary.
2189 static int proc_taint(struct ctl_table
*table
, int write
,
2190 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
)
2193 unsigned long tmptaint
= get_taint();
2196 if (write
&& !capable(CAP_SYS_ADMIN
))
2201 err
= proc_doulongvec_minmax(&t
, write
, buffer
, lenp
, ppos
);
2207 * Poor man's atomic or. Not worth adding a primitive
2208 * to everyone's atomic.h for this
2211 for (i
= 0; i
< BITS_PER_LONG
&& tmptaint
>> i
; i
++) {
2212 if ((tmptaint
>> i
) & 1)
2213 add_taint(i
, LOCKDEP_STILL_OK
);
2220 #ifdef CONFIG_PRINTK
2221 static int proc_dointvec_minmax_sysadmin(struct ctl_table
*table
, int write
,
2222 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
)
2224 if (write
&& !capable(CAP_SYS_ADMIN
))
2227 return proc_dointvec_minmax(table
, write
, buffer
, lenp
, ppos
);
2231 struct do_proc_dointvec_minmax_conv_param
{
2236 static int do_proc_dointvec_minmax_conv(bool *negp
, unsigned long *lvalp
,
2238 int write
, void *data
)
2240 struct do_proc_dointvec_minmax_conv_param
*param
= data
;
2242 int val
= *negp
? -*lvalp
: *lvalp
;
2243 if ((param
->min
&& *param
->min
> val
) ||
2244 (param
->max
&& *param
->max
< val
))
2251 *lvalp
= -(unsigned long)val
;
2254 *lvalp
= (unsigned long)val
;
2261 * proc_dointvec_minmax - read a vector of integers with min/max values
2262 * @table: the sysctl table
2263 * @write: %TRUE if this is a write to the sysctl file
2264 * @buffer: the user buffer
2265 * @lenp: the size of the user buffer
2266 * @ppos: file position
2268 * Reads/writes up to table->maxlen/sizeof(unsigned int) integer
2269 * values from/to the user buffer, treated as an ASCII string.
2271 * This routine will ensure the values are within the range specified by
2272 * table->extra1 (min) and table->extra2 (max).
2274 * Returns 0 on success.
2276 int proc_dointvec_minmax(struct ctl_table
*table
, int write
,
2277 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
)
2279 struct do_proc_dointvec_minmax_conv_param param
= {
2280 .min
= (int *) table
->extra1
,
2281 .max
= (int *) table
->extra2
,
2283 return do_proc_dointvec(table
, write
, buffer
, lenp
, ppos
,
2284 do_proc_dointvec_minmax_conv
, ¶m
);
2287 static void validate_coredump_safety(void)
2289 #ifdef CONFIG_COREDUMP
2290 if (suid_dumpable
== SUID_DUMP_ROOT
&&
2291 core_pattern
[0] != '/' && core_pattern
[0] != '|') {
2292 printk(KERN_WARNING
"Unsafe core_pattern used with "\
2293 "suid_dumpable=2. Pipe handler or fully qualified "\
2294 "core dump path required.\n");
2299 static int proc_dointvec_minmax_coredump(struct ctl_table
*table
, int write
,
2300 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
)
2302 int error
= proc_dointvec_minmax(table
, write
, buffer
, lenp
, ppos
);
2304 validate_coredump_safety();
2308 #ifdef CONFIG_COREDUMP
2309 static int proc_dostring_coredump(struct ctl_table
*table
, int write
,
2310 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
)
2312 int error
= proc_dostring(table
, write
, buffer
, lenp
, ppos
);
2314 validate_coredump_safety();
2319 static int __do_proc_doulongvec_minmax(void *data
, struct ctl_table
*table
, int write
,
2320 void __user
*buffer
,
2321 size_t *lenp
, loff_t
*ppos
,
2322 unsigned long convmul
,
2323 unsigned long convdiv
)
2325 unsigned long *i
, *min
, *max
;
2326 int vleft
, first
= 1, err
= 0;
2328 char *kbuf
= NULL
, *p
;
2330 if (!data
|| !table
->maxlen
|| !*lenp
|| (*ppos
&& !write
)) {
2335 i
= (unsigned long *) data
;
2336 min
= (unsigned long *) table
->extra1
;
2337 max
= (unsigned long *) table
->extra2
;
2338 vleft
= table
->maxlen
/ sizeof(unsigned long);
2343 switch (sysctl_writes_strict
) {
2344 case SYSCTL_WRITES_STRICT
:
2346 case SYSCTL_WRITES_WARN
:
2347 warn_sysctl_write(table
);
2354 if (left
> PAGE_SIZE
- 1)
2355 left
= PAGE_SIZE
- 1;
2356 p
= kbuf
= memdup_user_nul(buffer
, left
);
2358 return PTR_ERR(kbuf
);
2361 for (; left
&& vleft
--; i
++, first
= 0) {
2367 left
-= proc_skip_spaces(&p
);
2369 err
= proc_get_long(&p
, &left
, &val
, &neg
,
2371 sizeof(proc_wspace_sep
), NULL
);
2376 if ((min
&& val
< *min
) || (max
&& val
> *max
))
2380 val
= convdiv
* (*i
) / convmul
;
2382 err
= proc_put_char(&buffer
, &left
, '\t');
2386 err
= proc_put_long(&buffer
, &left
, val
, false);
2392 if (!write
&& !first
&& left
&& !err
)
2393 err
= proc_put_char(&buffer
, &left
, '\n');
2395 left
-= proc_skip_spaces(&p
);
2399 return err
? : -EINVAL
;
2407 static int do_proc_doulongvec_minmax(struct ctl_table
*table
, int write
,
2408 void __user
*buffer
,
2409 size_t *lenp
, loff_t
*ppos
,
2410 unsigned long convmul
,
2411 unsigned long convdiv
)
2413 return __do_proc_doulongvec_minmax(table
->data
, table
, write
,
2414 buffer
, lenp
, ppos
, convmul
, convdiv
);
2418 * proc_doulongvec_minmax - read a vector of long integers with min/max values
2419 * @table: the sysctl table
2420 * @write: %TRUE if this is a write to the sysctl file
2421 * @buffer: the user buffer
2422 * @lenp: the size of the user buffer
2423 * @ppos: file position
2425 * Reads/writes up to table->maxlen/sizeof(unsigned long) unsigned long
2426 * values from/to the user buffer, treated as an ASCII string.
2428 * This routine will ensure the values are within the range specified by
2429 * table->extra1 (min) and table->extra2 (max).
2431 * Returns 0 on success.
2433 int proc_doulongvec_minmax(struct ctl_table
*table
, int write
,
2434 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
)
2436 return do_proc_doulongvec_minmax(table
, write
, buffer
, lenp
, ppos
, 1l, 1l);
2440 * proc_doulongvec_ms_jiffies_minmax - read a vector of millisecond values with min/max values
2441 * @table: the sysctl table
2442 * @write: %TRUE if this is a write to the sysctl file
2443 * @buffer: the user buffer
2444 * @lenp: the size of the user buffer
2445 * @ppos: file position
2447 * Reads/writes up to table->maxlen/sizeof(unsigned long) unsigned long
2448 * values from/to the user buffer, treated as an ASCII string. The values
2449 * are treated as milliseconds, and converted to jiffies when they are stored.
2451 * This routine will ensure the values are within the range specified by
2452 * table->extra1 (min) and table->extra2 (max).
2454 * Returns 0 on success.
2456 int proc_doulongvec_ms_jiffies_minmax(struct ctl_table
*table
, int write
,
2457 void __user
*buffer
,
2458 size_t *lenp
, loff_t
*ppos
)
2460 return do_proc_doulongvec_minmax(table
, write
, buffer
,
2461 lenp
, ppos
, HZ
, 1000l);
2465 static int do_proc_dointvec_jiffies_conv(bool *negp
, unsigned long *lvalp
,
2467 int write
, void *data
)
2470 if (*lvalp
> LONG_MAX
/ HZ
)
2472 *valp
= *negp
? -(*lvalp
*HZ
) : (*lvalp
*HZ
);
2478 lval
= -(unsigned long)val
;
2481 lval
= (unsigned long)val
;
2488 static int do_proc_dointvec_userhz_jiffies_conv(bool *negp
, unsigned long *lvalp
,
2490 int write
, void *data
)
2493 if (USER_HZ
< HZ
&& *lvalp
> (LONG_MAX
/ HZ
) * USER_HZ
)
2495 *valp
= clock_t_to_jiffies(*negp
? -*lvalp
: *lvalp
);
2501 lval
= -(unsigned long)val
;
2504 lval
= (unsigned long)val
;
2506 *lvalp
= jiffies_to_clock_t(lval
);
2511 static int do_proc_dointvec_ms_jiffies_conv(bool *negp
, unsigned long *lvalp
,
2513 int write
, void *data
)
2516 unsigned long jif
= msecs_to_jiffies(*negp
? -*lvalp
: *lvalp
);
2526 lval
= -(unsigned long)val
;
2529 lval
= (unsigned long)val
;
2531 *lvalp
= jiffies_to_msecs(lval
);
2537 * proc_dointvec_jiffies - read a vector of integers as seconds
2538 * @table: the sysctl table
2539 * @write: %TRUE if this is a write to the sysctl file
2540 * @buffer: the user buffer
2541 * @lenp: the size of the user buffer
2542 * @ppos: file position
2544 * Reads/writes up to table->maxlen/sizeof(unsigned int) integer
2545 * values from/to the user buffer, treated as an ASCII string.
2546 * The values read are assumed to be in seconds, and are converted into
2549 * Returns 0 on success.
2551 int proc_dointvec_jiffies(struct ctl_table
*table
, int write
,
2552 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
)
2554 return do_proc_dointvec(table
,write
,buffer
,lenp
,ppos
,
2555 do_proc_dointvec_jiffies_conv
,NULL
);
2559 * proc_dointvec_userhz_jiffies - read a vector of integers as 1/USER_HZ seconds
2560 * @table: the sysctl table
2561 * @write: %TRUE if this is a write to the sysctl file
2562 * @buffer: the user buffer
2563 * @lenp: the size of the user buffer
2564 * @ppos: pointer to the file position
2566 * Reads/writes up to table->maxlen/sizeof(unsigned int) integer
2567 * values from/to the user buffer, treated as an ASCII string.
2568 * The values read are assumed to be in 1/USER_HZ seconds, and
2569 * are converted into jiffies.
2571 * Returns 0 on success.
2573 int proc_dointvec_userhz_jiffies(struct ctl_table
*table
, int write
,
2574 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
)
2576 return do_proc_dointvec(table
,write
,buffer
,lenp
,ppos
,
2577 do_proc_dointvec_userhz_jiffies_conv
,NULL
);
2581 * proc_dointvec_ms_jiffies - read a vector of integers as 1 milliseconds
2582 * @table: the sysctl table
2583 * @write: %TRUE if this is a write to the sysctl file
2584 * @buffer: the user buffer
2585 * @lenp: the size of the user buffer
2586 * @ppos: file position
2587 * @ppos: the current position in the file
2589 * Reads/writes up to table->maxlen/sizeof(unsigned int) integer
2590 * values from/to the user buffer, treated as an ASCII string.
2591 * The values read are assumed to be in 1/1000 seconds, and
2592 * are converted into jiffies.
2594 * Returns 0 on success.
2596 int proc_dointvec_ms_jiffies(struct ctl_table
*table
, int write
,
2597 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
)
2599 return do_proc_dointvec(table
, write
, buffer
, lenp
, ppos
,
2600 do_proc_dointvec_ms_jiffies_conv
, NULL
);
2603 static int proc_do_cad_pid(struct ctl_table
*table
, int write
,
2604 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
)
2606 struct pid
*new_pid
;
2610 tmp
= pid_vnr(cad_pid
);
2612 r
= __do_proc_dointvec(&tmp
, table
, write
, buffer
,
2613 lenp
, ppos
, NULL
, NULL
);
2617 new_pid
= find_get_pid(tmp
);
2621 put_pid(xchg(&cad_pid
, new_pid
));
2626 * proc_do_large_bitmap - read/write from/to a large bitmap
2627 * @table: the sysctl table
2628 * @write: %TRUE if this is a write to the sysctl file
2629 * @buffer: the user buffer
2630 * @lenp: the size of the user buffer
2631 * @ppos: file position
2633 * The bitmap is stored at table->data and the bitmap length (in bits)
2636 * We use a range comma separated format (e.g. 1,3-4,10-10) so that
2637 * large bitmaps may be represented in a compact manner. Writing into
2638 * the file will clear the bitmap then update it with the given input.
2640 * Returns 0 on success.
2642 int proc_do_large_bitmap(struct ctl_table
*table
, int write
,
2643 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
)
2647 size_t left
= *lenp
;
2648 unsigned long bitmap_len
= table
->maxlen
;
2649 unsigned long *bitmap
= *(unsigned long **) table
->data
;
2650 unsigned long *tmp_bitmap
= NULL
;
2651 char tr_a
[] = { '-', ',', '\n' }, tr_b
[] = { ',', '\n', 0 }, c
;
2653 if (!bitmap
|| !bitmap_len
|| !left
|| (*ppos
&& !write
)) {
2661 if (left
> PAGE_SIZE
- 1)
2662 left
= PAGE_SIZE
- 1;
2664 p
= kbuf
= memdup_user_nul(buffer
, left
);
2666 return PTR_ERR(kbuf
);
2668 tmp_bitmap
= kzalloc(BITS_TO_LONGS(bitmap_len
) * sizeof(unsigned long),
2674 proc_skip_char(&p
, &left
, '\n');
2675 while (!err
&& left
) {
2676 unsigned long val_a
, val_b
;
2679 err
= proc_get_long(&p
, &left
, &val_a
, &neg
, tr_a
,
2683 if (val_a
>= bitmap_len
|| neg
) {
2695 err
= proc_get_long(&p
, &left
, &val_b
,
2696 &neg
, tr_b
, sizeof(tr_b
),
2700 if (val_b
>= bitmap_len
|| neg
||
2711 bitmap_set(tmp_bitmap
, val_a
, val_b
- val_a
+ 1);
2713 proc_skip_char(&p
, &left
, '\n');
2717 unsigned long bit_a
, bit_b
= 0;
2720 bit_a
= find_next_bit(bitmap
, bitmap_len
, bit_b
);
2721 if (bit_a
>= bitmap_len
)
2723 bit_b
= find_next_zero_bit(bitmap
, bitmap_len
,
2727 err
= proc_put_char(&buffer
, &left
, ',');
2731 err
= proc_put_long(&buffer
, &left
, bit_a
, false);
2734 if (bit_a
!= bit_b
) {
2735 err
= proc_put_char(&buffer
, &left
, '-');
2738 err
= proc_put_long(&buffer
, &left
, bit_b
, false);
2746 err
= proc_put_char(&buffer
, &left
, '\n');
2752 bitmap_or(bitmap
, bitmap
, tmp_bitmap
, bitmap_len
);
2754 bitmap_copy(bitmap
, tmp_bitmap
, bitmap_len
);
2766 #else /* CONFIG_PROC_SYSCTL */
2768 int proc_dostring(struct ctl_table
*table
, int write
,
2769 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
)
2774 int proc_dointvec(struct ctl_table
*table
, int write
,
2775 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
)
2780 int proc_dointvec_minmax(struct ctl_table
*table
, int write
,
2781 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
)
2786 int proc_dointvec_jiffies(struct ctl_table
*table
, int write
,
2787 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
)
2792 int proc_dointvec_userhz_jiffies(struct ctl_table
*table
, int write
,
2793 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
)
2798 int proc_dointvec_ms_jiffies(struct ctl_table
*table
, int write
,
2799 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
)
2804 int proc_doulongvec_minmax(struct ctl_table
*table
, int write
,
2805 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
)
2810 int proc_doulongvec_ms_jiffies_minmax(struct ctl_table
*table
, int write
,
2811 void __user
*buffer
,
2812 size_t *lenp
, loff_t
*ppos
)
2818 #endif /* CONFIG_PROC_SYSCTL */
2821 * No sense putting this after each symbol definition, twice,
2822 * exception granted :-)
2824 EXPORT_SYMBOL(proc_dointvec
);
2825 EXPORT_SYMBOL(proc_dointvec_jiffies
);
2826 EXPORT_SYMBOL(proc_dointvec_minmax
);
2827 EXPORT_SYMBOL(proc_dointvec_userhz_jiffies
);
2828 EXPORT_SYMBOL(proc_dointvec_ms_jiffies
);
2829 EXPORT_SYMBOL(proc_dostring
);
2830 EXPORT_SYMBOL(proc_doulongvec_minmax
);
2831 EXPORT_SYMBOL(proc_doulongvec_ms_jiffies_minmax
);