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 extra_free_kbytes;
108 extern int pid_max_min, pid_max_max;
109 extern int percpu_pagelist_fraction;
110 extern int compat_log;
111 extern int latencytop_enabled;
112 extern int sysctl_nr_open_min, sysctl_nr_open_max;
114 extern int sysctl_nr_trim_pages;
117 /* Constants used for minimum and maximum */
118 #ifdef CONFIG_LOCKUP_DETECTOR
119 static int sixty = 60;
122 static int __maybe_unused neg_one = -1;
125 static int __maybe_unused one = 1;
126 static int __maybe_unused two = 2;
127 static int __maybe_unused four = 4;
128 static unsigned long one_ul = 1;
129 static int one_hundred = 100;
131 static int ten_thousand = 10000;
134 /* this is needed for the proc_doulongvec_minmax of vm_dirty_bytes */
135 static unsigned long dirty_bytes_min = 2 * PAGE_SIZE;
137 /* this is needed for the proc_dointvec_minmax for [fs_]overflow UID and GID */
138 static int maxolduid = 65535;
139 static int minolduid;
141 static int ngroups_max = NGROUPS_MAX;
142 static const int cap_last_cap = CAP_LAST_CAP;
144 /*this is needed for proc_doulongvec_minmax of sysctl_hung_task_timeout_secs */
145 #ifdef CONFIG_DETECT_HUNG_TASK
146 static unsigned long hung_task_timeout_max = (LONG_MAX/HZ);
149 #ifdef CONFIG_INOTIFY_USER
150 #include <linux/inotify.h>
156 extern int pwrsw_enabled;
159 #ifdef CONFIG_SYSCTL_ARCH_UNALIGN_ALLOW
160 extern int unaligned_enabled;
164 extern int unaligned_dump_stack;
167 #ifdef CONFIG_SYSCTL_ARCH_UNALIGN_NO_WARN
168 extern int no_unaligned_warning;
171 #ifdef CONFIG_PROC_SYSCTL
173 #define SYSCTL_WRITES_LEGACY -1
174 #define SYSCTL_WRITES_WARN 0
175 #define SYSCTL_WRITES_STRICT 1
177 static int sysctl_writes_strict = SYSCTL_WRITES_WARN;
179 static int proc_do_cad_pid(struct ctl_table *table, int write,
180 void __user *buffer, size_t *lenp, loff_t *ppos);
181 static int proc_taint(struct ctl_table *table, int write,
182 void __user *buffer, size_t *lenp, loff_t *ppos);
186 static int proc_dointvec_minmax_sysadmin(struct ctl_table *table, int write,
187 void __user *buffer, size_t *lenp, loff_t *ppos);
190 static int proc_dointvec_minmax_coredump(struct ctl_table *table, int write,
191 void __user *buffer, size_t *lenp, loff_t *ppos);
192 #ifdef CONFIG_COREDUMP
193 static int proc_dostring_coredump(struct ctl_table *table, int write,
194 void __user *buffer, size_t *lenp, loff_t *ppos);
197 #ifdef CONFIG_MAGIC_SYSRQ
198 /* Note: sysrq code uses it's own private copy */
199 static int __sysrq_enabled = CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE;
201 static int sysrq_sysctl_handler(struct ctl_table *table, int write,
202 void __user *buffer, size_t *lenp,
207 error = proc_dointvec(table, write, buffer, lenp, ppos);
212 sysrq_toggle_support(__sysrq_enabled);
219 static struct ctl_table kern_table[];
220 static struct ctl_table vm_table[];
221 static struct ctl_table fs_table[];
222 static struct ctl_table debug_table[];
223 static struct ctl_table dev_table[];
224 extern struct ctl_table random_table[];
226 extern struct ctl_table epoll_table[];
229 #ifdef HAVE_ARCH_PICK_MMAP_LAYOUT
230 int sysctl_legacy_va_layout;
233 /* The default sysctl tables: */
235 static struct ctl_table sysctl_base_table[] = {
237 .procname = "kernel",
254 .child = debug_table,
264 #ifdef CONFIG_SCHED_DEBUG
265 static int min_sched_granularity_ns = 100000; /* 100 usecs */
266 static int max_sched_granularity_ns = NSEC_PER_SEC; /* 1 second */
267 static int min_wakeup_granularity_ns; /* 0 usecs */
268 static int max_wakeup_granularity_ns = NSEC_PER_SEC; /* 1 second */
270 static int min_sched_tunable_scaling = SCHED_TUNABLESCALING_NONE;
271 static int max_sched_tunable_scaling = SCHED_TUNABLESCALING_END-1;
272 #endif /* CONFIG_SMP */
273 #endif /* CONFIG_SCHED_DEBUG */
275 #ifdef CONFIG_COMPACTION
276 static int min_extfrag_threshold;
277 static int max_extfrag_threshold = 1000;
280 static struct ctl_table kern_table[] = {
282 .procname = "sched_child_runs_first",
283 .data = &sysctl_sched_child_runs_first,
284 .maxlen = sizeof(unsigned int),
286 .proc_handler = proc_dointvec,
288 #ifdef CONFIG_SCHED_DEBUG
290 .procname = "sched_min_granularity_ns",
291 .data = &sysctl_sched_min_granularity,
292 .maxlen = sizeof(unsigned int),
294 .proc_handler = sched_proc_update_handler,
295 .extra1 = &min_sched_granularity_ns,
296 .extra2 = &max_sched_granularity_ns,
299 .procname = "sched_latency_ns",
300 .data = &sysctl_sched_latency,
301 .maxlen = sizeof(unsigned int),
303 .proc_handler = sched_proc_update_handler,
304 .extra1 = &min_sched_granularity_ns,
305 .extra2 = &max_sched_granularity_ns,
308 .procname = "sched_is_big_little",
309 .data = &sysctl_sched_is_big_little,
310 .maxlen = sizeof(unsigned int),
312 .proc_handler = proc_dointvec,
314 #ifdef CONFIG_SCHED_WALT
316 .procname = "sched_use_walt_cpu_util",
317 .data = &sysctl_sched_use_walt_cpu_util,
318 .maxlen = sizeof(unsigned int),
320 .proc_handler = proc_dointvec,
323 .procname = "sched_use_walt_task_util",
324 .data = &sysctl_sched_use_walt_task_util,
325 .maxlen = sizeof(unsigned int),
327 .proc_handler = proc_dointvec,
330 .procname = "sched_walt_init_task_load_pct",
331 .data = &sysctl_sched_walt_init_task_load_pct,
332 .maxlen = sizeof(unsigned int),
334 .proc_handler = proc_dointvec,
337 .procname = "sched_walt_cpu_high_irqload",
338 .data = &sysctl_sched_walt_cpu_high_irqload,
339 .maxlen = sizeof(unsigned int),
341 .proc_handler = proc_dointvec,
345 .procname = "sched_sync_hint_enable",
346 .data = &sysctl_sched_sync_hint_enable,
347 .maxlen = sizeof(unsigned int),
349 .proc_handler = proc_dointvec,
352 .procname = "sched_initial_task_util",
353 .data = &sysctl_sched_initial_task_util,
354 .maxlen = sizeof(unsigned int),
356 .proc_handler = proc_dointvec,
359 .procname = "sched_cstate_aware",
360 .data = &sysctl_sched_cstate_aware,
361 .maxlen = sizeof(unsigned int),
363 .proc_handler = proc_dointvec,
366 .procname = "sched_wakeup_granularity_ns",
367 .data = &sysctl_sched_wakeup_granularity,
368 .maxlen = sizeof(unsigned int),
370 .proc_handler = sched_proc_update_handler,
371 .extra1 = &min_wakeup_granularity_ns,
372 .extra2 = &max_wakeup_granularity_ns,
376 .procname = "sched_tunable_scaling",
377 .data = &sysctl_sched_tunable_scaling,
378 .maxlen = sizeof(enum sched_tunable_scaling),
380 .proc_handler = sched_proc_update_handler,
381 .extra1 = &min_sched_tunable_scaling,
382 .extra2 = &max_sched_tunable_scaling,
385 .procname = "sched_migration_cost_ns",
386 .data = &sysctl_sched_migration_cost,
387 .maxlen = sizeof(unsigned int),
389 .proc_handler = proc_dointvec,
392 .procname = "sched_nr_migrate",
393 .data = &sysctl_sched_nr_migrate,
394 .maxlen = sizeof(unsigned int),
396 .proc_handler = proc_dointvec,
399 .procname = "sched_time_avg_ms",
400 .data = &sysctl_sched_time_avg,
401 .maxlen = sizeof(unsigned int),
403 .proc_handler = proc_dointvec,
406 .procname = "sched_shares_window_ns",
407 .data = &sysctl_sched_shares_window,
408 .maxlen = sizeof(unsigned int),
410 .proc_handler = proc_dointvec,
412 #endif /* CONFIG_SMP */
413 #ifdef CONFIG_NUMA_BALANCING
415 .procname = "numa_balancing_scan_delay_ms",
416 .data = &sysctl_numa_balancing_scan_delay,
417 .maxlen = sizeof(unsigned int),
419 .proc_handler = proc_dointvec,
422 .procname = "numa_balancing_scan_period_min_ms",
423 .data = &sysctl_numa_balancing_scan_period_min,
424 .maxlen = sizeof(unsigned int),
426 .proc_handler = proc_dointvec,
429 .procname = "numa_balancing_scan_period_max_ms",
430 .data = &sysctl_numa_balancing_scan_period_max,
431 .maxlen = sizeof(unsigned int),
433 .proc_handler = proc_dointvec,
436 .procname = "numa_balancing_scan_size_mb",
437 .data = &sysctl_numa_balancing_scan_size,
438 .maxlen = sizeof(unsigned int),
440 .proc_handler = proc_dointvec_minmax,
444 .procname = "numa_balancing",
445 .data = NULL, /* filled in by handler */
446 .maxlen = sizeof(unsigned int),
448 .proc_handler = sysctl_numa_balancing,
452 #endif /* CONFIG_NUMA_BALANCING */
453 #endif /* CONFIG_SCHED_DEBUG */
455 .procname = "sched_rt_period_us",
456 .data = &sysctl_sched_rt_period,
457 .maxlen = sizeof(unsigned int),
459 .proc_handler = sched_rt_handler,
462 .procname = "sched_rt_runtime_us",
463 .data = &sysctl_sched_rt_runtime,
464 .maxlen = sizeof(int),
466 .proc_handler = sched_rt_handler,
469 .procname = "sched_rr_timeslice_ms",
470 .data = &sched_rr_timeslice,
471 .maxlen = sizeof(int),
473 .proc_handler = sched_rr_handler,
475 #ifdef CONFIG_SCHED_AUTOGROUP
477 .procname = "sched_autogroup_enabled",
478 .data = &sysctl_sched_autogroup_enabled,
479 .maxlen = sizeof(unsigned int),
481 .proc_handler = proc_dointvec_minmax,
486 #ifdef CONFIG_CFS_BANDWIDTH
488 .procname = "sched_cfs_bandwidth_slice_us",
489 .data = &sysctl_sched_cfs_bandwidth_slice,
490 .maxlen = sizeof(unsigned int),
492 .proc_handler = proc_dointvec_minmax,
496 #ifdef CONFIG_SCHED_TUNE
498 .procname = "sched_cfs_boost",
499 .data = &sysctl_sched_cfs_boost,
500 .maxlen = sizeof(sysctl_sched_cfs_boost),
501 #ifdef CONFIG_CGROUP_SCHEDTUNE
506 .proc_handler = &sysctl_sched_cfs_boost_handler,
508 .extra2 = &one_hundred,
511 #ifdef CONFIG_PROVE_LOCKING
513 .procname = "prove_locking",
514 .data = &prove_locking,
515 .maxlen = sizeof(int),
517 .proc_handler = proc_dointvec,
520 #ifdef CONFIG_LOCK_STAT
522 .procname = "lock_stat",
524 .maxlen = sizeof(int),
526 .proc_handler = proc_dointvec,
531 .data = &panic_timeout,
532 .maxlen = sizeof(int),
534 .proc_handler = proc_dointvec,
536 #ifdef CONFIG_COREDUMP
538 .procname = "core_uses_pid",
539 .data = &core_uses_pid,
540 .maxlen = sizeof(int),
542 .proc_handler = proc_dointvec,
545 .procname = "core_pattern",
546 .data = core_pattern,
547 .maxlen = CORENAME_MAX_SIZE,
549 .proc_handler = proc_dostring_coredump,
552 .procname = "core_pipe_limit",
553 .data = &core_pipe_limit,
554 .maxlen = sizeof(unsigned int),
556 .proc_handler = proc_dointvec,
559 #ifdef CONFIG_PROC_SYSCTL
561 .procname = "tainted",
562 .maxlen = sizeof(long),
564 .proc_handler = proc_taint,
567 .procname = "sysctl_writes_strict",
568 .data = &sysctl_writes_strict,
569 .maxlen = sizeof(int),
571 .proc_handler = proc_dointvec_minmax,
576 #ifdef CONFIG_LATENCYTOP
578 .procname = "latencytop",
579 .data = &latencytop_enabled,
580 .maxlen = sizeof(int),
582 .proc_handler = proc_dointvec,
585 #ifdef CONFIG_BLK_DEV_INITRD
587 .procname = "real-root-dev",
588 .data = &real_root_dev,
589 .maxlen = sizeof(int),
591 .proc_handler = proc_dointvec,
595 .procname = "print-fatal-signals",
596 .data = &print_fatal_signals,
597 .maxlen = sizeof(int),
599 .proc_handler = proc_dointvec,
603 .procname = "reboot-cmd",
604 .data = reboot_command,
607 .proc_handler = proc_dostring,
610 .procname = "stop-a",
611 .data = &stop_a_enabled,
612 .maxlen = sizeof (int),
614 .proc_handler = proc_dointvec,
617 .procname = "scons-poweroff",
618 .data = &scons_pwroff,
619 .maxlen = sizeof (int),
621 .proc_handler = proc_dointvec,
624 #ifdef CONFIG_SPARC64
626 .procname = "tsb-ratio",
627 .data = &sysctl_tsb_ratio,
628 .maxlen = sizeof (int),
630 .proc_handler = proc_dointvec,
635 .procname = "soft-power",
636 .data = &pwrsw_enabled,
637 .maxlen = sizeof (int),
639 .proc_handler = proc_dointvec,
642 #ifdef CONFIG_SYSCTL_ARCH_UNALIGN_ALLOW
644 .procname = "unaligned-trap",
645 .data = &unaligned_enabled,
646 .maxlen = sizeof (int),
648 .proc_handler = proc_dointvec,
652 .procname = "ctrl-alt-del",
654 .maxlen = sizeof(int),
656 .proc_handler = proc_dointvec,
658 #ifdef CONFIG_FUNCTION_TRACER
660 .procname = "ftrace_enabled",
661 .data = &ftrace_enabled,
662 .maxlen = sizeof(int),
664 .proc_handler = ftrace_enable_sysctl,
667 #ifdef CONFIG_STACK_TRACER
669 .procname = "stack_tracer_enabled",
670 .data = &stack_tracer_enabled,
671 .maxlen = sizeof(int),
673 .proc_handler = stack_trace_sysctl,
676 #ifdef CONFIG_TRACING
678 .procname = "ftrace_dump_on_oops",
679 .data = &ftrace_dump_on_oops,
680 .maxlen = sizeof(int),
682 .proc_handler = proc_dointvec,
685 .procname = "traceoff_on_warning",
686 .data = &__disable_trace_on_warning,
687 .maxlen = sizeof(__disable_trace_on_warning),
689 .proc_handler = proc_dointvec,
692 .procname = "tracepoint_printk",
693 .data = &tracepoint_printk,
694 .maxlen = sizeof(tracepoint_printk),
696 .proc_handler = proc_dointvec,
699 #ifdef CONFIG_KEXEC_CORE
701 .procname = "kexec_load_disabled",
702 .data = &kexec_load_disabled,
703 .maxlen = sizeof(int),
705 /* only handle a transition from default "0" to "1" */
706 .proc_handler = proc_dointvec_minmax,
711 #ifdef CONFIG_MODULES
713 .procname = "modprobe",
714 .data = &modprobe_path,
715 .maxlen = KMOD_PATH_LEN,
717 .proc_handler = proc_dostring,
720 .procname = "modules_disabled",
721 .data = &modules_disabled,
722 .maxlen = sizeof(int),
724 /* only handle a transition from default "0" to "1" */
725 .proc_handler = proc_dointvec_minmax,
730 #ifdef CONFIG_UEVENT_HELPER
732 .procname = "hotplug",
733 .data = &uevent_helper,
734 .maxlen = UEVENT_HELPER_PATH_LEN,
736 .proc_handler = proc_dostring,
739 #ifdef CONFIG_CHR_DEV_SG
741 .procname = "sg-big-buff",
742 .data = &sg_big_buff,
743 .maxlen = sizeof (int),
745 .proc_handler = proc_dointvec,
748 #ifdef CONFIG_BSD_PROCESS_ACCT
752 .maxlen = 3*sizeof(int),
754 .proc_handler = proc_dointvec,
757 #ifdef CONFIG_MAGIC_SYSRQ
760 .data = &__sysrq_enabled,
761 .maxlen = sizeof (int),
763 .proc_handler = sysrq_sysctl_handler,
766 #ifdef CONFIG_PROC_SYSCTL
768 .procname = "cad_pid",
770 .maxlen = sizeof (int),
772 .proc_handler = proc_do_cad_pid,
776 .procname = "threads-max",
778 .maxlen = sizeof(int),
780 .proc_handler = sysctl_max_threads,
783 .procname = "random",
785 .child = random_table,
788 .procname = "usermodehelper",
790 .child = usermodehelper_table,
793 .procname = "overflowuid",
794 .data = &overflowuid,
795 .maxlen = sizeof(int),
797 .proc_handler = proc_dointvec_minmax,
798 .extra1 = &minolduid,
799 .extra2 = &maxolduid,
802 .procname = "overflowgid",
803 .data = &overflowgid,
804 .maxlen = sizeof(int),
806 .proc_handler = proc_dointvec_minmax,
807 .extra1 = &minolduid,
808 .extra2 = &maxolduid,
811 #ifdef CONFIG_MATHEMU
813 .procname = "ieee_emulation_warnings",
814 .data = &sysctl_ieee_emulation_warnings,
815 .maxlen = sizeof(int),
817 .proc_handler = proc_dointvec,
821 .procname = "userprocess_debug",
822 .data = &show_unhandled_signals,
823 .maxlen = sizeof(int),
825 .proc_handler = proc_dointvec,
829 .procname = "pid_max",
831 .maxlen = sizeof (int),
833 .proc_handler = proc_dointvec_minmax,
834 .extra1 = &pid_max_min,
835 .extra2 = &pid_max_max,
838 .procname = "panic_on_oops",
839 .data = &panic_on_oops,
840 .maxlen = sizeof(int),
842 .proc_handler = proc_dointvec,
844 #if defined CONFIG_PRINTK
846 .procname = "printk",
847 .data = &console_loglevel,
848 .maxlen = 4*sizeof(int),
850 .proc_handler = proc_dointvec,
853 .procname = "printk_ratelimit",
854 .data = &printk_ratelimit_state.interval,
855 .maxlen = sizeof(int),
857 .proc_handler = proc_dointvec_jiffies,
860 .procname = "printk_ratelimit_burst",
861 .data = &printk_ratelimit_state.burst,
862 .maxlen = sizeof(int),
864 .proc_handler = proc_dointvec,
867 .procname = "printk_delay",
868 .data = &printk_delay_msec,
869 .maxlen = sizeof(int),
871 .proc_handler = proc_dointvec_minmax,
873 .extra2 = &ten_thousand,
876 .procname = "dmesg_restrict",
877 .data = &dmesg_restrict,
878 .maxlen = sizeof(int),
880 .proc_handler = proc_dointvec_minmax_sysadmin,
885 .procname = "kptr_restrict",
886 .data = &kptr_restrict,
887 .maxlen = sizeof(int),
889 .proc_handler = proc_dointvec_minmax_sysadmin,
895 .procname = "ngroups_max",
896 .data = &ngroups_max,
897 .maxlen = sizeof (int),
899 .proc_handler = proc_dointvec,
902 .procname = "cap_last_cap",
903 .data = (void *)&cap_last_cap,
904 .maxlen = sizeof(int),
906 .proc_handler = proc_dointvec,
908 #if defined(CONFIG_LOCKUP_DETECTOR)
910 .procname = "watchdog",
911 .data = &watchdog_user_enabled,
912 .maxlen = sizeof (int),
914 .proc_handler = proc_watchdog,
919 .procname = "watchdog_thresh",
920 .data = &watchdog_thresh,
921 .maxlen = sizeof(int),
923 .proc_handler = proc_watchdog_thresh,
928 .procname = "nmi_watchdog",
929 .data = &nmi_watchdog_enabled,
930 .maxlen = sizeof (int),
932 .proc_handler = proc_nmi_watchdog,
934 #if defined(CONFIG_HAVE_NMI_WATCHDOG) || defined(CONFIG_HARDLOCKUP_DETECTOR)
941 .procname = "soft_watchdog",
942 .data = &soft_watchdog_enabled,
943 .maxlen = sizeof (int),
945 .proc_handler = proc_soft_watchdog,
950 .procname = "watchdog_cpumask",
951 .data = &watchdog_cpumask_bits,
954 .proc_handler = proc_watchdog_cpumask,
957 .procname = "softlockup_panic",
958 .data = &softlockup_panic,
959 .maxlen = sizeof(int),
961 .proc_handler = proc_dointvec_minmax,
965 #ifdef CONFIG_HARDLOCKUP_DETECTOR
967 .procname = "hardlockup_panic",
968 .data = &hardlockup_panic,
969 .maxlen = sizeof(int),
971 .proc_handler = proc_dointvec_minmax,
978 .procname = "softlockup_all_cpu_backtrace",
979 .data = &sysctl_softlockup_all_cpu_backtrace,
980 .maxlen = sizeof(int),
982 .proc_handler = proc_dointvec_minmax,
987 .procname = "hardlockup_all_cpu_backtrace",
988 .data = &sysctl_hardlockup_all_cpu_backtrace,
989 .maxlen = sizeof(int),
991 .proc_handler = proc_dointvec_minmax,
995 #endif /* CONFIG_SMP */
997 #if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86)
999 .procname = "unknown_nmi_panic",
1000 .data = &unknown_nmi_panic,
1001 .maxlen = sizeof (int),
1003 .proc_handler = proc_dointvec,
1006 #if defined(CONFIG_X86)
1008 .procname = "panic_on_unrecovered_nmi",
1009 .data = &panic_on_unrecovered_nmi,
1010 .maxlen = sizeof(int),
1012 .proc_handler = proc_dointvec,
1015 .procname = "panic_on_io_nmi",
1016 .data = &panic_on_io_nmi,
1017 .maxlen = sizeof(int),
1019 .proc_handler = proc_dointvec,
1021 #ifdef CONFIG_DEBUG_STACKOVERFLOW
1023 .procname = "panic_on_stackoverflow",
1024 .data = &sysctl_panic_on_stackoverflow,
1025 .maxlen = sizeof(int),
1027 .proc_handler = proc_dointvec,
1031 .procname = "bootloader_type",
1032 .data = &bootloader_type,
1033 .maxlen = sizeof (int),
1035 .proc_handler = proc_dointvec,
1038 .procname = "bootloader_version",
1039 .data = &bootloader_version,
1040 .maxlen = sizeof (int),
1042 .proc_handler = proc_dointvec,
1045 .procname = "kstack_depth_to_print",
1046 .data = &kstack_depth_to_print,
1047 .maxlen = sizeof(int),
1049 .proc_handler = proc_dointvec,
1052 .procname = "io_delay_type",
1053 .data = &io_delay_type,
1054 .maxlen = sizeof(int),
1056 .proc_handler = proc_dointvec,
1059 #if defined(CONFIG_MMU)
1061 .procname = "randomize_va_space",
1062 .data = &randomize_va_space,
1063 .maxlen = sizeof(int),
1065 .proc_handler = proc_dointvec,
1068 #if defined(CONFIG_S390) && defined(CONFIG_SMP)
1070 .procname = "spin_retry",
1071 .data = &spin_retry,
1072 .maxlen = sizeof (int),
1074 .proc_handler = proc_dointvec,
1077 #if defined(CONFIG_ACPI_SLEEP) && defined(CONFIG_X86)
1079 .procname = "acpi_video_flags",
1080 .data = &acpi_realmode_flags,
1081 .maxlen = sizeof (unsigned long),
1083 .proc_handler = proc_doulongvec_minmax,
1086 #ifdef CONFIG_SYSCTL_ARCH_UNALIGN_NO_WARN
1088 .procname = "ignore-unaligned-usertrap",
1089 .data = &no_unaligned_warning,
1090 .maxlen = sizeof (int),
1092 .proc_handler = proc_dointvec,
1097 .procname = "unaligned-dump-stack",
1098 .data = &unaligned_dump_stack,
1099 .maxlen = sizeof (int),
1101 .proc_handler = proc_dointvec,
1104 #ifdef CONFIG_DETECT_HUNG_TASK
1106 .procname = "hung_task_panic",
1107 .data = &sysctl_hung_task_panic,
1108 .maxlen = sizeof(int),
1110 .proc_handler = proc_dointvec_minmax,
1115 .procname = "hung_task_check_count",
1116 .data = &sysctl_hung_task_check_count,
1117 .maxlen = sizeof(int),
1119 .proc_handler = proc_dointvec_minmax,
1123 .procname = "hung_task_timeout_secs",
1124 .data = &sysctl_hung_task_timeout_secs,
1125 .maxlen = sizeof(unsigned long),
1127 .proc_handler = proc_dohung_task_timeout_secs,
1128 .extra2 = &hung_task_timeout_max,
1131 .procname = "hung_task_warnings",
1132 .data = &sysctl_hung_task_warnings,
1133 .maxlen = sizeof(int),
1135 .proc_handler = proc_dointvec_minmax,
1139 #ifdef CONFIG_COMPAT
1141 .procname = "compat-log",
1142 .data = &compat_log,
1143 .maxlen = sizeof (int),
1145 .proc_handler = proc_dointvec,
1148 #ifdef CONFIG_RT_MUTEXES
1150 .procname = "max_lock_depth",
1151 .data = &max_lock_depth,
1152 .maxlen = sizeof(int),
1154 .proc_handler = proc_dointvec,
1158 .procname = "poweroff_cmd",
1159 .data = &poweroff_cmd,
1160 .maxlen = POWEROFF_CMD_PATH_LEN,
1162 .proc_handler = proc_dostring,
1168 .child = key_sysctls,
1171 #ifdef CONFIG_PERF_EVENTS
1173 * User-space scripts rely on the existence of this file
1174 * as a feature check for perf_events being enabled.
1176 * So it's an ABI, do not remove!
1179 .procname = "perf_event_paranoid",
1180 .data = &sysctl_perf_event_paranoid,
1181 .maxlen = sizeof(sysctl_perf_event_paranoid),
1183 .proc_handler = proc_dointvec,
1186 .procname = "perf_event_mlock_kb",
1187 .data = &sysctl_perf_event_mlock,
1188 .maxlen = sizeof(sysctl_perf_event_mlock),
1190 .proc_handler = proc_dointvec,
1193 .procname = "perf_event_max_sample_rate",
1194 .data = &sysctl_perf_event_sample_rate,
1195 .maxlen = sizeof(sysctl_perf_event_sample_rate),
1197 .proc_handler = perf_proc_update_handler,
1201 .procname = "perf_cpu_time_max_percent",
1202 .data = &sysctl_perf_cpu_time_max_percent,
1203 .maxlen = sizeof(sysctl_perf_cpu_time_max_percent),
1205 .proc_handler = perf_cpu_time_max_percent_handler,
1207 .extra2 = &one_hundred,
1210 #ifdef CONFIG_KMEMCHECK
1212 .procname = "kmemcheck",
1213 .data = &kmemcheck_enabled,
1214 .maxlen = sizeof(int),
1216 .proc_handler = proc_dointvec,
1220 .procname = "panic_on_warn",
1221 .data = &panic_on_warn,
1222 .maxlen = sizeof(int),
1224 .proc_handler = proc_dointvec_minmax,
1228 #if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ_COMMON)
1230 .procname = "timer_migration",
1231 .data = &sysctl_timer_migration,
1232 .maxlen = sizeof(unsigned int),
1234 .proc_handler = timer_migration_handler,
1237 #ifdef CONFIG_BPF_SYSCALL
1239 .procname = "unprivileged_bpf_disabled",
1240 .data = &sysctl_unprivileged_bpf_disabled,
1241 .maxlen = sizeof(sysctl_unprivileged_bpf_disabled),
1243 /* only handle a transition from default "0" to "1" */
1244 .proc_handler = proc_dointvec_minmax,
1252 static struct ctl_table vm_table[] = {
1254 .procname = "overcommit_memory",
1255 .data = &sysctl_overcommit_memory,
1256 .maxlen = sizeof(sysctl_overcommit_memory),
1258 .proc_handler = proc_dointvec_minmax,
1263 .procname = "panic_on_oom",
1264 .data = &sysctl_panic_on_oom,
1265 .maxlen = sizeof(sysctl_panic_on_oom),
1267 .proc_handler = proc_dointvec_minmax,
1272 .procname = "oom_kill_allocating_task",
1273 .data = &sysctl_oom_kill_allocating_task,
1274 .maxlen = sizeof(sysctl_oom_kill_allocating_task),
1276 .proc_handler = proc_dointvec,
1279 .procname = "oom_dump_tasks",
1280 .data = &sysctl_oom_dump_tasks,
1281 .maxlen = sizeof(sysctl_oom_dump_tasks),
1283 .proc_handler = proc_dointvec,
1286 .procname = "overcommit_ratio",
1287 .data = &sysctl_overcommit_ratio,
1288 .maxlen = sizeof(sysctl_overcommit_ratio),
1290 .proc_handler = overcommit_ratio_handler,
1293 .procname = "overcommit_kbytes",
1294 .data = &sysctl_overcommit_kbytes,
1295 .maxlen = sizeof(sysctl_overcommit_kbytes),
1297 .proc_handler = overcommit_kbytes_handler,
1300 .procname = "page-cluster",
1301 .data = &page_cluster,
1302 .maxlen = sizeof(int),
1304 .proc_handler = proc_dointvec_minmax,
1308 .procname = "dirty_background_ratio",
1309 .data = &dirty_background_ratio,
1310 .maxlen = sizeof(dirty_background_ratio),
1312 .proc_handler = dirty_background_ratio_handler,
1314 .extra2 = &one_hundred,
1317 .procname = "dirty_background_bytes",
1318 .data = &dirty_background_bytes,
1319 .maxlen = sizeof(dirty_background_bytes),
1321 .proc_handler = dirty_background_bytes_handler,
1325 .procname = "dirty_ratio",
1326 .data = &vm_dirty_ratio,
1327 .maxlen = sizeof(vm_dirty_ratio),
1329 .proc_handler = dirty_ratio_handler,
1331 .extra2 = &one_hundred,
1334 .procname = "dirty_bytes",
1335 .data = &vm_dirty_bytes,
1336 .maxlen = sizeof(vm_dirty_bytes),
1338 .proc_handler = dirty_bytes_handler,
1339 .extra1 = &dirty_bytes_min,
1342 .procname = "dirty_writeback_centisecs",
1343 .data = &dirty_writeback_interval,
1344 .maxlen = sizeof(dirty_writeback_interval),
1346 .proc_handler = dirty_writeback_centisecs_handler,
1349 .procname = "dirty_expire_centisecs",
1350 .data = &dirty_expire_interval,
1351 .maxlen = sizeof(dirty_expire_interval),
1353 .proc_handler = proc_dointvec_minmax,
1357 .procname = "dirtytime_expire_seconds",
1358 .data = &dirtytime_expire_interval,
1359 .maxlen = sizeof(dirty_expire_interval),
1361 .proc_handler = dirtytime_interval_handler,
1365 .procname = "nr_pdflush_threads",
1366 .mode = 0444 /* read-only */,
1367 .proc_handler = pdflush_proc_obsolete,
1370 .procname = "swappiness",
1371 .data = &vm_swappiness,
1372 .maxlen = sizeof(vm_swappiness),
1374 .proc_handler = proc_dointvec_minmax,
1376 .extra2 = &one_hundred,
1378 #ifdef CONFIG_HUGETLB_PAGE
1380 .procname = "nr_hugepages",
1382 .maxlen = sizeof(unsigned long),
1384 .proc_handler = hugetlb_sysctl_handler,
1388 .procname = "nr_hugepages_mempolicy",
1390 .maxlen = sizeof(unsigned long),
1392 .proc_handler = &hugetlb_mempolicy_sysctl_handler,
1396 .procname = "hugetlb_shm_group",
1397 .data = &sysctl_hugetlb_shm_group,
1398 .maxlen = sizeof(gid_t),
1400 .proc_handler = proc_dointvec,
1403 .procname = "hugepages_treat_as_movable",
1404 .data = &hugepages_treat_as_movable,
1405 .maxlen = sizeof(int),
1407 .proc_handler = proc_dointvec,
1410 .procname = "nr_overcommit_hugepages",
1412 .maxlen = sizeof(unsigned long),
1414 .proc_handler = hugetlb_overcommit_handler,
1418 .procname = "lowmem_reserve_ratio",
1419 .data = &sysctl_lowmem_reserve_ratio,
1420 .maxlen = sizeof(sysctl_lowmem_reserve_ratio),
1422 .proc_handler = lowmem_reserve_ratio_sysctl_handler,
1425 .procname = "drop_caches",
1426 .data = &sysctl_drop_caches,
1427 .maxlen = sizeof(int),
1429 .proc_handler = drop_caches_sysctl_handler,
1433 #ifdef CONFIG_COMPACTION
1435 .procname = "compact_memory",
1436 .data = &sysctl_compact_memory,
1437 .maxlen = sizeof(int),
1439 .proc_handler = sysctl_compaction_handler,
1442 .procname = "extfrag_threshold",
1443 .data = &sysctl_extfrag_threshold,
1444 .maxlen = sizeof(int),
1446 .proc_handler = sysctl_extfrag_handler,
1447 .extra1 = &min_extfrag_threshold,
1448 .extra2 = &max_extfrag_threshold,
1451 .procname = "compact_unevictable_allowed",
1452 .data = &sysctl_compact_unevictable_allowed,
1453 .maxlen = sizeof(int),
1455 .proc_handler = proc_dointvec,
1460 #endif /* CONFIG_COMPACTION */
1462 .procname = "min_free_kbytes",
1463 .data = &min_free_kbytes,
1464 .maxlen = sizeof(min_free_kbytes),
1466 .proc_handler = min_free_kbytes_sysctl_handler,
1470 .procname = "extra_free_kbytes",
1471 .data = &extra_free_kbytes,
1472 .maxlen = sizeof(extra_free_kbytes),
1474 .proc_handler = min_free_kbytes_sysctl_handler,
1478 .procname = "percpu_pagelist_fraction",
1479 .data = &percpu_pagelist_fraction,
1480 .maxlen = sizeof(percpu_pagelist_fraction),
1482 .proc_handler = percpu_pagelist_fraction_sysctl_handler,
1487 .procname = "max_map_count",
1488 .data = &sysctl_max_map_count,
1489 .maxlen = sizeof(sysctl_max_map_count),
1491 .proc_handler = proc_dointvec_minmax,
1496 .procname = "nr_trim_pages",
1497 .data = &sysctl_nr_trim_pages,
1498 .maxlen = sizeof(sysctl_nr_trim_pages),
1500 .proc_handler = proc_dointvec_minmax,
1505 .procname = "laptop_mode",
1506 .data = &laptop_mode,
1507 .maxlen = sizeof(laptop_mode),
1509 .proc_handler = proc_dointvec_jiffies,
1512 .procname = "block_dump",
1513 .data = &block_dump,
1514 .maxlen = sizeof(block_dump),
1516 .proc_handler = proc_dointvec,
1520 .procname = "vfs_cache_pressure",
1521 .data = &sysctl_vfs_cache_pressure,
1522 .maxlen = sizeof(sysctl_vfs_cache_pressure),
1524 .proc_handler = proc_dointvec,
1527 #ifdef HAVE_ARCH_PICK_MMAP_LAYOUT
1529 .procname = "legacy_va_layout",
1530 .data = &sysctl_legacy_va_layout,
1531 .maxlen = sizeof(sysctl_legacy_va_layout),
1533 .proc_handler = proc_dointvec,
1539 .procname = "zone_reclaim_mode",
1540 .data = &zone_reclaim_mode,
1541 .maxlen = sizeof(zone_reclaim_mode),
1543 .proc_handler = proc_dointvec,
1547 .procname = "min_unmapped_ratio",
1548 .data = &sysctl_min_unmapped_ratio,
1549 .maxlen = sizeof(sysctl_min_unmapped_ratio),
1551 .proc_handler = sysctl_min_unmapped_ratio_sysctl_handler,
1553 .extra2 = &one_hundred,
1556 .procname = "min_slab_ratio",
1557 .data = &sysctl_min_slab_ratio,
1558 .maxlen = sizeof(sysctl_min_slab_ratio),
1560 .proc_handler = sysctl_min_slab_ratio_sysctl_handler,
1562 .extra2 = &one_hundred,
1567 .procname = "stat_interval",
1568 .data = &sysctl_stat_interval,
1569 .maxlen = sizeof(sysctl_stat_interval),
1571 .proc_handler = proc_dointvec_jiffies,
1576 .procname = "mmap_min_addr",
1577 .data = &dac_mmap_min_addr,
1578 .maxlen = sizeof(unsigned long),
1580 .proc_handler = mmap_min_addr_handler,
1585 .procname = "numa_zonelist_order",
1586 .data = &numa_zonelist_order,
1587 .maxlen = NUMA_ZONELIST_ORDER_LEN,
1589 .proc_handler = numa_zonelist_order_handler,
1592 #if (defined(CONFIG_X86_32) && !defined(CONFIG_UML))|| \
1593 (defined(CONFIG_SUPERH) && defined(CONFIG_VSYSCALL))
1595 .procname = "vdso_enabled",
1596 #ifdef CONFIG_X86_32
1597 .data = &vdso32_enabled,
1598 .maxlen = sizeof(vdso32_enabled),
1600 .data = &vdso_enabled,
1601 .maxlen = sizeof(vdso_enabled),
1604 .proc_handler = proc_dointvec,
1608 #ifdef CONFIG_HIGHMEM
1610 .procname = "highmem_is_dirtyable",
1611 .data = &vm_highmem_is_dirtyable,
1612 .maxlen = sizeof(vm_highmem_is_dirtyable),
1614 .proc_handler = proc_dointvec_minmax,
1619 #ifdef CONFIG_MEMORY_FAILURE
1621 .procname = "memory_failure_early_kill",
1622 .data = &sysctl_memory_failure_early_kill,
1623 .maxlen = sizeof(sysctl_memory_failure_early_kill),
1625 .proc_handler = proc_dointvec_minmax,
1630 .procname = "memory_failure_recovery",
1631 .data = &sysctl_memory_failure_recovery,
1632 .maxlen = sizeof(sysctl_memory_failure_recovery),
1634 .proc_handler = proc_dointvec_minmax,
1640 .procname = "user_reserve_kbytes",
1641 .data = &sysctl_user_reserve_kbytes,
1642 .maxlen = sizeof(sysctl_user_reserve_kbytes),
1644 .proc_handler = proc_doulongvec_minmax,
1647 .procname = "admin_reserve_kbytes",
1648 .data = &sysctl_admin_reserve_kbytes,
1649 .maxlen = sizeof(sysctl_admin_reserve_kbytes),
1651 .proc_handler = proc_doulongvec_minmax,
1653 #ifdef CONFIG_HAVE_ARCH_MMAP_RND_BITS
1655 .procname = "mmap_rnd_bits",
1656 .data = &mmap_rnd_bits,
1657 .maxlen = sizeof(mmap_rnd_bits),
1659 .proc_handler = proc_dointvec_minmax,
1660 .extra1 = (void *)&mmap_rnd_bits_min,
1661 .extra2 = (void *)&mmap_rnd_bits_max,
1664 #ifdef CONFIG_HAVE_ARCH_MMAP_RND_COMPAT_BITS
1666 .procname = "mmap_rnd_compat_bits",
1667 .data = &mmap_rnd_compat_bits,
1668 .maxlen = sizeof(mmap_rnd_compat_bits),
1670 .proc_handler = proc_dointvec_minmax,
1671 .extra1 = (void *)&mmap_rnd_compat_bits_min,
1672 .extra2 = (void *)&mmap_rnd_compat_bits_max,
1678 static struct ctl_table fs_table[] = {
1680 .procname = "inode-nr",
1681 .data = &inodes_stat,
1682 .maxlen = 2*sizeof(long),
1684 .proc_handler = proc_nr_inodes,
1687 .procname = "inode-state",
1688 .data = &inodes_stat,
1689 .maxlen = 7*sizeof(long),
1691 .proc_handler = proc_nr_inodes,
1694 .procname = "file-nr",
1695 .data = &files_stat,
1696 .maxlen = sizeof(files_stat),
1698 .proc_handler = proc_nr_files,
1701 .procname = "file-max",
1702 .data = &files_stat.max_files,
1703 .maxlen = sizeof(files_stat.max_files),
1705 .proc_handler = proc_doulongvec_minmax,
1708 .procname = "nr_open",
1709 .data = &sysctl_nr_open,
1710 .maxlen = sizeof(int),
1712 .proc_handler = proc_dointvec_minmax,
1713 .extra1 = &sysctl_nr_open_min,
1714 .extra2 = &sysctl_nr_open_max,
1717 .procname = "dentry-state",
1718 .data = &dentry_stat,
1719 .maxlen = 6*sizeof(long),
1721 .proc_handler = proc_nr_dentry,
1724 .procname = "overflowuid",
1725 .data = &fs_overflowuid,
1726 .maxlen = sizeof(int),
1728 .proc_handler = proc_dointvec_minmax,
1729 .extra1 = &minolduid,
1730 .extra2 = &maxolduid,
1733 .procname = "overflowgid",
1734 .data = &fs_overflowgid,
1735 .maxlen = sizeof(int),
1737 .proc_handler = proc_dointvec_minmax,
1738 .extra1 = &minolduid,
1739 .extra2 = &maxolduid,
1741 #ifdef CONFIG_FILE_LOCKING
1743 .procname = "leases-enable",
1744 .data = &leases_enable,
1745 .maxlen = sizeof(int),
1747 .proc_handler = proc_dointvec,
1750 #ifdef CONFIG_DNOTIFY
1752 .procname = "dir-notify-enable",
1753 .data = &dir_notify_enable,
1754 .maxlen = sizeof(int),
1756 .proc_handler = proc_dointvec,
1760 #ifdef CONFIG_FILE_LOCKING
1762 .procname = "lease-break-time",
1763 .data = &lease_break_time,
1764 .maxlen = sizeof(int),
1766 .proc_handler = proc_dointvec,
1771 .procname = "aio-nr",
1773 .maxlen = sizeof(aio_nr),
1775 .proc_handler = proc_doulongvec_minmax,
1778 .procname = "aio-max-nr",
1779 .data = &aio_max_nr,
1780 .maxlen = sizeof(aio_max_nr),
1782 .proc_handler = proc_doulongvec_minmax,
1784 #endif /* CONFIG_AIO */
1785 #ifdef CONFIG_INOTIFY_USER
1787 .procname = "inotify",
1789 .child = inotify_table,
1794 .procname = "epoll",
1796 .child = epoll_table,
1801 .procname = "protected_symlinks",
1802 .data = &sysctl_protected_symlinks,
1803 .maxlen = sizeof(int),
1805 .proc_handler = proc_dointvec_minmax,
1810 .procname = "protected_hardlinks",
1811 .data = &sysctl_protected_hardlinks,
1812 .maxlen = sizeof(int),
1814 .proc_handler = proc_dointvec_minmax,
1819 .procname = "suid_dumpable",
1820 .data = &suid_dumpable,
1821 .maxlen = sizeof(int),
1823 .proc_handler = proc_dointvec_minmax_coredump,
1827 #if defined(CONFIG_BINFMT_MISC) || defined(CONFIG_BINFMT_MISC_MODULE)
1829 .procname = "binfmt_misc",
1831 .child = sysctl_mount_point,
1835 .procname = "pipe-max-size",
1836 .data = &pipe_max_size,
1837 .maxlen = sizeof(int),
1839 .proc_handler = &pipe_proc_fn,
1840 .extra1 = &pipe_min_size,
1843 .procname = "pipe-user-pages-hard",
1844 .data = &pipe_user_pages_hard,
1845 .maxlen = sizeof(pipe_user_pages_hard),
1847 .proc_handler = proc_doulongvec_minmax,
1850 .procname = "pipe-user-pages-soft",
1851 .data = &pipe_user_pages_soft,
1852 .maxlen = sizeof(pipe_user_pages_soft),
1854 .proc_handler = proc_doulongvec_minmax,
1859 static struct ctl_table debug_table[] = {
1860 #ifdef CONFIG_SYSCTL_EXCEPTION_TRACE
1862 .procname = "exception-trace",
1863 .data = &show_unhandled_signals,
1864 .maxlen = sizeof(int),
1866 .proc_handler = proc_dointvec
1869 #if defined(CONFIG_OPTPROBES)
1871 .procname = "kprobes-optimization",
1872 .data = &sysctl_kprobes_optimization,
1873 .maxlen = sizeof(int),
1875 .proc_handler = proc_kprobes_optimization_handler,
1883 static struct ctl_table dev_table[] = {
1887 int __init sysctl_init(void)
1889 struct ctl_table_header *hdr;
1891 hdr = register_sysctl_table(sysctl_base_table);
1892 kmemleak_not_leak(hdr);
1896 #endif /* CONFIG_SYSCTL */
1902 #ifdef CONFIG_PROC_SYSCTL
1904 static int _proc_do_string(char *data, int maxlen, int write,
1905 char __user *buffer,
1906 size_t *lenp, loff_t *ppos)
1912 if (!data || !maxlen || !*lenp) {
1918 if (sysctl_writes_strict == SYSCTL_WRITES_STRICT) {
1919 /* Only continue writes not past the end of buffer. */
1921 if (len > maxlen - 1)
1928 /* Start writing from beginning of buffer. */
1934 while ((p - buffer) < *lenp && len < maxlen - 1) {
1935 if (get_user(c, p++))
1937 if (c == 0 || c == '\n')
1958 if (copy_to_user(buffer, data, len))
1961 if (put_user('\n', buffer + len))
1971 static void warn_sysctl_write(struct ctl_table *table)
1973 pr_warn_once("%s wrote to %s when file position was not 0!\n"
1974 "This will not be supported in the future. To silence this\n"
1975 "warning, set kernel.sysctl_writes_strict = -1\n",
1976 current->comm, table->procname);
1980 * proc_dostring - read a string sysctl
1981 * @table: the sysctl table
1982 * @write: %TRUE if this is a write to the sysctl file
1983 * @buffer: the user buffer
1984 * @lenp: the size of the user buffer
1985 * @ppos: file position
1987 * Reads/writes a string from/to the user buffer. If the kernel
1988 * buffer provided is not large enough to hold the string, the
1989 * string is truncated. The copied string is %NULL-terminated.
1990 * If the string is being read by the user process, it is copied
1991 * and a newline '\n' is added. It is truncated if the buffer is
1994 * Returns 0 on success.
1996 int proc_dostring(struct ctl_table *table, int write,
1997 void __user *buffer, size_t *lenp, loff_t *ppos)
1999 if (write && *ppos && sysctl_writes_strict == SYSCTL_WRITES_WARN)
2000 warn_sysctl_write(table);
2002 return _proc_do_string((char *)(table->data), table->maxlen, write,
2003 (char __user *)buffer, lenp, ppos);
2006 static size_t proc_skip_spaces(char **buf)
2009 char *tmp = skip_spaces(*buf);
2015 static void proc_skip_char(char **buf, size_t *size, const char v)
2025 #define TMPBUFLEN 22
2027 * proc_get_long - reads an ASCII formatted integer from a user buffer
2029 * @buf: a kernel buffer
2030 * @size: size of the kernel buffer
2031 * @val: this is where the number will be stored
2032 * @neg: set to %TRUE if number is negative
2033 * @perm_tr: a vector which contains the allowed trailers
2034 * @perm_tr_len: size of the perm_tr vector
2035 * @tr: pointer to store the trailer character
2037 * In case of success %0 is returned and @buf and @size are updated with
2038 * the amount of bytes read. If @tr is non-NULL and a trailing
2039 * character exists (size is non-zero after returning from this
2040 * function), @tr is updated with the trailing character.
2042 static int proc_get_long(char **buf, size_t *size,
2043 unsigned long *val, bool *neg,
2044 const char *perm_tr, unsigned perm_tr_len, char *tr)
2047 char *p, tmp[TMPBUFLEN];
2053 if (len > TMPBUFLEN - 1)
2054 len = TMPBUFLEN - 1;
2056 memcpy(tmp, *buf, len);
2060 if (*p == '-' && *size > 1) {
2068 *val = simple_strtoul(p, &p, 0);
2072 /* We don't know if the next char is whitespace thus we may accept
2073 * invalid integers (e.g. 1234...a) or two integers instead of one
2074 * (e.g. 123...1). So lets not allow such large numbers. */
2075 if (len == TMPBUFLEN - 1)
2078 if (len < *size && perm_tr_len && !memchr(perm_tr, *p, perm_tr_len))
2081 if (tr && (len < *size))
2091 * proc_put_long - converts an integer to a decimal ASCII formatted string
2093 * @buf: the user buffer
2094 * @size: the size of the user buffer
2095 * @val: the integer to be converted
2096 * @neg: sign of the number, %TRUE for negative
2098 * In case of success %0 is returned and @buf and @size are updated with
2099 * the amount of bytes written.
2101 static int proc_put_long(void __user **buf, size_t *size, unsigned long val,
2105 char tmp[TMPBUFLEN], *p = tmp;
2107 sprintf(p, "%s%lu", neg ? "-" : "", val);
2111 if (copy_to_user(*buf, tmp, len))
2119 static int proc_put_char(void __user **buf, size_t *size, char c)
2122 char __user **buffer = (char __user **)buf;
2123 if (put_user(c, *buffer))
2125 (*size)--, (*buffer)++;
2131 static int do_proc_dointvec_conv(bool *negp, unsigned long *lvalp,
2133 int write, void *data)
2137 if (*lvalp > (unsigned long) INT_MAX + 1)
2141 if (*lvalp > (unsigned long) INT_MAX)
2149 *lvalp = -(unsigned long)val;
2152 *lvalp = (unsigned long)val;
2158 static int do_proc_douintvec_conv(bool *negp, unsigned long *lvalp,
2160 int write, void *data)
2167 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 if ((min && val < *min) || (max && val > *max))
2525 val = convdiv * (*i) / convmul;
2527 err = proc_put_char(&buffer, &left, '\t');
2531 err = proc_put_long(&buffer, &left, val, false);
2537 if (!write && !first && left && !err)
2538 err = proc_put_char(&buffer, &left, '\n');
2540 left -= proc_skip_spaces(&kbuf);
2545 return err ? : -EINVAL;
2553 static int do_proc_doulongvec_minmax(struct ctl_table *table, int write,
2554 void __user *buffer,
2555 size_t *lenp, loff_t *ppos,
2556 unsigned long convmul,
2557 unsigned long convdiv)
2559 return __do_proc_doulongvec_minmax(table->data, table, write,
2560 buffer, lenp, ppos, convmul, convdiv);
2564 * proc_doulongvec_minmax - read a vector of long integers with min/max values
2565 * @table: the sysctl table
2566 * @write: %TRUE if this is a write to the sysctl file
2567 * @buffer: the user buffer
2568 * @lenp: the size of the user buffer
2569 * @ppos: file position
2571 * Reads/writes up to table->maxlen/sizeof(unsigned long) unsigned long
2572 * values from/to the user buffer, treated as an ASCII string.
2574 * This routine will ensure the values are within the range specified by
2575 * table->extra1 (min) and table->extra2 (max).
2577 * Returns 0 on success.
2579 int proc_doulongvec_minmax(struct ctl_table *table, int write,
2580 void __user *buffer, size_t *lenp, loff_t *ppos)
2582 return do_proc_doulongvec_minmax(table, write, buffer, lenp, ppos, 1l, 1l);
2586 * proc_doulongvec_ms_jiffies_minmax - read a vector of millisecond values with min/max values
2587 * @table: the sysctl table
2588 * @write: %TRUE if this is a write to the sysctl file
2589 * @buffer: the user buffer
2590 * @lenp: the size of the user buffer
2591 * @ppos: file position
2593 * Reads/writes up to table->maxlen/sizeof(unsigned long) unsigned long
2594 * values from/to the user buffer, treated as an ASCII string. The values
2595 * are treated as milliseconds, and converted to jiffies when they are stored.
2597 * This routine will ensure the values are within the range specified by
2598 * table->extra1 (min) and table->extra2 (max).
2600 * Returns 0 on success.
2602 int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int write,
2603 void __user *buffer,
2604 size_t *lenp, loff_t *ppos)
2606 return do_proc_doulongvec_minmax(table, write, buffer,
2607 lenp, ppos, HZ, 1000l);
2611 static int do_proc_dointvec_jiffies_conv(bool *negp, unsigned long *lvalp,
2613 int write, void *data)
2616 if (*lvalp > LONG_MAX / HZ)
2618 *valp = *negp ? -(*lvalp*HZ) : (*lvalp*HZ);
2624 lval = -(unsigned long)val;
2627 lval = (unsigned long)val;
2634 static int do_proc_dointvec_userhz_jiffies_conv(bool *negp, unsigned long *lvalp,
2636 int write, void *data)
2639 if (USER_HZ < HZ && *lvalp > (LONG_MAX / HZ) * USER_HZ)
2641 *valp = clock_t_to_jiffies(*negp ? -*lvalp : *lvalp);
2647 lval = -(unsigned long)val;
2650 lval = (unsigned long)val;
2652 *lvalp = jiffies_to_clock_t(lval);
2657 static int do_proc_dointvec_ms_jiffies_conv(bool *negp, unsigned long *lvalp,
2659 int write, void *data)
2662 unsigned long jif = msecs_to_jiffies(*negp ? -*lvalp : *lvalp);
2672 lval = -(unsigned long)val;
2675 lval = (unsigned long)val;
2677 *lvalp = jiffies_to_msecs(lval);
2683 * proc_dointvec_jiffies - read a vector of integers as seconds
2684 * @table: the sysctl table
2685 * @write: %TRUE if this is a write to the sysctl file
2686 * @buffer: the user buffer
2687 * @lenp: the size of the user buffer
2688 * @ppos: file position
2690 * Reads/writes up to table->maxlen/sizeof(unsigned int) integer
2691 * values from/to the user buffer, treated as an ASCII string.
2692 * The values read are assumed to be in seconds, and are converted into
2695 * Returns 0 on success.
2697 int proc_dointvec_jiffies(struct ctl_table *table, int write,
2698 void __user *buffer, size_t *lenp, loff_t *ppos)
2700 return do_proc_dointvec(table,write,buffer,lenp,ppos,
2701 do_proc_dointvec_jiffies_conv,NULL);
2705 * proc_dointvec_userhz_jiffies - read a vector of integers as 1/USER_HZ seconds
2706 * @table: the sysctl table
2707 * @write: %TRUE if this is a write to the sysctl file
2708 * @buffer: the user buffer
2709 * @lenp: the size of the user buffer
2710 * @ppos: pointer to the file position
2712 * Reads/writes up to table->maxlen/sizeof(unsigned int) integer
2713 * values from/to the user buffer, treated as an ASCII string.
2714 * The values read are assumed to be in 1/USER_HZ seconds, and
2715 * are converted into jiffies.
2717 * Returns 0 on success.
2719 int proc_dointvec_userhz_jiffies(struct ctl_table *table, int write,
2720 void __user *buffer, size_t *lenp, loff_t *ppos)
2722 return do_proc_dointvec(table,write,buffer,lenp,ppos,
2723 do_proc_dointvec_userhz_jiffies_conv,NULL);
2727 * proc_dointvec_ms_jiffies - read a vector of integers as 1 milliseconds
2728 * @table: the sysctl table
2729 * @write: %TRUE if this is a write to the sysctl file
2730 * @buffer: the user buffer
2731 * @lenp: the size of the user buffer
2732 * @ppos: file position
2733 * @ppos: the current position in the file
2735 * Reads/writes up to table->maxlen/sizeof(unsigned int) integer
2736 * values from/to the user buffer, treated as an ASCII string.
2737 * The values read are assumed to be in 1/1000 seconds, and
2738 * are converted into jiffies.
2740 * Returns 0 on success.
2742 int proc_dointvec_ms_jiffies(struct ctl_table *table, int write,
2743 void __user *buffer, size_t *lenp, loff_t *ppos)
2745 return do_proc_dointvec(table, write, buffer, lenp, ppos,
2746 do_proc_dointvec_ms_jiffies_conv, NULL);
2749 static int proc_do_cad_pid(struct ctl_table *table, int write,
2750 void __user *buffer, size_t *lenp, loff_t *ppos)
2752 struct pid *new_pid;
2756 tmp = pid_vnr(cad_pid);
2758 r = __do_proc_dointvec(&tmp, table, write, buffer,
2759 lenp, ppos, NULL, NULL);
2763 new_pid = find_get_pid(tmp);
2767 put_pid(xchg(&cad_pid, new_pid));
2772 * proc_do_large_bitmap - read/write from/to a large bitmap
2773 * @table: the sysctl table
2774 * @write: %TRUE if this is a write to the sysctl file
2775 * @buffer: the user buffer
2776 * @lenp: the size of the user buffer
2777 * @ppos: file position
2779 * The bitmap is stored at table->data and the bitmap length (in bits)
2782 * We use a range comma separated format (e.g. 1,3-4,10-10) so that
2783 * large bitmaps may be represented in a compact manner. Writing into
2784 * the file will clear the bitmap then update it with the given input.
2786 * Returns 0 on success.
2788 int proc_do_large_bitmap(struct ctl_table *table, int write,
2789 void __user *buffer, size_t *lenp, loff_t *ppos)
2793 size_t left = *lenp;
2794 unsigned long bitmap_len = table->maxlen;
2795 unsigned long *bitmap = *(unsigned long **) table->data;
2796 unsigned long *tmp_bitmap = NULL;
2797 char tr_a[] = { '-', ',', '\n' }, tr_b[] = { ',', '\n', 0 }, c;
2799 if (!bitmap || !bitmap_len || !left || (*ppos && !write)) {
2805 unsigned long page = 0;
2808 if (left > PAGE_SIZE - 1)
2809 left = PAGE_SIZE - 1;
2811 page = __get_free_page(GFP_TEMPORARY);
2812 kbuf = (char *) page;
2815 if (copy_from_user(kbuf, buffer, left)) {
2821 tmp_bitmap = kzalloc(BITS_TO_LONGS(bitmap_len) * sizeof(unsigned long),
2827 proc_skip_char(&kbuf, &left, '\n');
2828 while (!err && left) {
2829 unsigned long val_a, val_b;
2832 err = proc_get_long(&kbuf, &left, &val_a, &neg, tr_a,
2836 if (val_a >= bitmap_len || neg) {
2848 err = proc_get_long(&kbuf, &left, &val_b,
2849 &neg, tr_b, sizeof(tr_b),
2853 if (val_b >= bitmap_len || neg ||
2864 bitmap_set(tmp_bitmap, val_a, val_b - val_a + 1);
2866 proc_skip_char(&kbuf, &left, '\n');
2870 unsigned long bit_a, bit_b = 0;
2873 bit_a = find_next_bit(bitmap, bitmap_len, bit_b);
2874 if (bit_a >= bitmap_len)
2876 bit_b = find_next_zero_bit(bitmap, bitmap_len,
2880 err = proc_put_char(&buffer, &left, ',');
2884 err = proc_put_long(&buffer, &left, bit_a, false);
2887 if (bit_a != bit_b) {
2888 err = proc_put_char(&buffer, &left, '-');
2891 err = proc_put_long(&buffer, &left, bit_b, false);
2899 err = proc_put_char(&buffer, &left, '\n');
2905 bitmap_or(bitmap, bitmap, tmp_bitmap, bitmap_len);
2907 bitmap_copy(bitmap, tmp_bitmap, bitmap_len);
2919 #else /* CONFIG_PROC_SYSCTL */
2921 int proc_dostring(struct ctl_table *table, int write,
2922 void __user *buffer, size_t *lenp, loff_t *ppos)
2927 int proc_dointvec(struct ctl_table *table, int write,
2928 void __user *buffer, size_t *lenp, loff_t *ppos)
2933 int proc_douintvec(struct ctl_table *table, int write,
2934 void __user *buffer, size_t *lenp, loff_t *ppos)
2939 int proc_dointvec_minmax(struct ctl_table *table, int write,
2940 void __user *buffer, size_t *lenp, loff_t *ppos)
2945 int proc_dointvec_jiffies(struct ctl_table *table, int write,
2946 void __user *buffer, size_t *lenp, loff_t *ppos)
2951 int proc_dointvec_userhz_jiffies(struct ctl_table *table, int write,
2952 void __user *buffer, size_t *lenp, loff_t *ppos)
2957 int proc_dointvec_ms_jiffies(struct ctl_table *table, int write,
2958 void __user *buffer, size_t *lenp, loff_t *ppos)
2963 int proc_doulongvec_minmax(struct ctl_table *table, int write,
2964 void __user *buffer, size_t *lenp, loff_t *ppos)
2969 int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int write,
2970 void __user *buffer,
2971 size_t *lenp, loff_t *ppos)
2977 #endif /* CONFIG_PROC_SYSCTL */
2980 * No sense putting this after each symbol definition, twice,
2981 * exception granted :-)
2983 EXPORT_SYMBOL(proc_dointvec);
2984 EXPORT_SYMBOL(proc_douintvec);
2985 EXPORT_SYMBOL(proc_dointvec_jiffies);
2986 EXPORT_SYMBOL(proc_dointvec_minmax);
2987 EXPORT_SYMBOL(proc_dointvec_userhz_jiffies);
2988 EXPORT_SYMBOL(proc_dointvec_ms_jiffies);
2989 EXPORT_SYMBOL(proc_dostring);
2990 EXPORT_SYMBOL(proc_doulongvec_minmax);
2991 EXPORT_SYMBOL(proc_doulongvec_ms_jiffies_minmax);