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>
68 #include <linux/mount.h>
70 #include <asm/uaccess.h>
71 #include <asm/processor.h>
75 #include <asm/stacktrace.h>
79 #include <asm/setup.h>
81 #ifdef CONFIG_BSD_PROCESS_ACCT
82 #include <linux/acct.h>
84 #ifdef CONFIG_RT_MUTEXES
85 #include <linux/rtmutex.h>
87 #if defined(CONFIG_PROVE_LOCKING) || defined(CONFIG_LOCK_STAT)
88 #include <linux/lockdep.h>
90 #ifdef CONFIG_CHR_DEV_SG
94 #ifdef CONFIG_LOCKUP_DETECTOR
95 #include <linux/nmi.h>
98 #if defined(CONFIG_SYSCTL)
100 /* External variables not in a header file. */
101 extern int suid_dumpable;
102 #ifdef CONFIG_COREDUMP
103 extern int core_uses_pid;
104 extern char core_pattern[];
105 extern unsigned int core_pipe_limit;
108 extern int extra_free_kbytes;
109 extern int pid_max_min, pid_max_max;
110 extern int percpu_pagelist_fraction;
111 extern int compat_log;
112 extern int latencytop_enabled;
113 extern int sysctl_nr_open_min, sysctl_nr_open_max;
115 extern int sysctl_nr_trim_pages;
118 /* Constants used for minimum and maximum */
119 #ifdef CONFIG_LOCKUP_DETECTOR
120 static int sixty = 60;
123 static int __maybe_unused neg_one = -1;
126 static int __maybe_unused one = 1;
127 static int __maybe_unused two = 2;
128 static int __maybe_unused four = 4;
129 static unsigned long one_ul = 1;
130 static int one_hundred = 100;
132 static int ten_thousand = 10000;
135 /* this is needed for the proc_doulongvec_minmax of vm_dirty_bytes */
136 static unsigned long dirty_bytes_min = 2 * PAGE_SIZE;
138 /* this is needed for the proc_dointvec_minmax for [fs_]overflow UID and GID */
139 static int maxolduid = 65535;
140 static int minolduid;
142 static int ngroups_max = NGROUPS_MAX;
143 static const int cap_last_cap = CAP_LAST_CAP;
145 /*this is needed for proc_doulongvec_minmax of sysctl_hung_task_timeout_secs */
146 #ifdef CONFIG_DETECT_HUNG_TASK
147 static unsigned long hung_task_timeout_max = (LONG_MAX/HZ);
150 #ifdef CONFIG_INOTIFY_USER
151 #include <linux/inotify.h>
157 extern int pwrsw_enabled;
160 #ifdef CONFIG_SYSCTL_ARCH_UNALIGN_ALLOW
161 extern int unaligned_enabled;
165 extern int unaligned_dump_stack;
168 #ifdef CONFIG_SYSCTL_ARCH_UNALIGN_NO_WARN
169 extern int no_unaligned_warning;
172 #ifdef CONFIG_PROC_SYSCTL
174 #define SYSCTL_WRITES_LEGACY -1
175 #define SYSCTL_WRITES_WARN 0
176 #define SYSCTL_WRITES_STRICT 1
178 static int sysctl_writes_strict = SYSCTL_WRITES_STRICT;
180 static int proc_do_cad_pid(struct ctl_table *table, int write,
181 void __user *buffer, size_t *lenp, loff_t *ppos);
182 static int proc_taint(struct ctl_table *table, int write,
183 void __user *buffer, size_t *lenp, loff_t *ppos);
187 static int proc_dointvec_minmax_sysadmin(struct ctl_table *table, int write,
188 void __user *buffer, size_t *lenp, loff_t *ppos);
191 static int proc_dointvec_minmax_coredump(struct ctl_table *table, int write,
192 void __user *buffer, size_t *lenp, loff_t *ppos);
193 #ifdef CONFIG_COREDUMP
194 static int proc_dostring_coredump(struct ctl_table *table, int write,
195 void __user *buffer, size_t *lenp, loff_t *ppos);
198 #ifdef CONFIG_MAGIC_SYSRQ
199 /* Note: sysrq code uses it's own private copy */
200 static int __sysrq_enabled = CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE;
202 static int sysrq_sysctl_handler(struct ctl_table *table, int write,
203 void __user *buffer, size_t *lenp,
208 error = proc_dointvec(table, write, buffer, lenp, ppos);
213 sysrq_toggle_support(__sysrq_enabled);
220 static struct ctl_table kern_table[];
221 static struct ctl_table vm_table[];
222 static struct ctl_table fs_table[];
223 static struct ctl_table debug_table[];
224 static struct ctl_table dev_table[];
225 extern struct ctl_table random_table[];
227 extern struct ctl_table epoll_table[];
230 #ifdef HAVE_ARCH_PICK_MMAP_LAYOUT
231 int sysctl_legacy_va_layout;
234 /* The default sysctl tables: */
236 static struct ctl_table sysctl_base_table[] = {
238 .procname = "kernel",
255 .child = debug_table,
265 #ifdef CONFIG_SCHED_DEBUG
266 static int min_sched_granularity_ns = 100000; /* 100 usecs */
267 static int max_sched_granularity_ns = NSEC_PER_SEC; /* 1 second */
268 static int min_wakeup_granularity_ns; /* 0 usecs */
269 static int max_wakeup_granularity_ns = NSEC_PER_SEC; /* 1 second */
271 static int min_sched_tunable_scaling = SCHED_TUNABLESCALING_NONE;
272 static int max_sched_tunable_scaling = SCHED_TUNABLESCALING_END-1;
273 #endif /* CONFIG_SMP */
274 #endif /* CONFIG_SCHED_DEBUG */
276 #ifdef CONFIG_COMPACTION
277 static int min_extfrag_threshold;
278 static int max_extfrag_threshold = 1000;
281 static struct ctl_table kern_table[] = {
283 .procname = "sched_child_runs_first",
284 .data = &sysctl_sched_child_runs_first,
285 .maxlen = sizeof(unsigned int),
287 .proc_handler = proc_dointvec,
289 #ifdef CONFIG_SCHED_DEBUG
291 .procname = "sched_min_granularity_ns",
292 .data = &sysctl_sched_min_granularity,
293 .maxlen = sizeof(unsigned int),
295 .proc_handler = sched_proc_update_handler,
296 .extra1 = &min_sched_granularity_ns,
297 .extra2 = &max_sched_granularity_ns,
300 .procname = "sched_latency_ns",
301 .data = &sysctl_sched_latency,
302 .maxlen = sizeof(unsigned int),
304 .proc_handler = sched_proc_update_handler,
305 .extra1 = &min_sched_granularity_ns,
306 .extra2 = &max_sched_granularity_ns,
309 .procname = "sched_sync_hint_enable",
310 .data = &sysctl_sched_sync_hint_enable,
311 .maxlen = sizeof(unsigned int),
313 .proc_handler = proc_dointvec,
315 #ifdef CONFIG_SCHED_WALT
317 .procname = "sched_use_walt_cpu_util",
318 .data = &sysctl_sched_use_walt_cpu_util,
319 .maxlen = sizeof(unsigned int),
321 .proc_handler = proc_dointvec,
324 .procname = "sched_use_walt_task_util",
325 .data = &sysctl_sched_use_walt_task_util,
326 .maxlen = sizeof(unsigned int),
328 .proc_handler = proc_dointvec,
331 .procname = "sched_walt_init_task_load_pct",
332 .data = &sysctl_sched_walt_init_task_load_pct,
333 .maxlen = sizeof(unsigned int),
335 .proc_handler = proc_dointvec,
338 .procname = "sched_walt_cpu_high_irqload",
339 .data = &sysctl_sched_walt_cpu_high_irqload,
340 .maxlen = sizeof(unsigned int),
342 .proc_handler = proc_dointvec,
346 .procname = "sched_cstate_aware",
347 .data = &sysctl_sched_cstate_aware,
348 .maxlen = sizeof(unsigned int),
350 .proc_handler = proc_dointvec,
353 .procname = "sched_wakeup_granularity_ns",
354 .data = &sysctl_sched_wakeup_granularity,
355 .maxlen = sizeof(unsigned int),
357 .proc_handler = sched_proc_update_handler,
358 .extra1 = &min_wakeup_granularity_ns,
359 .extra2 = &max_wakeup_granularity_ns,
363 .procname = "sched_tunable_scaling",
364 .data = &sysctl_sched_tunable_scaling,
365 .maxlen = sizeof(enum sched_tunable_scaling),
367 .proc_handler = sched_proc_update_handler,
368 .extra1 = &min_sched_tunable_scaling,
369 .extra2 = &max_sched_tunable_scaling,
372 .procname = "sched_migration_cost_ns",
373 .data = &sysctl_sched_migration_cost,
374 .maxlen = sizeof(unsigned int),
376 .proc_handler = proc_dointvec,
379 .procname = "sched_nr_migrate",
380 .data = &sysctl_sched_nr_migrate,
381 .maxlen = sizeof(unsigned int),
383 .proc_handler = proc_dointvec,
386 .procname = "sched_time_avg_ms",
387 .data = &sysctl_sched_time_avg,
388 .maxlen = sizeof(unsigned int),
390 .proc_handler = proc_dointvec,
393 .procname = "sched_shares_window_ns",
394 .data = &sysctl_sched_shares_window,
395 .maxlen = sizeof(unsigned int),
397 .proc_handler = proc_dointvec,
399 #endif /* CONFIG_SMP */
400 #ifdef CONFIG_NUMA_BALANCING
402 .procname = "numa_balancing_scan_delay_ms",
403 .data = &sysctl_numa_balancing_scan_delay,
404 .maxlen = sizeof(unsigned int),
406 .proc_handler = proc_dointvec,
409 .procname = "numa_balancing_scan_period_min_ms",
410 .data = &sysctl_numa_balancing_scan_period_min,
411 .maxlen = sizeof(unsigned int),
413 .proc_handler = proc_dointvec,
416 .procname = "numa_balancing_scan_period_max_ms",
417 .data = &sysctl_numa_balancing_scan_period_max,
418 .maxlen = sizeof(unsigned int),
420 .proc_handler = proc_dointvec,
423 .procname = "numa_balancing_scan_size_mb",
424 .data = &sysctl_numa_balancing_scan_size,
425 .maxlen = sizeof(unsigned int),
427 .proc_handler = proc_dointvec_minmax,
431 .procname = "numa_balancing",
432 .data = NULL, /* filled in by handler */
433 .maxlen = sizeof(unsigned int),
435 .proc_handler = sysctl_numa_balancing,
439 #endif /* CONFIG_NUMA_BALANCING */
440 #endif /* CONFIG_SCHED_DEBUG */
442 .procname = "sched_rt_period_us",
443 .data = &sysctl_sched_rt_period,
444 .maxlen = sizeof(unsigned int),
446 .proc_handler = sched_rt_handler,
449 .procname = "sched_rt_runtime_us",
450 .data = &sysctl_sched_rt_runtime,
451 .maxlen = sizeof(int),
453 .proc_handler = sched_rt_handler,
456 .procname = "sched_rr_timeslice_ms",
457 .data = &sched_rr_timeslice,
458 .maxlen = sizeof(int),
460 .proc_handler = sched_rr_handler,
462 #ifdef CONFIG_SCHED_AUTOGROUP
464 .procname = "sched_autogroup_enabled",
465 .data = &sysctl_sched_autogroup_enabled,
466 .maxlen = sizeof(unsigned int),
468 .proc_handler = proc_dointvec_minmax,
473 #ifdef CONFIG_CFS_BANDWIDTH
475 .procname = "sched_cfs_bandwidth_slice_us",
476 .data = &sysctl_sched_cfs_bandwidth_slice,
477 .maxlen = sizeof(unsigned int),
479 .proc_handler = proc_dointvec_minmax,
483 #ifdef CONFIG_SCHED_TUNE
485 .procname = "sched_cfs_boost",
486 .data = &sysctl_sched_cfs_boost,
487 .maxlen = sizeof(sysctl_sched_cfs_boost),
488 #ifdef CONFIG_CGROUP_SCHEDTUNE
493 .proc_handler = &sysctl_sched_cfs_boost_handler,
495 .extra2 = &one_hundred,
498 #ifdef CONFIG_PROVE_LOCKING
500 .procname = "prove_locking",
501 .data = &prove_locking,
502 .maxlen = sizeof(int),
504 .proc_handler = proc_dointvec,
507 #ifdef CONFIG_LOCK_STAT
509 .procname = "lock_stat",
511 .maxlen = sizeof(int),
513 .proc_handler = proc_dointvec,
518 .data = &panic_timeout,
519 .maxlen = sizeof(int),
521 .proc_handler = proc_dointvec,
523 #ifdef CONFIG_COREDUMP
525 .procname = "core_uses_pid",
526 .data = &core_uses_pid,
527 .maxlen = sizeof(int),
529 .proc_handler = proc_dointvec,
532 .procname = "core_pattern",
533 .data = core_pattern,
534 .maxlen = CORENAME_MAX_SIZE,
536 .proc_handler = proc_dostring_coredump,
539 .procname = "core_pipe_limit",
540 .data = &core_pipe_limit,
541 .maxlen = sizeof(unsigned int),
543 .proc_handler = proc_dointvec,
546 #ifdef CONFIG_PROC_SYSCTL
548 .procname = "tainted",
549 .maxlen = sizeof(long),
551 .proc_handler = proc_taint,
554 .procname = "sysctl_writes_strict",
555 .data = &sysctl_writes_strict,
556 .maxlen = sizeof(int),
558 .proc_handler = proc_dointvec_minmax,
563 #ifdef CONFIG_LATENCYTOP
565 .procname = "latencytop",
566 .data = &latencytop_enabled,
567 .maxlen = sizeof(int),
569 .proc_handler = proc_dointvec,
572 #ifdef CONFIG_BLK_DEV_INITRD
574 .procname = "real-root-dev",
575 .data = &real_root_dev,
576 .maxlen = sizeof(int),
578 .proc_handler = proc_dointvec,
582 .procname = "print-fatal-signals",
583 .data = &print_fatal_signals,
584 .maxlen = sizeof(int),
586 .proc_handler = proc_dointvec,
590 .procname = "reboot-cmd",
591 .data = reboot_command,
594 .proc_handler = proc_dostring,
597 .procname = "stop-a",
598 .data = &stop_a_enabled,
599 .maxlen = sizeof (int),
601 .proc_handler = proc_dointvec,
604 .procname = "scons-poweroff",
605 .data = &scons_pwroff,
606 .maxlen = sizeof (int),
608 .proc_handler = proc_dointvec,
611 #ifdef CONFIG_SPARC64
613 .procname = "tsb-ratio",
614 .data = &sysctl_tsb_ratio,
615 .maxlen = sizeof (int),
617 .proc_handler = proc_dointvec,
622 .procname = "soft-power",
623 .data = &pwrsw_enabled,
624 .maxlen = sizeof (int),
626 .proc_handler = proc_dointvec,
629 #ifdef CONFIG_SYSCTL_ARCH_UNALIGN_ALLOW
631 .procname = "unaligned-trap",
632 .data = &unaligned_enabled,
633 .maxlen = sizeof (int),
635 .proc_handler = proc_dointvec,
639 .procname = "ctrl-alt-del",
641 .maxlen = sizeof(int),
643 .proc_handler = proc_dointvec,
645 #ifdef CONFIG_FUNCTION_TRACER
647 .procname = "ftrace_enabled",
648 .data = &ftrace_enabled,
649 .maxlen = sizeof(int),
651 .proc_handler = ftrace_enable_sysctl,
654 #ifdef CONFIG_STACK_TRACER
656 .procname = "stack_tracer_enabled",
657 .data = &stack_tracer_enabled,
658 .maxlen = sizeof(int),
660 .proc_handler = stack_trace_sysctl,
663 #ifdef CONFIG_TRACING
665 .procname = "ftrace_dump_on_oops",
666 .data = &ftrace_dump_on_oops,
667 .maxlen = sizeof(int),
669 .proc_handler = proc_dointvec,
672 .procname = "traceoff_on_warning",
673 .data = &__disable_trace_on_warning,
674 .maxlen = sizeof(__disable_trace_on_warning),
676 .proc_handler = proc_dointvec,
679 .procname = "tracepoint_printk",
680 .data = &tracepoint_printk,
681 .maxlen = sizeof(tracepoint_printk),
683 .proc_handler = proc_dointvec,
686 #ifdef CONFIG_KEXEC_CORE
688 .procname = "kexec_load_disabled",
689 .data = &kexec_load_disabled,
690 .maxlen = sizeof(int),
692 /* only handle a transition from default "0" to "1" */
693 .proc_handler = proc_dointvec_minmax,
698 #ifdef CONFIG_MODULES
700 .procname = "modprobe",
701 .data = &modprobe_path,
702 .maxlen = KMOD_PATH_LEN,
704 .proc_handler = proc_dostring,
707 .procname = "modules_disabled",
708 .data = &modules_disabled,
709 .maxlen = sizeof(int),
711 /* only handle a transition from default "0" to "1" */
712 .proc_handler = proc_dointvec_minmax,
717 #ifdef CONFIG_UEVENT_HELPER
719 .procname = "hotplug",
720 .data = &uevent_helper,
721 .maxlen = UEVENT_HELPER_PATH_LEN,
723 .proc_handler = proc_dostring,
726 #ifdef CONFIG_CHR_DEV_SG
728 .procname = "sg-big-buff",
729 .data = &sg_big_buff,
730 .maxlen = sizeof (int),
732 .proc_handler = proc_dointvec,
735 #ifdef CONFIG_BSD_PROCESS_ACCT
739 .maxlen = 3*sizeof(int),
741 .proc_handler = proc_dointvec,
744 #ifdef CONFIG_MAGIC_SYSRQ
747 .data = &__sysrq_enabled,
748 .maxlen = sizeof (int),
750 .proc_handler = sysrq_sysctl_handler,
753 #ifdef CONFIG_PROC_SYSCTL
755 .procname = "cad_pid",
757 .maxlen = sizeof (int),
759 .proc_handler = proc_do_cad_pid,
763 .procname = "threads-max",
765 .maxlen = sizeof(int),
767 .proc_handler = sysctl_max_threads,
770 .procname = "random",
772 .child = random_table,
775 .procname = "usermodehelper",
777 .child = usermodehelper_table,
780 .procname = "overflowuid",
781 .data = &overflowuid,
782 .maxlen = sizeof(int),
784 .proc_handler = proc_dointvec_minmax,
785 .extra1 = &minolduid,
786 .extra2 = &maxolduid,
789 .procname = "overflowgid",
790 .data = &overflowgid,
791 .maxlen = sizeof(int),
793 .proc_handler = proc_dointvec_minmax,
794 .extra1 = &minolduid,
795 .extra2 = &maxolduid,
798 #ifdef CONFIG_MATHEMU
800 .procname = "ieee_emulation_warnings",
801 .data = &sysctl_ieee_emulation_warnings,
802 .maxlen = sizeof(int),
804 .proc_handler = proc_dointvec,
808 .procname = "userprocess_debug",
809 .data = &show_unhandled_signals,
810 .maxlen = sizeof(int),
812 .proc_handler = proc_dointvec,
816 .procname = "pid_max",
818 .maxlen = sizeof (int),
820 .proc_handler = proc_dointvec_minmax,
821 .extra1 = &pid_max_min,
822 .extra2 = &pid_max_max,
825 .procname = "panic_on_oops",
826 .data = &panic_on_oops,
827 .maxlen = sizeof(int),
829 .proc_handler = proc_dointvec,
831 #if defined CONFIG_PRINTK
833 .procname = "printk",
834 .data = &console_loglevel,
835 .maxlen = 4*sizeof(int),
837 .proc_handler = proc_dointvec,
840 .procname = "printk_ratelimit",
841 .data = &printk_ratelimit_state.interval,
842 .maxlen = sizeof(int),
844 .proc_handler = proc_dointvec_jiffies,
847 .procname = "printk_ratelimit_burst",
848 .data = &printk_ratelimit_state.burst,
849 .maxlen = sizeof(int),
851 .proc_handler = proc_dointvec,
854 .procname = "printk_delay",
855 .data = &printk_delay_msec,
856 .maxlen = sizeof(int),
858 .proc_handler = proc_dointvec_minmax,
860 .extra2 = &ten_thousand,
863 .procname = "dmesg_restrict",
864 .data = &dmesg_restrict,
865 .maxlen = sizeof(int),
867 .proc_handler = proc_dointvec_minmax_sysadmin,
872 .procname = "kptr_restrict",
873 .data = &kptr_restrict,
874 .maxlen = sizeof(int),
876 .proc_handler = proc_dointvec_minmax_sysadmin,
882 .procname = "ngroups_max",
883 .data = &ngroups_max,
884 .maxlen = sizeof (int),
886 .proc_handler = proc_dointvec,
889 .procname = "cap_last_cap",
890 .data = (void *)&cap_last_cap,
891 .maxlen = sizeof(int),
893 .proc_handler = proc_dointvec,
895 #if defined(CONFIG_LOCKUP_DETECTOR)
897 .procname = "watchdog",
898 .data = &watchdog_user_enabled,
899 .maxlen = sizeof (int),
901 .proc_handler = proc_watchdog,
906 .procname = "watchdog_thresh",
907 .data = &watchdog_thresh,
908 .maxlen = sizeof(int),
910 .proc_handler = proc_watchdog_thresh,
915 .procname = "nmi_watchdog",
916 .data = &nmi_watchdog_enabled,
917 .maxlen = sizeof (int),
919 .proc_handler = proc_nmi_watchdog,
921 #if defined(CONFIG_HAVE_NMI_WATCHDOG) || defined(CONFIG_HARDLOCKUP_DETECTOR)
928 .procname = "soft_watchdog",
929 .data = &soft_watchdog_enabled,
930 .maxlen = sizeof (int),
932 .proc_handler = proc_soft_watchdog,
937 .procname = "watchdog_cpumask",
938 .data = &watchdog_cpumask_bits,
941 .proc_handler = proc_watchdog_cpumask,
944 .procname = "softlockup_panic",
945 .data = &softlockup_panic,
946 .maxlen = sizeof(int),
948 .proc_handler = proc_dointvec_minmax,
952 #ifdef CONFIG_HARDLOCKUP_DETECTOR
954 .procname = "hardlockup_panic",
955 .data = &hardlockup_panic,
956 .maxlen = sizeof(int),
958 .proc_handler = proc_dointvec_minmax,
965 .procname = "softlockup_all_cpu_backtrace",
966 .data = &sysctl_softlockup_all_cpu_backtrace,
967 .maxlen = sizeof(int),
969 .proc_handler = proc_dointvec_minmax,
974 .procname = "hardlockup_all_cpu_backtrace",
975 .data = &sysctl_hardlockup_all_cpu_backtrace,
976 .maxlen = sizeof(int),
978 .proc_handler = proc_dointvec_minmax,
982 #endif /* CONFIG_SMP */
984 #if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86)
986 .procname = "unknown_nmi_panic",
987 .data = &unknown_nmi_panic,
988 .maxlen = sizeof (int),
990 .proc_handler = proc_dointvec,
993 #if defined(CONFIG_X86)
995 .procname = "panic_on_unrecovered_nmi",
996 .data = &panic_on_unrecovered_nmi,
997 .maxlen = sizeof(int),
999 .proc_handler = proc_dointvec,
1002 .procname = "panic_on_io_nmi",
1003 .data = &panic_on_io_nmi,
1004 .maxlen = sizeof(int),
1006 .proc_handler = proc_dointvec,
1008 #ifdef CONFIG_DEBUG_STACKOVERFLOW
1010 .procname = "panic_on_stackoverflow",
1011 .data = &sysctl_panic_on_stackoverflow,
1012 .maxlen = sizeof(int),
1014 .proc_handler = proc_dointvec,
1018 .procname = "bootloader_type",
1019 .data = &bootloader_type,
1020 .maxlen = sizeof (int),
1022 .proc_handler = proc_dointvec,
1025 .procname = "bootloader_version",
1026 .data = &bootloader_version,
1027 .maxlen = sizeof (int),
1029 .proc_handler = proc_dointvec,
1032 .procname = "kstack_depth_to_print",
1033 .data = &kstack_depth_to_print,
1034 .maxlen = sizeof(int),
1036 .proc_handler = proc_dointvec,
1039 .procname = "io_delay_type",
1040 .data = &io_delay_type,
1041 .maxlen = sizeof(int),
1043 .proc_handler = proc_dointvec,
1046 #if defined(CONFIG_MMU)
1048 .procname = "randomize_va_space",
1049 .data = &randomize_va_space,
1050 .maxlen = sizeof(int),
1052 .proc_handler = proc_dointvec,
1055 #if defined(CONFIG_S390) && defined(CONFIG_SMP)
1057 .procname = "spin_retry",
1058 .data = &spin_retry,
1059 .maxlen = sizeof (int),
1061 .proc_handler = proc_dointvec,
1064 #if defined(CONFIG_ACPI_SLEEP) && defined(CONFIG_X86)
1066 .procname = "acpi_video_flags",
1067 .data = &acpi_realmode_flags,
1068 .maxlen = sizeof (unsigned long),
1070 .proc_handler = proc_doulongvec_minmax,
1073 #ifdef CONFIG_SYSCTL_ARCH_UNALIGN_NO_WARN
1075 .procname = "ignore-unaligned-usertrap",
1076 .data = &no_unaligned_warning,
1077 .maxlen = sizeof (int),
1079 .proc_handler = proc_dointvec,
1084 .procname = "unaligned-dump-stack",
1085 .data = &unaligned_dump_stack,
1086 .maxlen = sizeof (int),
1088 .proc_handler = proc_dointvec,
1091 #ifdef CONFIG_DETECT_HUNG_TASK
1093 .procname = "hung_task_panic",
1094 .data = &sysctl_hung_task_panic,
1095 .maxlen = sizeof(int),
1097 .proc_handler = proc_dointvec_minmax,
1102 .procname = "hung_task_check_count",
1103 .data = &sysctl_hung_task_check_count,
1104 .maxlen = sizeof(int),
1106 .proc_handler = proc_dointvec_minmax,
1110 .procname = "hung_task_timeout_secs",
1111 .data = &sysctl_hung_task_timeout_secs,
1112 .maxlen = sizeof(unsigned long),
1114 .proc_handler = proc_dohung_task_timeout_secs,
1115 .extra2 = &hung_task_timeout_max,
1118 .procname = "hung_task_warnings",
1119 .data = &sysctl_hung_task_warnings,
1120 .maxlen = sizeof(int),
1122 .proc_handler = proc_dointvec_minmax,
1126 #ifdef CONFIG_COMPAT
1128 .procname = "compat-log",
1129 .data = &compat_log,
1130 .maxlen = sizeof (int),
1132 .proc_handler = proc_dointvec,
1135 #ifdef CONFIG_RT_MUTEXES
1137 .procname = "max_lock_depth",
1138 .data = &max_lock_depth,
1139 .maxlen = sizeof(int),
1141 .proc_handler = proc_dointvec,
1145 .procname = "poweroff_cmd",
1146 .data = &poweroff_cmd,
1147 .maxlen = POWEROFF_CMD_PATH_LEN,
1149 .proc_handler = proc_dostring,
1155 .child = key_sysctls,
1158 #ifdef CONFIG_PERF_EVENTS
1160 * User-space scripts rely on the existence of this file
1161 * as a feature check for perf_events being enabled.
1163 * So it's an ABI, do not remove!
1166 .procname = "perf_event_paranoid",
1167 .data = &sysctl_perf_event_paranoid,
1168 .maxlen = sizeof(sysctl_perf_event_paranoid),
1170 .proc_handler = proc_dointvec,
1173 .procname = "perf_event_mlock_kb",
1174 .data = &sysctl_perf_event_mlock,
1175 .maxlen = sizeof(sysctl_perf_event_mlock),
1177 .proc_handler = proc_dointvec,
1180 .procname = "perf_event_max_sample_rate",
1181 .data = &sysctl_perf_event_sample_rate,
1182 .maxlen = sizeof(sysctl_perf_event_sample_rate),
1184 .proc_handler = perf_proc_update_handler,
1188 .procname = "perf_cpu_time_max_percent",
1189 .data = &sysctl_perf_cpu_time_max_percent,
1190 .maxlen = sizeof(sysctl_perf_cpu_time_max_percent),
1192 .proc_handler = perf_cpu_time_max_percent_handler,
1194 .extra2 = &one_hundred,
1197 #ifdef CONFIG_KMEMCHECK
1199 .procname = "kmemcheck",
1200 .data = &kmemcheck_enabled,
1201 .maxlen = sizeof(int),
1203 .proc_handler = proc_dointvec,
1207 .procname = "panic_on_warn",
1208 .data = &panic_on_warn,
1209 .maxlen = sizeof(int),
1211 .proc_handler = proc_dointvec_minmax,
1215 #if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ_COMMON)
1217 .procname = "timer_migration",
1218 .data = &sysctl_timer_migration,
1219 .maxlen = sizeof(unsigned int),
1221 .proc_handler = timer_migration_handler,
1226 #ifdef CONFIG_BPF_SYSCALL
1228 .procname = "unprivileged_bpf_disabled",
1229 .data = &sysctl_unprivileged_bpf_disabled,
1230 .maxlen = sizeof(sysctl_unprivileged_bpf_disabled),
1232 /* only handle a transition from default "0" to "1" */
1233 .proc_handler = proc_dointvec_minmax,
1241 static struct ctl_table vm_table[] = {
1243 .procname = "overcommit_memory",
1244 .data = &sysctl_overcommit_memory,
1245 .maxlen = sizeof(sysctl_overcommit_memory),
1247 .proc_handler = proc_dointvec_minmax,
1252 .procname = "panic_on_oom",
1253 .data = &sysctl_panic_on_oom,
1254 .maxlen = sizeof(sysctl_panic_on_oom),
1256 .proc_handler = proc_dointvec_minmax,
1261 .procname = "oom_kill_allocating_task",
1262 .data = &sysctl_oom_kill_allocating_task,
1263 .maxlen = sizeof(sysctl_oom_kill_allocating_task),
1265 .proc_handler = proc_dointvec,
1268 .procname = "oom_dump_tasks",
1269 .data = &sysctl_oom_dump_tasks,
1270 .maxlen = sizeof(sysctl_oom_dump_tasks),
1272 .proc_handler = proc_dointvec,
1275 .procname = "overcommit_ratio",
1276 .data = &sysctl_overcommit_ratio,
1277 .maxlen = sizeof(sysctl_overcommit_ratio),
1279 .proc_handler = overcommit_ratio_handler,
1282 .procname = "overcommit_kbytes",
1283 .data = &sysctl_overcommit_kbytes,
1284 .maxlen = sizeof(sysctl_overcommit_kbytes),
1286 .proc_handler = overcommit_kbytes_handler,
1289 .procname = "page-cluster",
1290 .data = &page_cluster,
1291 .maxlen = sizeof(int),
1293 .proc_handler = proc_dointvec_minmax,
1297 .procname = "dirty_background_ratio",
1298 .data = &dirty_background_ratio,
1299 .maxlen = sizeof(dirty_background_ratio),
1301 .proc_handler = dirty_background_ratio_handler,
1303 .extra2 = &one_hundred,
1306 .procname = "dirty_background_bytes",
1307 .data = &dirty_background_bytes,
1308 .maxlen = sizeof(dirty_background_bytes),
1310 .proc_handler = dirty_background_bytes_handler,
1314 .procname = "dirty_ratio",
1315 .data = &vm_dirty_ratio,
1316 .maxlen = sizeof(vm_dirty_ratio),
1318 .proc_handler = dirty_ratio_handler,
1320 .extra2 = &one_hundred,
1323 .procname = "dirty_bytes",
1324 .data = &vm_dirty_bytes,
1325 .maxlen = sizeof(vm_dirty_bytes),
1327 .proc_handler = dirty_bytes_handler,
1328 .extra1 = &dirty_bytes_min,
1331 .procname = "dirty_writeback_centisecs",
1332 .data = &dirty_writeback_interval,
1333 .maxlen = sizeof(dirty_writeback_interval),
1335 .proc_handler = dirty_writeback_centisecs_handler,
1338 .procname = "dirty_expire_centisecs",
1339 .data = &dirty_expire_interval,
1340 .maxlen = sizeof(dirty_expire_interval),
1342 .proc_handler = proc_dointvec_minmax,
1346 .procname = "dirtytime_expire_seconds",
1347 .data = &dirtytime_expire_interval,
1348 .maxlen = sizeof(dirty_expire_interval),
1350 .proc_handler = dirtytime_interval_handler,
1354 .procname = "nr_pdflush_threads",
1355 .mode = 0444 /* read-only */,
1356 .proc_handler = pdflush_proc_obsolete,
1359 .procname = "swappiness",
1360 .data = &vm_swappiness,
1361 .maxlen = sizeof(vm_swappiness),
1363 .proc_handler = proc_dointvec_minmax,
1365 .extra2 = &one_hundred,
1367 #ifdef CONFIG_HUGETLB_PAGE
1369 .procname = "nr_hugepages",
1371 .maxlen = sizeof(unsigned long),
1373 .proc_handler = hugetlb_sysctl_handler,
1377 .procname = "nr_hugepages_mempolicy",
1379 .maxlen = sizeof(unsigned long),
1381 .proc_handler = &hugetlb_mempolicy_sysctl_handler,
1385 .procname = "hugetlb_shm_group",
1386 .data = &sysctl_hugetlb_shm_group,
1387 .maxlen = sizeof(gid_t),
1389 .proc_handler = proc_dointvec,
1392 .procname = "hugepages_treat_as_movable",
1393 .data = &hugepages_treat_as_movable,
1394 .maxlen = sizeof(int),
1396 .proc_handler = proc_dointvec,
1399 .procname = "nr_overcommit_hugepages",
1401 .maxlen = sizeof(unsigned long),
1403 .proc_handler = hugetlb_overcommit_handler,
1407 .procname = "lowmem_reserve_ratio",
1408 .data = &sysctl_lowmem_reserve_ratio,
1409 .maxlen = sizeof(sysctl_lowmem_reserve_ratio),
1411 .proc_handler = lowmem_reserve_ratio_sysctl_handler,
1414 .procname = "drop_caches",
1415 .data = &sysctl_drop_caches,
1416 .maxlen = sizeof(int),
1418 .proc_handler = drop_caches_sysctl_handler,
1422 #ifdef CONFIG_COMPACTION
1424 .procname = "compact_memory",
1425 .data = &sysctl_compact_memory,
1426 .maxlen = sizeof(int),
1428 .proc_handler = sysctl_compaction_handler,
1431 .procname = "extfrag_threshold",
1432 .data = &sysctl_extfrag_threshold,
1433 .maxlen = sizeof(int),
1435 .proc_handler = sysctl_extfrag_handler,
1436 .extra1 = &min_extfrag_threshold,
1437 .extra2 = &max_extfrag_threshold,
1440 .procname = "compact_unevictable_allowed",
1441 .data = &sysctl_compact_unevictable_allowed,
1442 .maxlen = sizeof(int),
1444 .proc_handler = proc_dointvec,
1449 #endif /* CONFIG_COMPACTION */
1451 .procname = "min_free_kbytes",
1452 .data = &min_free_kbytes,
1453 .maxlen = sizeof(min_free_kbytes),
1455 .proc_handler = min_free_kbytes_sysctl_handler,
1459 .procname = "extra_free_kbytes",
1460 .data = &extra_free_kbytes,
1461 .maxlen = sizeof(extra_free_kbytes),
1463 .proc_handler = min_free_kbytes_sysctl_handler,
1467 .procname = "percpu_pagelist_fraction",
1468 .data = &percpu_pagelist_fraction,
1469 .maxlen = sizeof(percpu_pagelist_fraction),
1471 .proc_handler = percpu_pagelist_fraction_sysctl_handler,
1476 .procname = "max_map_count",
1477 .data = &sysctl_max_map_count,
1478 .maxlen = sizeof(sysctl_max_map_count),
1480 .proc_handler = proc_dointvec_minmax,
1485 .procname = "nr_trim_pages",
1486 .data = &sysctl_nr_trim_pages,
1487 .maxlen = sizeof(sysctl_nr_trim_pages),
1489 .proc_handler = proc_dointvec_minmax,
1494 .procname = "laptop_mode",
1495 .data = &laptop_mode,
1496 .maxlen = sizeof(laptop_mode),
1498 .proc_handler = proc_dointvec_jiffies,
1501 .procname = "block_dump",
1502 .data = &block_dump,
1503 .maxlen = sizeof(block_dump),
1505 .proc_handler = proc_dointvec,
1509 .procname = "vfs_cache_pressure",
1510 .data = &sysctl_vfs_cache_pressure,
1511 .maxlen = sizeof(sysctl_vfs_cache_pressure),
1513 .proc_handler = proc_dointvec,
1516 #ifdef HAVE_ARCH_PICK_MMAP_LAYOUT
1518 .procname = "legacy_va_layout",
1519 .data = &sysctl_legacy_va_layout,
1520 .maxlen = sizeof(sysctl_legacy_va_layout),
1522 .proc_handler = proc_dointvec,
1528 .procname = "zone_reclaim_mode",
1529 .data = &zone_reclaim_mode,
1530 .maxlen = sizeof(zone_reclaim_mode),
1532 .proc_handler = proc_dointvec,
1536 .procname = "min_unmapped_ratio",
1537 .data = &sysctl_min_unmapped_ratio,
1538 .maxlen = sizeof(sysctl_min_unmapped_ratio),
1540 .proc_handler = sysctl_min_unmapped_ratio_sysctl_handler,
1542 .extra2 = &one_hundred,
1545 .procname = "min_slab_ratio",
1546 .data = &sysctl_min_slab_ratio,
1547 .maxlen = sizeof(sysctl_min_slab_ratio),
1549 .proc_handler = sysctl_min_slab_ratio_sysctl_handler,
1551 .extra2 = &one_hundred,
1556 .procname = "stat_interval",
1557 .data = &sysctl_stat_interval,
1558 .maxlen = sizeof(sysctl_stat_interval),
1560 .proc_handler = proc_dointvec_jiffies,
1565 .procname = "mmap_min_addr",
1566 .data = &dac_mmap_min_addr,
1567 .maxlen = sizeof(unsigned long),
1569 .proc_handler = mmap_min_addr_handler,
1574 .procname = "numa_zonelist_order",
1575 .data = &numa_zonelist_order,
1576 .maxlen = NUMA_ZONELIST_ORDER_LEN,
1578 .proc_handler = numa_zonelist_order_handler,
1581 #if (defined(CONFIG_X86_32) && !defined(CONFIG_UML))|| \
1582 (defined(CONFIG_SUPERH) && defined(CONFIG_VSYSCALL))
1584 .procname = "vdso_enabled",
1585 #ifdef CONFIG_X86_32
1586 .data = &vdso32_enabled,
1587 .maxlen = sizeof(vdso32_enabled),
1589 .data = &vdso_enabled,
1590 .maxlen = sizeof(vdso_enabled),
1593 .proc_handler = proc_dointvec,
1597 #ifdef CONFIG_HIGHMEM
1599 .procname = "highmem_is_dirtyable",
1600 .data = &vm_highmem_is_dirtyable,
1601 .maxlen = sizeof(vm_highmem_is_dirtyable),
1603 .proc_handler = proc_dointvec_minmax,
1608 #ifdef CONFIG_MEMORY_FAILURE
1610 .procname = "memory_failure_early_kill",
1611 .data = &sysctl_memory_failure_early_kill,
1612 .maxlen = sizeof(sysctl_memory_failure_early_kill),
1614 .proc_handler = proc_dointvec_minmax,
1619 .procname = "memory_failure_recovery",
1620 .data = &sysctl_memory_failure_recovery,
1621 .maxlen = sizeof(sysctl_memory_failure_recovery),
1623 .proc_handler = proc_dointvec_minmax,
1629 .procname = "user_reserve_kbytes",
1630 .data = &sysctl_user_reserve_kbytes,
1631 .maxlen = sizeof(sysctl_user_reserve_kbytes),
1633 .proc_handler = proc_doulongvec_minmax,
1636 .procname = "admin_reserve_kbytes",
1637 .data = &sysctl_admin_reserve_kbytes,
1638 .maxlen = sizeof(sysctl_admin_reserve_kbytes),
1640 .proc_handler = proc_doulongvec_minmax,
1642 #ifdef CONFIG_HAVE_ARCH_MMAP_RND_BITS
1644 .procname = "mmap_rnd_bits",
1645 .data = &mmap_rnd_bits,
1646 .maxlen = sizeof(mmap_rnd_bits),
1648 .proc_handler = proc_dointvec_minmax,
1649 .extra1 = (void *)&mmap_rnd_bits_min,
1650 .extra2 = (void *)&mmap_rnd_bits_max,
1653 #ifdef CONFIG_HAVE_ARCH_MMAP_RND_COMPAT_BITS
1655 .procname = "mmap_rnd_compat_bits",
1656 .data = &mmap_rnd_compat_bits,
1657 .maxlen = sizeof(mmap_rnd_compat_bits),
1659 .proc_handler = proc_dointvec_minmax,
1660 .extra1 = (void *)&mmap_rnd_compat_bits_min,
1661 .extra2 = (void *)&mmap_rnd_compat_bits_max,
1667 static struct ctl_table fs_table[] = {
1669 .procname = "inode-nr",
1670 .data = &inodes_stat,
1671 .maxlen = 2*sizeof(long),
1673 .proc_handler = proc_nr_inodes,
1676 .procname = "inode-state",
1677 .data = &inodes_stat,
1678 .maxlen = 7*sizeof(long),
1680 .proc_handler = proc_nr_inodes,
1683 .procname = "file-nr",
1684 .data = &files_stat,
1685 .maxlen = sizeof(files_stat),
1687 .proc_handler = proc_nr_files,
1690 .procname = "file-max",
1691 .data = &files_stat.max_files,
1692 .maxlen = sizeof(files_stat.max_files),
1694 .proc_handler = proc_doulongvec_minmax,
1697 .procname = "nr_open",
1698 .data = &sysctl_nr_open,
1699 .maxlen = sizeof(int),
1701 .proc_handler = proc_dointvec_minmax,
1702 .extra1 = &sysctl_nr_open_min,
1703 .extra2 = &sysctl_nr_open_max,
1706 .procname = "dentry-state",
1707 .data = &dentry_stat,
1708 .maxlen = 6*sizeof(long),
1710 .proc_handler = proc_nr_dentry,
1713 .procname = "overflowuid",
1714 .data = &fs_overflowuid,
1715 .maxlen = sizeof(int),
1717 .proc_handler = proc_dointvec_minmax,
1718 .extra1 = &minolduid,
1719 .extra2 = &maxolduid,
1722 .procname = "overflowgid",
1723 .data = &fs_overflowgid,
1724 .maxlen = sizeof(int),
1726 .proc_handler = proc_dointvec_minmax,
1727 .extra1 = &minolduid,
1728 .extra2 = &maxolduid,
1730 #ifdef CONFIG_FILE_LOCKING
1732 .procname = "leases-enable",
1733 .data = &leases_enable,
1734 .maxlen = sizeof(int),
1736 .proc_handler = proc_dointvec,
1739 #ifdef CONFIG_DNOTIFY
1741 .procname = "dir-notify-enable",
1742 .data = &dir_notify_enable,
1743 .maxlen = sizeof(int),
1745 .proc_handler = proc_dointvec,
1749 #ifdef CONFIG_FILE_LOCKING
1751 .procname = "lease-break-time",
1752 .data = &lease_break_time,
1753 .maxlen = sizeof(int),
1755 .proc_handler = proc_dointvec,
1760 .procname = "aio-nr",
1762 .maxlen = sizeof(aio_nr),
1764 .proc_handler = proc_doulongvec_minmax,
1767 .procname = "aio-max-nr",
1768 .data = &aio_max_nr,
1769 .maxlen = sizeof(aio_max_nr),
1771 .proc_handler = proc_doulongvec_minmax,
1773 #endif /* CONFIG_AIO */
1774 #ifdef CONFIG_INOTIFY_USER
1776 .procname = "inotify",
1778 .child = inotify_table,
1783 .procname = "epoll",
1785 .child = epoll_table,
1790 .procname = "protected_symlinks",
1791 .data = &sysctl_protected_symlinks,
1792 .maxlen = sizeof(int),
1794 .proc_handler = proc_dointvec_minmax,
1799 .procname = "protected_hardlinks",
1800 .data = &sysctl_protected_hardlinks,
1801 .maxlen = sizeof(int),
1803 .proc_handler = proc_dointvec_minmax,
1808 .procname = "suid_dumpable",
1809 .data = &suid_dumpable,
1810 .maxlen = sizeof(int),
1812 .proc_handler = proc_dointvec_minmax_coredump,
1816 #if defined(CONFIG_BINFMT_MISC) || defined(CONFIG_BINFMT_MISC_MODULE)
1818 .procname = "binfmt_misc",
1820 .child = sysctl_mount_point,
1824 .procname = "pipe-max-size",
1825 .data = &pipe_max_size,
1826 .maxlen = sizeof(int),
1828 .proc_handler = &pipe_proc_fn,
1829 .extra1 = &pipe_min_size,
1832 .procname = "pipe-user-pages-hard",
1833 .data = &pipe_user_pages_hard,
1834 .maxlen = sizeof(pipe_user_pages_hard),
1836 .proc_handler = proc_doulongvec_minmax,
1839 .procname = "pipe-user-pages-soft",
1840 .data = &pipe_user_pages_soft,
1841 .maxlen = sizeof(pipe_user_pages_soft),
1843 .proc_handler = proc_doulongvec_minmax,
1846 .procname = "mount-max",
1847 .data = &sysctl_mount_max,
1848 .maxlen = sizeof(unsigned int),
1850 .proc_handler = proc_dointvec_minmax,
1856 static struct ctl_table debug_table[] = {
1857 #ifdef CONFIG_SYSCTL_EXCEPTION_TRACE
1859 .procname = "exception-trace",
1860 .data = &show_unhandled_signals,
1861 .maxlen = sizeof(int),
1863 .proc_handler = proc_dointvec
1866 #if defined(CONFIG_OPTPROBES)
1868 .procname = "kprobes-optimization",
1869 .data = &sysctl_kprobes_optimization,
1870 .maxlen = sizeof(int),
1872 .proc_handler = proc_kprobes_optimization_handler,
1880 static struct ctl_table dev_table[] = {
1884 int __init sysctl_init(void)
1886 struct ctl_table_header *hdr;
1888 hdr = register_sysctl_table(sysctl_base_table);
1889 kmemleak_not_leak(hdr);
1893 #endif /* CONFIG_SYSCTL */
1899 #ifdef CONFIG_PROC_SYSCTL
1901 static int _proc_do_string(char *data, int maxlen, int write,
1902 char __user *buffer,
1903 size_t *lenp, loff_t *ppos)
1909 if (!data || !maxlen || !*lenp) {
1915 if (sysctl_writes_strict == SYSCTL_WRITES_STRICT) {
1916 /* Only continue writes not past the end of buffer. */
1918 if (len > maxlen - 1)
1925 /* Start writing from beginning of buffer. */
1931 while ((p - buffer) < *lenp && len < maxlen - 1) {
1932 if (get_user(c, p++))
1934 if (c == 0 || c == '\n')
1955 if (copy_to_user(buffer, data, len))
1958 if (put_user('\n', buffer + len))
1968 static void warn_sysctl_write(struct ctl_table *table)
1970 pr_warn_once("%s wrote to %s when file position was not 0!\n"
1971 "This will not be supported in the future. To silence this\n"
1972 "warning, set kernel.sysctl_writes_strict = -1\n",
1973 current->comm, table->procname);
1977 * proc_dostring - read a string sysctl
1978 * @table: the sysctl table
1979 * @write: %TRUE if this is a write to the sysctl file
1980 * @buffer: the user buffer
1981 * @lenp: the size of the user buffer
1982 * @ppos: file position
1984 * Reads/writes a string from/to the user buffer. If the kernel
1985 * buffer provided is not large enough to hold the string, the
1986 * string is truncated. The copied string is %NULL-terminated.
1987 * If the string is being read by the user process, it is copied
1988 * and a newline '\n' is added. It is truncated if the buffer is
1991 * Returns 0 on success.
1993 int proc_dostring(struct ctl_table *table, int write,
1994 void __user *buffer, size_t *lenp, loff_t *ppos)
1996 if (write && *ppos && sysctl_writes_strict == SYSCTL_WRITES_WARN)
1997 warn_sysctl_write(table);
1999 return _proc_do_string((char *)(table->data), table->maxlen, write,
2000 (char __user *)buffer, lenp, ppos);
2003 static size_t proc_skip_spaces(char **buf)
2006 char *tmp = skip_spaces(*buf);
2012 static void proc_skip_char(char **buf, size_t *size, const char v)
2022 #define TMPBUFLEN 22
2024 * proc_get_long - reads an ASCII formatted integer from a user buffer
2026 * @buf: a kernel buffer
2027 * @size: size of the kernel buffer
2028 * @val: this is where the number will be stored
2029 * @neg: set to %TRUE if number is negative
2030 * @perm_tr: a vector which contains the allowed trailers
2031 * @perm_tr_len: size of the perm_tr vector
2032 * @tr: pointer to store the trailer character
2034 * In case of success %0 is returned and @buf and @size are updated with
2035 * the amount of bytes read. If @tr is non-NULL and a trailing
2036 * character exists (size is non-zero after returning from this
2037 * function), @tr is updated with the trailing character.
2039 static int proc_get_long(char **buf, size_t *size,
2040 unsigned long *val, bool *neg,
2041 const char *perm_tr, unsigned perm_tr_len, char *tr)
2044 char *p, tmp[TMPBUFLEN];
2050 if (len > TMPBUFLEN - 1)
2051 len = TMPBUFLEN - 1;
2053 memcpy(tmp, *buf, len);
2057 if (*p == '-' && *size > 1) {
2065 *val = simple_strtoul(p, &p, 0);
2069 /* We don't know if the next char is whitespace thus we may accept
2070 * invalid integers (e.g. 1234...a) or two integers instead of one
2071 * (e.g. 123...1). So lets not allow such large numbers. */
2072 if (len == TMPBUFLEN - 1)
2075 if (len < *size && perm_tr_len && !memchr(perm_tr, *p, perm_tr_len))
2078 if (tr && (len < *size))
2088 * proc_put_long - converts an integer to a decimal ASCII formatted string
2090 * @buf: the user buffer
2091 * @size: the size of the user buffer
2092 * @val: the integer to be converted
2093 * @neg: sign of the number, %TRUE for negative
2095 * In case of success %0 is returned and @buf and @size are updated with
2096 * the amount of bytes written.
2098 static int proc_put_long(void __user **buf, size_t *size, unsigned long val,
2102 char tmp[TMPBUFLEN], *p = tmp;
2104 sprintf(p, "%s%lu", neg ? "-" : "", val);
2108 if (copy_to_user(*buf, tmp, len))
2116 static int proc_put_char(void __user **buf, size_t *size, char c)
2119 char __user **buffer = (char __user **)buf;
2120 if (put_user(c, *buffer))
2122 (*size)--, (*buffer)++;
2128 static int do_proc_dointvec_conv(bool *negp, unsigned long *lvalp,
2130 int write, void *data)
2134 if (*lvalp > (unsigned long) INT_MAX + 1)
2138 if (*lvalp > (unsigned long) INT_MAX)
2146 *lvalp = -(unsigned long)val;
2149 *lvalp = (unsigned long)val;
2155 static int do_proc_douintvec_conv(bool *negp, unsigned long *lvalp,
2157 int write, void *data)
2162 if (*lvalp > UINT_MAX)
2166 unsigned int val = *valp;
2168 *lvalp = (unsigned long)val;
2173 static const char proc_wspace_sep[] = { ' ', '\t', '\n' };
2175 static int __do_proc_dointvec(void *tbl_data, struct ctl_table *table,
2176 int write, void __user *buffer,
2177 size_t *lenp, loff_t *ppos,
2178 int (*conv)(bool *negp, unsigned long *lvalp, int *valp,
2179 int write, void *data),
2182 int *i, vleft, first = 1, err = 0;
2183 unsigned long page = 0;
2187 if (!tbl_data || !table->maxlen || !*lenp || (*ppos && !write)) {
2192 i = (int *) tbl_data;
2193 vleft = table->maxlen / sizeof(*i);
2197 conv = do_proc_dointvec_conv;
2201 switch (sysctl_writes_strict) {
2202 case SYSCTL_WRITES_STRICT:
2204 case SYSCTL_WRITES_WARN:
2205 warn_sysctl_write(table);
2212 if (left > PAGE_SIZE - 1)
2213 left = PAGE_SIZE - 1;
2214 page = __get_free_page(GFP_TEMPORARY);
2215 kbuf = (char *) page;
2218 if (copy_from_user(kbuf, buffer, left)) {
2225 for (; left && vleft--; i++, first=0) {
2230 left -= proc_skip_spaces(&kbuf);
2234 err = proc_get_long(&kbuf, &left, &lval, &neg,
2236 sizeof(proc_wspace_sep), NULL);
2239 if (conv(&neg, &lval, i, 1, data)) {
2244 if (conv(&neg, &lval, i, 0, data)) {
2249 err = proc_put_char(&buffer, &left, '\t');
2252 err = proc_put_long(&buffer, &left, lval, neg);
2258 if (!write && !first && left && !err)
2259 err = proc_put_char(&buffer, &left, '\n');
2260 if (write && !err && left)
2261 left -= proc_skip_spaces(&kbuf);
2266 return err ? : -EINVAL;
2274 static int do_proc_dointvec(struct ctl_table *table, int write,
2275 void __user *buffer, size_t *lenp, loff_t *ppos,
2276 int (*conv)(bool *negp, unsigned long *lvalp, int *valp,
2277 int write, void *data),
2280 return __do_proc_dointvec(table->data, table, write,
2281 buffer, lenp, ppos, conv, data);
2285 * proc_dointvec - read a vector of integers
2286 * @table: the sysctl table
2287 * @write: %TRUE if this is a write to the sysctl file
2288 * @buffer: the user buffer
2289 * @lenp: the size of the user buffer
2290 * @ppos: file position
2292 * Reads/writes up to table->maxlen/sizeof(unsigned int) integer
2293 * values from/to the user buffer, treated as an ASCII string.
2295 * Returns 0 on success.
2297 int proc_dointvec(struct ctl_table *table, int write,
2298 void __user *buffer, size_t *lenp, loff_t *ppos)
2300 return do_proc_dointvec(table, write, buffer, lenp, ppos, NULL, NULL);
2304 * proc_douintvec - read a vector of unsigned integers
2305 * @table: the sysctl table
2306 * @write: %TRUE if this is a write to the sysctl file
2307 * @buffer: the user buffer
2308 * @lenp: the size of the user buffer
2309 * @ppos: file position
2311 * Reads/writes up to table->maxlen/sizeof(unsigned int) unsigned integer
2312 * values from/to the user buffer, treated as an ASCII string.
2314 * Returns 0 on success.
2316 int proc_douintvec(struct ctl_table *table, int write,
2317 void __user *buffer, size_t *lenp, loff_t *ppos)
2319 return do_proc_dointvec(table, write, buffer, lenp, ppos,
2320 do_proc_douintvec_conv, NULL);
2324 * Taint values can only be increased
2325 * This means we can safely use a temporary.
2327 static int proc_taint(struct ctl_table *table, int write,
2328 void __user *buffer, size_t *lenp, loff_t *ppos)
2331 unsigned long tmptaint = get_taint();
2334 if (write && !capable(CAP_SYS_ADMIN))
2339 err = proc_doulongvec_minmax(&t, write, buffer, lenp, ppos);
2345 * Poor man's atomic or. Not worth adding a primitive
2346 * to everyone's atomic.h for this
2349 for (i = 0; i < BITS_PER_LONG && tmptaint >> i; i++) {
2350 if ((tmptaint >> i) & 1)
2351 add_taint(i, LOCKDEP_STILL_OK);
2358 #ifdef CONFIG_PRINTK
2359 static int proc_dointvec_minmax_sysadmin(struct ctl_table *table, int write,
2360 void __user *buffer, size_t *lenp, loff_t *ppos)
2362 if (write && !capable(CAP_SYS_ADMIN))
2365 return proc_dointvec_minmax(table, write, buffer, lenp, ppos);
2369 struct do_proc_dointvec_minmax_conv_param {
2374 static int do_proc_dointvec_minmax_conv(bool *negp, unsigned long *lvalp,
2376 int write, void *data)
2378 struct do_proc_dointvec_minmax_conv_param *param = data;
2380 int val = *negp ? -*lvalp : *lvalp;
2381 if ((param->min && *param->min > val) ||
2382 (param->max && *param->max < val))
2389 *lvalp = -(unsigned long)val;
2392 *lvalp = (unsigned long)val;
2399 * proc_dointvec_minmax - read a vector of integers with min/max values
2400 * @table: the sysctl table
2401 * @write: %TRUE if this is a write to the sysctl file
2402 * @buffer: the user buffer
2403 * @lenp: the size of the user buffer
2404 * @ppos: file position
2406 * Reads/writes up to table->maxlen/sizeof(unsigned int) integer
2407 * values from/to the user buffer, treated as an ASCII string.
2409 * This routine will ensure the values are within the range specified by
2410 * table->extra1 (min) and table->extra2 (max).
2412 * Returns 0 on success.
2414 int proc_dointvec_minmax(struct ctl_table *table, int write,
2415 void __user *buffer, size_t *lenp, loff_t *ppos)
2417 struct do_proc_dointvec_minmax_conv_param param = {
2418 .min = (int *) table->extra1,
2419 .max = (int *) table->extra2,
2421 return do_proc_dointvec(table, write, buffer, lenp, ppos,
2422 do_proc_dointvec_minmax_conv, ¶m);
2425 static void validate_coredump_safety(void)
2427 #ifdef CONFIG_COREDUMP
2428 if (suid_dumpable == SUID_DUMP_ROOT &&
2429 core_pattern[0] != '/' && core_pattern[0] != '|') {
2430 printk(KERN_WARNING "Unsafe core_pattern used with "\
2431 "suid_dumpable=2. Pipe handler or fully qualified "\
2432 "core dump path required.\n");
2437 static int proc_dointvec_minmax_coredump(struct ctl_table *table, int write,
2438 void __user *buffer, size_t *lenp, loff_t *ppos)
2440 int error = proc_dointvec_minmax(table, write, buffer, lenp, ppos);
2442 validate_coredump_safety();
2446 #ifdef CONFIG_COREDUMP
2447 static int proc_dostring_coredump(struct ctl_table *table, int write,
2448 void __user *buffer, size_t *lenp, loff_t *ppos)
2450 int error = proc_dostring(table, write, buffer, lenp, ppos);
2452 validate_coredump_safety();
2457 static int __do_proc_doulongvec_minmax(void *data, struct ctl_table *table, int write,
2458 void __user *buffer,
2459 size_t *lenp, loff_t *ppos,
2460 unsigned long convmul,
2461 unsigned long convdiv)
2463 unsigned long *i, *min, *max;
2464 int vleft, first = 1, err = 0;
2465 unsigned long page = 0;
2469 if (!data || !table->maxlen || !*lenp || (*ppos && !write)) {
2474 i = (unsigned long *) data;
2475 min = (unsigned long *) table->extra1;
2476 max = (unsigned long *) table->extra2;
2477 vleft = table->maxlen / sizeof(unsigned long);
2482 switch (sysctl_writes_strict) {
2483 case SYSCTL_WRITES_STRICT:
2485 case SYSCTL_WRITES_WARN:
2486 warn_sysctl_write(table);
2493 if (left > PAGE_SIZE - 1)
2494 left = PAGE_SIZE - 1;
2495 page = __get_free_page(GFP_TEMPORARY);
2496 kbuf = (char *) page;
2499 if (copy_from_user(kbuf, buffer, left)) {
2506 for (; left && vleft--; i++, first = 0) {
2512 left -= proc_skip_spaces(&kbuf);
2514 err = proc_get_long(&kbuf, &left, &val, &neg,
2516 sizeof(proc_wspace_sep), NULL);
2521 val = convmul * val / convdiv;
2522 if ((min && val < *min) || (max && val > *max))
2526 val = convdiv * (*i) / convmul;
2528 err = proc_put_char(&buffer, &left, '\t');
2532 err = proc_put_long(&buffer, &left, val, false);
2538 if (!write && !first && left && !err)
2539 err = proc_put_char(&buffer, &left, '\n');
2541 left -= proc_skip_spaces(&kbuf);
2546 return err ? : -EINVAL;
2554 static int do_proc_doulongvec_minmax(struct ctl_table *table, int write,
2555 void __user *buffer,
2556 size_t *lenp, loff_t *ppos,
2557 unsigned long convmul,
2558 unsigned long convdiv)
2560 return __do_proc_doulongvec_minmax(table->data, table, write,
2561 buffer, lenp, ppos, convmul, convdiv);
2565 * proc_doulongvec_minmax - read a vector of long integers with min/max values
2566 * @table: the sysctl table
2567 * @write: %TRUE if this is a write to the sysctl file
2568 * @buffer: the user buffer
2569 * @lenp: the size of the user buffer
2570 * @ppos: file position
2572 * Reads/writes up to table->maxlen/sizeof(unsigned long) unsigned long
2573 * values from/to the user buffer, treated as an ASCII string.
2575 * This routine will ensure the values are within the range specified by
2576 * table->extra1 (min) and table->extra2 (max).
2578 * Returns 0 on success.
2580 int proc_doulongvec_minmax(struct ctl_table *table, int write,
2581 void __user *buffer, size_t *lenp, loff_t *ppos)
2583 return do_proc_doulongvec_minmax(table, write, buffer, lenp, ppos, 1l, 1l);
2587 * proc_doulongvec_ms_jiffies_minmax - read a vector of millisecond values with min/max values
2588 * @table: the sysctl table
2589 * @write: %TRUE if this is a write to the sysctl file
2590 * @buffer: the user buffer
2591 * @lenp: the size of the user buffer
2592 * @ppos: file position
2594 * Reads/writes up to table->maxlen/sizeof(unsigned long) unsigned long
2595 * values from/to the user buffer, treated as an ASCII string. The values
2596 * are treated as milliseconds, and converted to jiffies when they are stored.
2598 * This routine will ensure the values are within the range specified by
2599 * table->extra1 (min) and table->extra2 (max).
2601 * Returns 0 on success.
2603 int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int write,
2604 void __user *buffer,
2605 size_t *lenp, loff_t *ppos)
2607 return do_proc_doulongvec_minmax(table, write, buffer,
2608 lenp, ppos, HZ, 1000l);
2612 static int do_proc_dointvec_jiffies_conv(bool *negp, unsigned long *lvalp,
2614 int write, void *data)
2617 if (*lvalp > LONG_MAX / HZ)
2619 *valp = *negp ? -(*lvalp*HZ) : (*lvalp*HZ);
2625 lval = -(unsigned long)val;
2628 lval = (unsigned long)val;
2635 static int do_proc_dointvec_userhz_jiffies_conv(bool *negp, unsigned long *lvalp,
2637 int write, void *data)
2640 if (USER_HZ < HZ && *lvalp > (LONG_MAX / HZ) * USER_HZ)
2642 *valp = clock_t_to_jiffies(*negp ? -*lvalp : *lvalp);
2648 lval = -(unsigned long)val;
2651 lval = (unsigned long)val;
2653 *lvalp = jiffies_to_clock_t(lval);
2658 static int do_proc_dointvec_ms_jiffies_conv(bool *negp, unsigned long *lvalp,
2660 int write, void *data)
2663 unsigned long jif = msecs_to_jiffies(*negp ? -*lvalp : *lvalp);
2673 lval = -(unsigned long)val;
2676 lval = (unsigned long)val;
2678 *lvalp = jiffies_to_msecs(lval);
2684 * proc_dointvec_jiffies - read a vector of integers as seconds
2685 * @table: the sysctl table
2686 * @write: %TRUE if this is a write to the sysctl file
2687 * @buffer: the user buffer
2688 * @lenp: the size of the user buffer
2689 * @ppos: file position
2691 * Reads/writes up to table->maxlen/sizeof(unsigned int) integer
2692 * values from/to the user buffer, treated as an ASCII string.
2693 * The values read are assumed to be in seconds, and are converted into
2696 * Returns 0 on success.
2698 int proc_dointvec_jiffies(struct ctl_table *table, int write,
2699 void __user *buffer, size_t *lenp, loff_t *ppos)
2701 return do_proc_dointvec(table,write,buffer,lenp,ppos,
2702 do_proc_dointvec_jiffies_conv,NULL);
2706 * proc_dointvec_userhz_jiffies - read a vector of integers as 1/USER_HZ seconds
2707 * @table: the sysctl table
2708 * @write: %TRUE if this is a write to the sysctl file
2709 * @buffer: the user buffer
2710 * @lenp: the size of the user buffer
2711 * @ppos: pointer to the file position
2713 * Reads/writes up to table->maxlen/sizeof(unsigned int) integer
2714 * values from/to the user buffer, treated as an ASCII string.
2715 * The values read are assumed to be in 1/USER_HZ seconds, and
2716 * are converted into jiffies.
2718 * Returns 0 on success.
2720 int proc_dointvec_userhz_jiffies(struct ctl_table *table, int write,
2721 void __user *buffer, size_t *lenp, loff_t *ppos)
2723 return do_proc_dointvec(table,write,buffer,lenp,ppos,
2724 do_proc_dointvec_userhz_jiffies_conv,NULL);
2728 * proc_dointvec_ms_jiffies - read a vector of integers as 1 milliseconds
2729 * @table: the sysctl table
2730 * @write: %TRUE if this is a write to the sysctl file
2731 * @buffer: the user buffer
2732 * @lenp: the size of the user buffer
2733 * @ppos: file position
2734 * @ppos: the current position in the file
2736 * Reads/writes up to table->maxlen/sizeof(unsigned int) integer
2737 * values from/to the user buffer, treated as an ASCII string.
2738 * The values read are assumed to be in 1/1000 seconds, and
2739 * are converted into jiffies.
2741 * Returns 0 on success.
2743 int proc_dointvec_ms_jiffies(struct ctl_table *table, int write,
2744 void __user *buffer, size_t *lenp, loff_t *ppos)
2746 return do_proc_dointvec(table, write, buffer, lenp, ppos,
2747 do_proc_dointvec_ms_jiffies_conv, NULL);
2750 static int proc_do_cad_pid(struct ctl_table *table, int write,
2751 void __user *buffer, size_t *lenp, loff_t *ppos)
2753 struct pid *new_pid;
2757 tmp = pid_vnr(cad_pid);
2759 r = __do_proc_dointvec(&tmp, table, write, buffer,
2760 lenp, ppos, NULL, NULL);
2764 new_pid = find_get_pid(tmp);
2768 put_pid(xchg(&cad_pid, new_pid));
2773 * proc_do_large_bitmap - read/write from/to a large bitmap
2774 * @table: the sysctl table
2775 * @write: %TRUE if this is a write to the sysctl file
2776 * @buffer: the user buffer
2777 * @lenp: the size of the user buffer
2778 * @ppos: file position
2780 * The bitmap is stored at table->data and the bitmap length (in bits)
2783 * We use a range comma separated format (e.g. 1,3-4,10-10) so that
2784 * large bitmaps may be represented in a compact manner. Writing into
2785 * the file will clear the bitmap then update it with the given input.
2787 * Returns 0 on success.
2789 int proc_do_large_bitmap(struct ctl_table *table, int write,
2790 void __user *buffer, size_t *lenp, loff_t *ppos)
2794 size_t left = *lenp;
2795 unsigned long bitmap_len = table->maxlen;
2796 unsigned long *bitmap = *(unsigned long **) table->data;
2797 unsigned long *tmp_bitmap = NULL;
2798 char tr_a[] = { '-', ',', '\n' }, tr_b[] = { ',', '\n', 0 }, c;
2800 if (!bitmap || !bitmap_len || !left || (*ppos && !write)) {
2806 unsigned long page = 0;
2809 if (left > PAGE_SIZE - 1)
2810 left = PAGE_SIZE - 1;
2812 page = __get_free_page(GFP_TEMPORARY);
2813 kbuf = (char *) page;
2816 if (copy_from_user(kbuf, buffer, left)) {
2822 tmp_bitmap = kzalloc(BITS_TO_LONGS(bitmap_len) * sizeof(unsigned long),
2828 proc_skip_char(&kbuf, &left, '\n');
2829 while (!err && left) {
2830 unsigned long val_a, val_b;
2833 err = proc_get_long(&kbuf, &left, &val_a, &neg, tr_a,
2837 if (val_a >= bitmap_len || neg) {
2849 err = proc_get_long(&kbuf, &left, &val_b,
2850 &neg, tr_b, sizeof(tr_b),
2854 if (val_b >= bitmap_len || neg ||
2865 bitmap_set(tmp_bitmap, val_a, val_b - val_a + 1);
2867 proc_skip_char(&kbuf, &left, '\n');
2871 unsigned long bit_a, bit_b = 0;
2874 bit_a = find_next_bit(bitmap, bitmap_len, bit_b);
2875 if (bit_a >= bitmap_len)
2877 bit_b = find_next_zero_bit(bitmap, bitmap_len,
2881 err = proc_put_char(&buffer, &left, ',');
2885 err = proc_put_long(&buffer, &left, bit_a, false);
2888 if (bit_a != bit_b) {
2889 err = proc_put_char(&buffer, &left, '-');
2892 err = proc_put_long(&buffer, &left, bit_b, false);
2900 err = proc_put_char(&buffer, &left, '\n');
2906 bitmap_or(bitmap, bitmap, tmp_bitmap, bitmap_len);
2908 bitmap_copy(bitmap, tmp_bitmap, bitmap_len);
2920 #else /* CONFIG_PROC_SYSCTL */
2922 int proc_dostring(struct ctl_table *table, int write,
2923 void __user *buffer, size_t *lenp, loff_t *ppos)
2928 int proc_dointvec(struct ctl_table *table, int write,
2929 void __user *buffer, size_t *lenp, loff_t *ppos)
2934 int proc_douintvec(struct ctl_table *table, int write,
2935 void __user *buffer, size_t *lenp, loff_t *ppos)
2940 int proc_dointvec_minmax(struct ctl_table *table, int write,
2941 void __user *buffer, size_t *lenp, loff_t *ppos)
2946 int proc_dointvec_jiffies(struct ctl_table *table, int write,
2947 void __user *buffer, size_t *lenp, loff_t *ppos)
2952 int proc_dointvec_userhz_jiffies(struct ctl_table *table, int write,
2953 void __user *buffer, size_t *lenp, loff_t *ppos)
2958 int proc_dointvec_ms_jiffies(struct ctl_table *table, int write,
2959 void __user *buffer, size_t *lenp, loff_t *ppos)
2964 int proc_doulongvec_minmax(struct ctl_table *table, int write,
2965 void __user *buffer, size_t *lenp, loff_t *ppos)
2970 int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int write,
2971 void __user *buffer,
2972 size_t *lenp, loff_t *ppos)
2978 #endif /* CONFIG_PROC_SYSCTL */
2981 * No sense putting this after each symbol definition, twice,
2982 * exception granted :-)
2984 EXPORT_SYMBOL(proc_dointvec);
2985 EXPORT_SYMBOL(proc_douintvec);
2986 EXPORT_SYMBOL(proc_dointvec_jiffies);
2987 EXPORT_SYMBOL(proc_dointvec_minmax);
2988 EXPORT_SYMBOL(proc_dointvec_userhz_jiffies);
2989 EXPORT_SYMBOL(proc_dointvec_ms_jiffies);
2990 EXPORT_SYMBOL(proc_dostring);
2991 EXPORT_SYMBOL(proc_doulongvec_minmax);
2992 EXPORT_SYMBOL(proc_doulongvec_ms_jiffies_minmax);