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/sched/coredump.h>
67 #include <linux/kexec.h>
68 #include <linux/bpf.h>
69 #include <linux/mount.h>
71 #include <linux/uaccess.h>
72 #include <asm/processor.h>
76 #include <asm/stacktrace.h>
80 #include <asm/setup.h>
82 #ifdef CONFIG_BSD_PROCESS_ACCT
83 #include <linux/acct.h>
85 #ifdef CONFIG_RT_MUTEXES
86 #include <linux/rtmutex.h>
88 #if defined(CONFIG_PROVE_LOCKING) || defined(CONFIG_LOCK_STAT)
89 #include <linux/lockdep.h>
91 #ifdef CONFIG_CHR_DEV_SG
95 #ifdef CONFIG_LOCKUP_DETECTOR
96 #include <linux/nmi.h>
99 #if defined(CONFIG_SYSCTL)
101 /* External variables not in a header file. */
102 extern int suid_dumpable;
103 #ifdef CONFIG_COREDUMP
104 extern int core_uses_pid;
105 extern char core_pattern[];
106 extern unsigned int core_pipe_limit;
109 extern int pid_max_min, pid_max_max;
110 extern int percpu_pagelist_fraction;
111 extern int latencytop_enabled;
112 extern unsigned 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;
130 static int one_thousand = 1000;
132 static int ten_thousand = 10000;
134 #ifdef CONFIG_PERF_EVENTS
135 static int six_hundred_forty_kb = 640 * 1024;
138 /* this is needed for the proc_doulongvec_minmax of vm_dirty_bytes */
139 static unsigned long dirty_bytes_min = 2 * PAGE_SIZE;
141 /* this is needed for the proc_dointvec_minmax for [fs_]overflow UID and GID */
142 static int maxolduid = 65535;
143 static int minolduid;
145 static int ngroups_max = NGROUPS_MAX;
146 static const int cap_last_cap = CAP_LAST_CAP;
148 /*this is needed for proc_doulongvec_minmax of sysctl_hung_task_timeout_secs */
149 #ifdef CONFIG_DETECT_HUNG_TASK
150 static unsigned long hung_task_timeout_max = (LONG_MAX/HZ);
153 #ifdef CONFIG_INOTIFY_USER
154 #include <linux/inotify.h>
160 extern int pwrsw_enabled;
163 #ifdef CONFIG_SYSCTL_ARCH_UNALIGN_ALLOW
164 extern int unaligned_enabled;
168 extern int unaligned_dump_stack;
171 #ifdef CONFIG_SYSCTL_ARCH_UNALIGN_NO_WARN
172 extern int no_unaligned_warning;
175 #ifdef CONFIG_PROC_SYSCTL
178 * enum sysctl_writes_mode - supported sysctl write modes
180 * @SYSCTL_WRITES_LEGACY: each write syscall must fully contain the sysctl value
181 * to be written, and multiple writes on the same sysctl file descriptor
182 * will rewrite the sysctl value, regardless of file position. No warning
183 * is issued when the initial position is not 0.
184 * @SYSCTL_WRITES_WARN: same as above but warn when the initial file position is
186 * @SYSCTL_WRITES_STRICT: writes to numeric sysctl entries must always be at
187 * file position 0 and the value must be fully contained in the buffer
188 * sent to the write syscall. If dealing with strings respect the file
189 * position, but restrict this to the max length of the buffer, anything
190 * passed the max lenght will be ignored. Multiple writes will append
193 * These write modes control how current file position affects the behavior of
194 * updating sysctl values through the proc interface on each write.
196 enum sysctl_writes_mode {
197 SYSCTL_WRITES_LEGACY = -1,
198 SYSCTL_WRITES_WARN = 0,
199 SYSCTL_WRITES_STRICT = 1,
202 static enum sysctl_writes_mode sysctl_writes_strict = SYSCTL_WRITES_STRICT;
204 static int proc_do_cad_pid(struct ctl_table *table, int write,
205 void __user *buffer, size_t *lenp, loff_t *ppos);
206 static int proc_taint(struct ctl_table *table, int write,
207 void __user *buffer, size_t *lenp, loff_t *ppos);
211 static int proc_dointvec_minmax_sysadmin(struct ctl_table *table, int write,
212 void __user *buffer, size_t *lenp, loff_t *ppos);
215 static int proc_dointvec_minmax_coredump(struct ctl_table *table, int write,
216 void __user *buffer, size_t *lenp, loff_t *ppos);
217 #ifdef CONFIG_COREDUMP
218 static int proc_dostring_coredump(struct ctl_table *table, int write,
219 void __user *buffer, size_t *lenp, loff_t *ppos);
222 #ifdef CONFIG_MAGIC_SYSRQ
223 /* Note: sysrq code uses it's own private copy */
224 static int __sysrq_enabled = CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE;
226 static int sysrq_sysctl_handler(struct ctl_table *table, int write,
227 void __user *buffer, size_t *lenp,
232 error = proc_dointvec(table, write, buffer, lenp, ppos);
237 sysrq_toggle_support(__sysrq_enabled);
244 static struct ctl_table kern_table[];
245 static struct ctl_table vm_table[];
246 static struct ctl_table fs_table[];
247 static struct ctl_table debug_table[];
248 static struct ctl_table dev_table[];
249 extern struct ctl_table random_table[];
251 extern struct ctl_table epoll_table[];
254 #ifdef HAVE_ARCH_PICK_MMAP_LAYOUT
255 int sysctl_legacy_va_layout;
258 /* The default sysctl tables: */
260 static struct ctl_table sysctl_base_table[] = {
262 .procname = "kernel",
279 .child = debug_table,
289 #ifdef CONFIG_SCHED_DEBUG
290 static int min_sched_granularity_ns = 100000; /* 100 usecs */
291 static int max_sched_granularity_ns = NSEC_PER_SEC; /* 1 second */
292 static int min_wakeup_granularity_ns; /* 0 usecs */
293 static int max_wakeup_granularity_ns = NSEC_PER_SEC; /* 1 second */
295 static int min_sched_tunable_scaling = SCHED_TUNABLESCALING_NONE;
296 static int max_sched_tunable_scaling = SCHED_TUNABLESCALING_END-1;
297 #endif /* CONFIG_SMP */
298 #endif /* CONFIG_SCHED_DEBUG */
300 #ifdef CONFIG_COMPACTION
301 static int min_extfrag_threshold;
302 static int max_extfrag_threshold = 1000;
305 static struct ctl_table kern_table[] = {
307 .procname = "sched_child_runs_first",
308 .data = &sysctl_sched_child_runs_first,
309 .maxlen = sizeof(unsigned int),
311 .proc_handler = proc_dointvec,
313 #ifdef CONFIG_SCHED_DEBUG
315 .procname = "sched_min_granularity_ns",
316 .data = &sysctl_sched_min_granularity,
317 .maxlen = sizeof(unsigned int),
319 .proc_handler = sched_proc_update_handler,
320 .extra1 = &min_sched_granularity_ns,
321 .extra2 = &max_sched_granularity_ns,
324 .procname = "sched_latency_ns",
325 .data = &sysctl_sched_latency,
326 .maxlen = sizeof(unsigned int),
328 .proc_handler = sched_proc_update_handler,
329 .extra1 = &min_sched_granularity_ns,
330 .extra2 = &max_sched_granularity_ns,
333 .procname = "sched_wakeup_granularity_ns",
334 .data = &sysctl_sched_wakeup_granularity,
335 .maxlen = sizeof(unsigned int),
337 .proc_handler = sched_proc_update_handler,
338 .extra1 = &min_wakeup_granularity_ns,
339 .extra2 = &max_wakeup_granularity_ns,
343 .procname = "sched_tunable_scaling",
344 .data = &sysctl_sched_tunable_scaling,
345 .maxlen = sizeof(enum sched_tunable_scaling),
347 .proc_handler = sched_proc_update_handler,
348 .extra1 = &min_sched_tunable_scaling,
349 .extra2 = &max_sched_tunable_scaling,
352 .procname = "sched_migration_cost_ns",
353 .data = &sysctl_sched_migration_cost,
354 .maxlen = sizeof(unsigned int),
356 .proc_handler = proc_dointvec,
359 .procname = "sched_nr_migrate",
360 .data = &sysctl_sched_nr_migrate,
361 .maxlen = sizeof(unsigned int),
363 .proc_handler = proc_dointvec,
366 .procname = "sched_time_avg_ms",
367 .data = &sysctl_sched_time_avg,
368 .maxlen = sizeof(unsigned int),
370 .proc_handler = proc_dointvec,
372 #ifdef CONFIG_SCHEDSTATS
374 .procname = "sched_schedstats",
376 .maxlen = sizeof(unsigned int),
378 .proc_handler = sysctl_schedstats,
382 #endif /* CONFIG_SCHEDSTATS */
383 #endif /* CONFIG_SMP */
384 #ifdef CONFIG_NUMA_BALANCING
386 .procname = "numa_balancing_scan_delay_ms",
387 .data = &sysctl_numa_balancing_scan_delay,
388 .maxlen = sizeof(unsigned int),
390 .proc_handler = proc_dointvec,
393 .procname = "numa_balancing_scan_period_min_ms",
394 .data = &sysctl_numa_balancing_scan_period_min,
395 .maxlen = sizeof(unsigned int),
397 .proc_handler = proc_dointvec,
400 .procname = "numa_balancing_scan_period_max_ms",
401 .data = &sysctl_numa_balancing_scan_period_max,
402 .maxlen = sizeof(unsigned int),
404 .proc_handler = proc_dointvec,
407 .procname = "numa_balancing_scan_size_mb",
408 .data = &sysctl_numa_balancing_scan_size,
409 .maxlen = sizeof(unsigned int),
411 .proc_handler = proc_dointvec_minmax,
415 .procname = "numa_balancing",
416 .data = NULL, /* filled in by handler */
417 .maxlen = sizeof(unsigned int),
419 .proc_handler = sysctl_numa_balancing,
423 #endif /* CONFIG_NUMA_BALANCING */
424 #endif /* CONFIG_SCHED_DEBUG */
426 .procname = "sched_rt_period_us",
427 .data = &sysctl_sched_rt_period,
428 .maxlen = sizeof(unsigned int),
430 .proc_handler = sched_rt_handler,
433 .procname = "sched_rt_runtime_us",
434 .data = &sysctl_sched_rt_runtime,
435 .maxlen = sizeof(int),
437 .proc_handler = sched_rt_handler,
440 .procname = "sched_rr_timeslice_ms",
441 .data = &sysctl_sched_rr_timeslice,
442 .maxlen = sizeof(int),
444 .proc_handler = sched_rr_handler,
446 #ifdef CONFIG_SCHED_AUTOGROUP
448 .procname = "sched_autogroup_enabled",
449 .data = &sysctl_sched_autogroup_enabled,
450 .maxlen = sizeof(unsigned int),
452 .proc_handler = proc_dointvec_minmax,
457 #ifdef CONFIG_CFS_BANDWIDTH
459 .procname = "sched_cfs_bandwidth_slice_us",
460 .data = &sysctl_sched_cfs_bandwidth_slice,
461 .maxlen = sizeof(unsigned int),
463 .proc_handler = proc_dointvec_minmax,
467 #ifdef CONFIG_PROVE_LOCKING
469 .procname = "prove_locking",
470 .data = &prove_locking,
471 .maxlen = sizeof(int),
473 .proc_handler = proc_dointvec,
476 #ifdef CONFIG_LOCK_STAT
478 .procname = "lock_stat",
480 .maxlen = sizeof(int),
482 .proc_handler = proc_dointvec,
487 .data = &panic_timeout,
488 .maxlen = sizeof(int),
490 .proc_handler = proc_dointvec,
492 #ifdef CONFIG_COREDUMP
494 .procname = "core_uses_pid",
495 .data = &core_uses_pid,
496 .maxlen = sizeof(int),
498 .proc_handler = proc_dointvec,
501 .procname = "core_pattern",
502 .data = core_pattern,
503 .maxlen = CORENAME_MAX_SIZE,
505 .proc_handler = proc_dostring_coredump,
508 .procname = "core_pipe_limit",
509 .data = &core_pipe_limit,
510 .maxlen = sizeof(unsigned int),
512 .proc_handler = proc_dointvec,
515 #ifdef CONFIG_PROC_SYSCTL
517 .procname = "tainted",
518 .maxlen = sizeof(long),
520 .proc_handler = proc_taint,
523 .procname = "sysctl_writes_strict",
524 .data = &sysctl_writes_strict,
525 .maxlen = sizeof(int),
527 .proc_handler = proc_dointvec_minmax,
532 #ifdef CONFIG_LATENCYTOP
534 .procname = "latencytop",
535 .data = &latencytop_enabled,
536 .maxlen = sizeof(int),
538 .proc_handler = sysctl_latencytop,
541 #ifdef CONFIG_BLK_DEV_INITRD
543 .procname = "real-root-dev",
544 .data = &real_root_dev,
545 .maxlen = sizeof(int),
547 .proc_handler = proc_dointvec,
551 .procname = "print-fatal-signals",
552 .data = &print_fatal_signals,
553 .maxlen = sizeof(int),
555 .proc_handler = proc_dointvec,
559 .procname = "reboot-cmd",
560 .data = reboot_command,
563 .proc_handler = proc_dostring,
566 .procname = "stop-a",
567 .data = &stop_a_enabled,
568 .maxlen = sizeof (int),
570 .proc_handler = proc_dointvec,
573 .procname = "scons-poweroff",
574 .data = &scons_pwroff,
575 .maxlen = sizeof (int),
577 .proc_handler = proc_dointvec,
580 #ifdef CONFIG_SPARC64
582 .procname = "tsb-ratio",
583 .data = &sysctl_tsb_ratio,
584 .maxlen = sizeof (int),
586 .proc_handler = proc_dointvec,
591 .procname = "soft-power",
592 .data = &pwrsw_enabled,
593 .maxlen = sizeof (int),
595 .proc_handler = proc_dointvec,
598 #ifdef CONFIG_SYSCTL_ARCH_UNALIGN_ALLOW
600 .procname = "unaligned-trap",
601 .data = &unaligned_enabled,
602 .maxlen = sizeof (int),
604 .proc_handler = proc_dointvec,
608 .procname = "ctrl-alt-del",
610 .maxlen = sizeof(int),
612 .proc_handler = proc_dointvec,
614 #ifdef CONFIG_FUNCTION_TRACER
616 .procname = "ftrace_enabled",
617 .data = &ftrace_enabled,
618 .maxlen = sizeof(int),
620 .proc_handler = ftrace_enable_sysctl,
623 #ifdef CONFIG_STACK_TRACER
625 .procname = "stack_tracer_enabled",
626 .data = &stack_tracer_enabled,
627 .maxlen = sizeof(int),
629 .proc_handler = stack_trace_sysctl,
632 #ifdef CONFIG_TRACING
634 .procname = "ftrace_dump_on_oops",
635 .data = &ftrace_dump_on_oops,
636 .maxlen = sizeof(int),
638 .proc_handler = proc_dointvec,
641 .procname = "traceoff_on_warning",
642 .data = &__disable_trace_on_warning,
643 .maxlen = sizeof(__disable_trace_on_warning),
645 .proc_handler = proc_dointvec,
648 .procname = "tracepoint_printk",
649 .data = &tracepoint_printk,
650 .maxlen = sizeof(tracepoint_printk),
652 .proc_handler = tracepoint_printk_sysctl,
655 #ifdef CONFIG_KEXEC_CORE
657 .procname = "kexec_load_disabled",
658 .data = &kexec_load_disabled,
659 .maxlen = sizeof(int),
661 /* only handle a transition from default "0" to "1" */
662 .proc_handler = proc_dointvec_minmax,
667 #ifdef CONFIG_MODULES
669 .procname = "modprobe",
670 .data = &modprobe_path,
671 .maxlen = KMOD_PATH_LEN,
673 .proc_handler = proc_dostring,
676 .procname = "modules_disabled",
677 .data = &modules_disabled,
678 .maxlen = sizeof(int),
680 /* only handle a transition from default "0" to "1" */
681 .proc_handler = proc_dointvec_minmax,
686 #ifdef CONFIG_UEVENT_HELPER
688 .procname = "hotplug",
689 .data = &uevent_helper,
690 .maxlen = UEVENT_HELPER_PATH_LEN,
692 .proc_handler = proc_dostring,
695 #ifdef CONFIG_CHR_DEV_SG
697 .procname = "sg-big-buff",
698 .data = &sg_big_buff,
699 .maxlen = sizeof (int),
701 .proc_handler = proc_dointvec,
704 #ifdef CONFIG_BSD_PROCESS_ACCT
708 .maxlen = 3*sizeof(int),
710 .proc_handler = proc_dointvec,
713 #ifdef CONFIG_MAGIC_SYSRQ
716 .data = &__sysrq_enabled,
717 .maxlen = sizeof (int),
719 .proc_handler = sysrq_sysctl_handler,
722 #ifdef CONFIG_PROC_SYSCTL
724 .procname = "cad_pid",
726 .maxlen = sizeof (int),
728 .proc_handler = proc_do_cad_pid,
732 .procname = "threads-max",
734 .maxlen = sizeof(int),
736 .proc_handler = sysctl_max_threads,
739 .procname = "random",
741 .child = random_table,
744 .procname = "usermodehelper",
746 .child = usermodehelper_table,
749 .procname = "overflowuid",
750 .data = &overflowuid,
751 .maxlen = sizeof(int),
753 .proc_handler = proc_dointvec_minmax,
754 .extra1 = &minolduid,
755 .extra2 = &maxolduid,
758 .procname = "overflowgid",
759 .data = &overflowgid,
760 .maxlen = sizeof(int),
762 .proc_handler = proc_dointvec_minmax,
763 .extra1 = &minolduid,
764 .extra2 = &maxolduid,
767 #ifdef CONFIG_MATHEMU
769 .procname = "ieee_emulation_warnings",
770 .data = &sysctl_ieee_emulation_warnings,
771 .maxlen = sizeof(int),
773 .proc_handler = proc_dointvec,
777 .procname = "userprocess_debug",
778 .data = &show_unhandled_signals,
779 .maxlen = sizeof(int),
781 .proc_handler = proc_dointvec,
785 .procname = "pid_max",
787 .maxlen = sizeof (int),
789 .proc_handler = proc_dointvec_minmax,
790 .extra1 = &pid_max_min,
791 .extra2 = &pid_max_max,
794 .procname = "panic_on_oops",
795 .data = &panic_on_oops,
796 .maxlen = sizeof(int),
798 .proc_handler = proc_dointvec,
800 #if defined CONFIG_PRINTK
802 .procname = "printk",
803 .data = &console_loglevel,
804 .maxlen = 4*sizeof(int),
806 .proc_handler = proc_dointvec,
809 .procname = "printk_ratelimit",
810 .data = &printk_ratelimit_state.interval,
811 .maxlen = sizeof(int),
813 .proc_handler = proc_dointvec_jiffies,
816 .procname = "printk_ratelimit_burst",
817 .data = &printk_ratelimit_state.burst,
818 .maxlen = sizeof(int),
820 .proc_handler = proc_dointvec,
823 .procname = "printk_delay",
824 .data = &printk_delay_msec,
825 .maxlen = sizeof(int),
827 .proc_handler = proc_dointvec_minmax,
829 .extra2 = &ten_thousand,
832 .procname = "printk_devkmsg",
833 .data = devkmsg_log_str,
834 .maxlen = DEVKMSG_STR_MAX_SIZE,
836 .proc_handler = devkmsg_sysctl_set_loglvl,
839 .procname = "dmesg_restrict",
840 .data = &dmesg_restrict,
841 .maxlen = sizeof(int),
843 .proc_handler = proc_dointvec_minmax_sysadmin,
848 .procname = "kptr_restrict",
849 .data = &kptr_restrict,
850 .maxlen = sizeof(int),
852 .proc_handler = proc_dointvec_minmax_sysadmin,
858 .procname = "ngroups_max",
859 .data = &ngroups_max,
860 .maxlen = sizeof (int),
862 .proc_handler = proc_dointvec,
865 .procname = "cap_last_cap",
866 .data = (void *)&cap_last_cap,
867 .maxlen = sizeof(int),
869 .proc_handler = proc_dointvec,
871 #if defined(CONFIG_LOCKUP_DETECTOR)
873 .procname = "watchdog",
874 .data = &watchdog_user_enabled,
875 .maxlen = sizeof (int),
877 .proc_handler = proc_watchdog,
882 .procname = "watchdog_thresh",
883 .data = &watchdog_thresh,
884 .maxlen = sizeof(int),
886 .proc_handler = proc_watchdog_thresh,
891 .procname = "nmi_watchdog",
892 .data = &nmi_watchdog_enabled,
893 .maxlen = sizeof (int),
895 .proc_handler = proc_nmi_watchdog,
897 #if defined(CONFIG_HAVE_NMI_WATCHDOG) || defined(CONFIG_HARDLOCKUP_DETECTOR)
904 .procname = "soft_watchdog",
905 .data = &soft_watchdog_enabled,
906 .maxlen = sizeof (int),
908 .proc_handler = proc_soft_watchdog,
913 .procname = "watchdog_cpumask",
914 .data = &watchdog_cpumask_bits,
917 .proc_handler = proc_watchdog_cpumask,
920 .procname = "softlockup_panic",
921 .data = &softlockup_panic,
922 .maxlen = sizeof(int),
924 .proc_handler = proc_dointvec_minmax,
928 #ifdef CONFIG_HARDLOCKUP_DETECTOR
930 .procname = "hardlockup_panic",
931 .data = &hardlockup_panic,
932 .maxlen = sizeof(int),
934 .proc_handler = proc_dointvec_minmax,
941 .procname = "softlockup_all_cpu_backtrace",
942 .data = &sysctl_softlockup_all_cpu_backtrace,
943 .maxlen = sizeof(int),
945 .proc_handler = proc_dointvec_minmax,
950 .procname = "hardlockup_all_cpu_backtrace",
951 .data = &sysctl_hardlockup_all_cpu_backtrace,
952 .maxlen = sizeof(int),
954 .proc_handler = proc_dointvec_minmax,
958 #endif /* CONFIG_SMP */
960 #if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86)
962 .procname = "unknown_nmi_panic",
963 .data = &unknown_nmi_panic,
964 .maxlen = sizeof (int),
966 .proc_handler = proc_dointvec,
969 #if defined(CONFIG_X86)
971 .procname = "panic_on_unrecovered_nmi",
972 .data = &panic_on_unrecovered_nmi,
973 .maxlen = sizeof(int),
975 .proc_handler = proc_dointvec,
978 .procname = "panic_on_io_nmi",
979 .data = &panic_on_io_nmi,
980 .maxlen = sizeof(int),
982 .proc_handler = proc_dointvec,
984 #ifdef CONFIG_DEBUG_STACKOVERFLOW
986 .procname = "panic_on_stackoverflow",
987 .data = &sysctl_panic_on_stackoverflow,
988 .maxlen = sizeof(int),
990 .proc_handler = proc_dointvec,
994 .procname = "bootloader_type",
995 .data = &bootloader_type,
996 .maxlen = sizeof (int),
998 .proc_handler = proc_dointvec,
1001 .procname = "bootloader_version",
1002 .data = &bootloader_version,
1003 .maxlen = sizeof (int),
1005 .proc_handler = proc_dointvec,
1008 .procname = "io_delay_type",
1009 .data = &io_delay_type,
1010 .maxlen = sizeof(int),
1012 .proc_handler = proc_dointvec,
1015 #if defined(CONFIG_MMU)
1017 .procname = "randomize_va_space",
1018 .data = &randomize_va_space,
1019 .maxlen = sizeof(int),
1021 .proc_handler = proc_dointvec,
1024 #if defined(CONFIG_S390) && defined(CONFIG_SMP)
1026 .procname = "spin_retry",
1027 .data = &spin_retry,
1028 .maxlen = sizeof (int),
1030 .proc_handler = proc_dointvec,
1033 #if defined(CONFIG_ACPI_SLEEP) && defined(CONFIG_X86)
1035 .procname = "acpi_video_flags",
1036 .data = &acpi_realmode_flags,
1037 .maxlen = sizeof (unsigned long),
1039 .proc_handler = proc_doulongvec_minmax,
1042 #ifdef CONFIG_SYSCTL_ARCH_UNALIGN_NO_WARN
1044 .procname = "ignore-unaligned-usertrap",
1045 .data = &no_unaligned_warning,
1046 .maxlen = sizeof (int),
1048 .proc_handler = proc_dointvec,
1053 .procname = "unaligned-dump-stack",
1054 .data = &unaligned_dump_stack,
1055 .maxlen = sizeof (int),
1057 .proc_handler = proc_dointvec,
1060 #ifdef CONFIG_DETECT_HUNG_TASK
1062 .procname = "hung_task_panic",
1063 .data = &sysctl_hung_task_panic,
1064 .maxlen = sizeof(int),
1066 .proc_handler = proc_dointvec_minmax,
1071 .procname = "hung_task_check_count",
1072 .data = &sysctl_hung_task_check_count,
1073 .maxlen = sizeof(int),
1075 .proc_handler = proc_dointvec_minmax,
1079 .procname = "hung_task_timeout_secs",
1080 .data = &sysctl_hung_task_timeout_secs,
1081 .maxlen = sizeof(unsigned long),
1083 .proc_handler = proc_dohung_task_timeout_secs,
1084 .extra2 = &hung_task_timeout_max,
1087 .procname = "hung_task_warnings",
1088 .data = &sysctl_hung_task_warnings,
1089 .maxlen = sizeof(int),
1091 .proc_handler = proc_dointvec_minmax,
1095 #ifdef CONFIG_RT_MUTEXES
1097 .procname = "max_lock_depth",
1098 .data = &max_lock_depth,
1099 .maxlen = sizeof(int),
1101 .proc_handler = proc_dointvec,
1105 .procname = "poweroff_cmd",
1106 .data = &poweroff_cmd,
1107 .maxlen = POWEROFF_CMD_PATH_LEN,
1109 .proc_handler = proc_dostring,
1115 .child = key_sysctls,
1118 #ifdef CONFIG_PERF_EVENTS
1120 * User-space scripts rely on the existence of this file
1121 * as a feature check for perf_events being enabled.
1123 * So it's an ABI, do not remove!
1126 .procname = "perf_event_paranoid",
1127 .data = &sysctl_perf_event_paranoid,
1128 .maxlen = sizeof(sysctl_perf_event_paranoid),
1130 .proc_handler = proc_dointvec,
1133 .procname = "perf_event_mlock_kb",
1134 .data = &sysctl_perf_event_mlock,
1135 .maxlen = sizeof(sysctl_perf_event_mlock),
1137 .proc_handler = proc_dointvec,
1140 .procname = "perf_event_max_sample_rate",
1141 .data = &sysctl_perf_event_sample_rate,
1142 .maxlen = sizeof(sysctl_perf_event_sample_rate),
1144 .proc_handler = perf_proc_update_handler,
1148 .procname = "perf_cpu_time_max_percent",
1149 .data = &sysctl_perf_cpu_time_max_percent,
1150 .maxlen = sizeof(sysctl_perf_cpu_time_max_percent),
1152 .proc_handler = perf_cpu_time_max_percent_handler,
1154 .extra2 = &one_hundred,
1157 .procname = "perf_event_max_stack",
1158 .data = &sysctl_perf_event_max_stack,
1159 .maxlen = sizeof(sysctl_perf_event_max_stack),
1161 .proc_handler = perf_event_max_stack_handler,
1163 .extra2 = &six_hundred_forty_kb,
1166 .procname = "perf_event_max_contexts_per_stack",
1167 .data = &sysctl_perf_event_max_contexts_per_stack,
1168 .maxlen = sizeof(sysctl_perf_event_max_contexts_per_stack),
1170 .proc_handler = perf_event_max_stack_handler,
1172 .extra2 = &one_thousand,
1175 #ifdef CONFIG_KMEMCHECK
1177 .procname = "kmemcheck",
1178 .data = &kmemcheck_enabled,
1179 .maxlen = sizeof(int),
1181 .proc_handler = proc_dointvec,
1185 .procname = "panic_on_warn",
1186 .data = &panic_on_warn,
1187 .maxlen = sizeof(int),
1189 .proc_handler = proc_dointvec_minmax,
1193 #if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ_COMMON)
1195 .procname = "timer_migration",
1196 .data = &sysctl_timer_migration,
1197 .maxlen = sizeof(unsigned int),
1199 .proc_handler = timer_migration_handler,
1204 #ifdef CONFIG_BPF_SYSCALL
1206 .procname = "unprivileged_bpf_disabled",
1207 .data = &sysctl_unprivileged_bpf_disabled,
1208 .maxlen = sizeof(sysctl_unprivileged_bpf_disabled),
1210 /* only handle a transition from default "0" to "1" */
1211 .proc_handler = proc_dointvec_minmax,
1216 #if defined(CONFIG_TREE_RCU) || defined(CONFIG_PREEMPT_RCU)
1218 .procname = "panic_on_rcu_stall",
1219 .data = &sysctl_panic_on_rcu_stall,
1220 .maxlen = sizeof(sysctl_panic_on_rcu_stall),
1222 .proc_handler = proc_dointvec_minmax,
1230 static struct ctl_table vm_table[] = {
1232 .procname = "overcommit_memory",
1233 .data = &sysctl_overcommit_memory,
1234 .maxlen = sizeof(sysctl_overcommit_memory),
1236 .proc_handler = proc_dointvec_minmax,
1241 .procname = "panic_on_oom",
1242 .data = &sysctl_panic_on_oom,
1243 .maxlen = sizeof(sysctl_panic_on_oom),
1245 .proc_handler = proc_dointvec_minmax,
1250 .procname = "oom_kill_allocating_task",
1251 .data = &sysctl_oom_kill_allocating_task,
1252 .maxlen = sizeof(sysctl_oom_kill_allocating_task),
1254 .proc_handler = proc_dointvec,
1257 .procname = "oom_dump_tasks",
1258 .data = &sysctl_oom_dump_tasks,
1259 .maxlen = sizeof(sysctl_oom_dump_tasks),
1261 .proc_handler = proc_dointvec,
1264 .procname = "overcommit_ratio",
1265 .data = &sysctl_overcommit_ratio,
1266 .maxlen = sizeof(sysctl_overcommit_ratio),
1268 .proc_handler = overcommit_ratio_handler,
1271 .procname = "overcommit_kbytes",
1272 .data = &sysctl_overcommit_kbytes,
1273 .maxlen = sizeof(sysctl_overcommit_kbytes),
1275 .proc_handler = overcommit_kbytes_handler,
1278 .procname = "page-cluster",
1279 .data = &page_cluster,
1280 .maxlen = sizeof(int),
1282 .proc_handler = proc_dointvec_minmax,
1286 .procname = "dirty_background_ratio",
1287 .data = &dirty_background_ratio,
1288 .maxlen = sizeof(dirty_background_ratio),
1290 .proc_handler = dirty_background_ratio_handler,
1292 .extra2 = &one_hundred,
1295 .procname = "dirty_background_bytes",
1296 .data = &dirty_background_bytes,
1297 .maxlen = sizeof(dirty_background_bytes),
1299 .proc_handler = dirty_background_bytes_handler,
1303 .procname = "dirty_ratio",
1304 .data = &vm_dirty_ratio,
1305 .maxlen = sizeof(vm_dirty_ratio),
1307 .proc_handler = dirty_ratio_handler,
1309 .extra2 = &one_hundred,
1312 .procname = "dirty_bytes",
1313 .data = &vm_dirty_bytes,
1314 .maxlen = sizeof(vm_dirty_bytes),
1316 .proc_handler = dirty_bytes_handler,
1317 .extra1 = &dirty_bytes_min,
1320 .procname = "dirty_writeback_centisecs",
1321 .data = &dirty_writeback_interval,
1322 .maxlen = sizeof(dirty_writeback_interval),
1324 .proc_handler = dirty_writeback_centisecs_handler,
1327 .procname = "dirty_expire_centisecs",
1328 .data = &dirty_expire_interval,
1329 .maxlen = sizeof(dirty_expire_interval),
1331 .proc_handler = proc_dointvec_minmax,
1335 .procname = "dirtytime_expire_seconds",
1336 .data = &dirtytime_expire_interval,
1337 .maxlen = sizeof(dirty_expire_interval),
1339 .proc_handler = dirtytime_interval_handler,
1343 .procname = "nr_pdflush_threads",
1344 .mode = 0444 /* read-only */,
1345 .proc_handler = pdflush_proc_obsolete,
1348 .procname = "swappiness",
1349 .data = &vm_swappiness,
1350 .maxlen = sizeof(vm_swappiness),
1352 .proc_handler = proc_dointvec_minmax,
1354 .extra2 = &one_hundred,
1356 #ifdef CONFIG_HUGETLB_PAGE
1358 .procname = "nr_hugepages",
1360 .maxlen = sizeof(unsigned long),
1362 .proc_handler = hugetlb_sysctl_handler,
1366 .procname = "nr_hugepages_mempolicy",
1368 .maxlen = sizeof(unsigned long),
1370 .proc_handler = &hugetlb_mempolicy_sysctl_handler,
1374 .procname = "hugetlb_shm_group",
1375 .data = &sysctl_hugetlb_shm_group,
1376 .maxlen = sizeof(gid_t),
1378 .proc_handler = proc_dointvec,
1381 .procname = "hugepages_treat_as_movable",
1382 .data = &hugepages_treat_as_movable,
1383 .maxlen = sizeof(int),
1385 .proc_handler = proc_dointvec,
1388 .procname = "nr_overcommit_hugepages",
1390 .maxlen = sizeof(unsigned long),
1392 .proc_handler = hugetlb_overcommit_handler,
1396 .procname = "lowmem_reserve_ratio",
1397 .data = &sysctl_lowmem_reserve_ratio,
1398 .maxlen = sizeof(sysctl_lowmem_reserve_ratio),
1400 .proc_handler = lowmem_reserve_ratio_sysctl_handler,
1403 .procname = "drop_caches",
1404 .data = &sysctl_drop_caches,
1405 .maxlen = sizeof(int),
1407 .proc_handler = drop_caches_sysctl_handler,
1411 #ifdef CONFIG_COMPACTION
1413 .procname = "compact_memory",
1414 .data = &sysctl_compact_memory,
1415 .maxlen = sizeof(int),
1417 .proc_handler = sysctl_compaction_handler,
1420 .procname = "extfrag_threshold",
1421 .data = &sysctl_extfrag_threshold,
1422 .maxlen = sizeof(int),
1424 .proc_handler = sysctl_extfrag_handler,
1425 .extra1 = &min_extfrag_threshold,
1426 .extra2 = &max_extfrag_threshold,
1429 .procname = "compact_unevictable_allowed",
1430 .data = &sysctl_compact_unevictable_allowed,
1431 .maxlen = sizeof(int),
1433 .proc_handler = proc_dointvec,
1438 #endif /* CONFIG_COMPACTION */
1440 .procname = "min_free_kbytes",
1441 .data = &min_free_kbytes,
1442 .maxlen = sizeof(min_free_kbytes),
1444 .proc_handler = min_free_kbytes_sysctl_handler,
1448 .procname = "watermark_scale_factor",
1449 .data = &watermark_scale_factor,
1450 .maxlen = sizeof(watermark_scale_factor),
1452 .proc_handler = watermark_scale_factor_sysctl_handler,
1454 .extra2 = &one_thousand,
1457 .procname = "percpu_pagelist_fraction",
1458 .data = &percpu_pagelist_fraction,
1459 .maxlen = sizeof(percpu_pagelist_fraction),
1461 .proc_handler = percpu_pagelist_fraction_sysctl_handler,
1466 .procname = "max_map_count",
1467 .data = &sysctl_max_map_count,
1468 .maxlen = sizeof(sysctl_max_map_count),
1470 .proc_handler = proc_dointvec_minmax,
1475 .procname = "nr_trim_pages",
1476 .data = &sysctl_nr_trim_pages,
1477 .maxlen = sizeof(sysctl_nr_trim_pages),
1479 .proc_handler = proc_dointvec_minmax,
1484 .procname = "laptop_mode",
1485 .data = &laptop_mode,
1486 .maxlen = sizeof(laptop_mode),
1488 .proc_handler = proc_dointvec_jiffies,
1491 .procname = "block_dump",
1492 .data = &block_dump,
1493 .maxlen = sizeof(block_dump),
1495 .proc_handler = proc_dointvec,
1499 .procname = "vfs_cache_pressure",
1500 .data = &sysctl_vfs_cache_pressure,
1501 .maxlen = sizeof(sysctl_vfs_cache_pressure),
1503 .proc_handler = proc_dointvec,
1506 #ifdef HAVE_ARCH_PICK_MMAP_LAYOUT
1508 .procname = "legacy_va_layout",
1509 .data = &sysctl_legacy_va_layout,
1510 .maxlen = sizeof(sysctl_legacy_va_layout),
1512 .proc_handler = proc_dointvec,
1518 .procname = "zone_reclaim_mode",
1519 .data = &node_reclaim_mode,
1520 .maxlen = sizeof(node_reclaim_mode),
1522 .proc_handler = proc_dointvec,
1526 .procname = "min_unmapped_ratio",
1527 .data = &sysctl_min_unmapped_ratio,
1528 .maxlen = sizeof(sysctl_min_unmapped_ratio),
1530 .proc_handler = sysctl_min_unmapped_ratio_sysctl_handler,
1532 .extra2 = &one_hundred,
1535 .procname = "min_slab_ratio",
1536 .data = &sysctl_min_slab_ratio,
1537 .maxlen = sizeof(sysctl_min_slab_ratio),
1539 .proc_handler = sysctl_min_slab_ratio_sysctl_handler,
1541 .extra2 = &one_hundred,
1546 .procname = "stat_interval",
1547 .data = &sysctl_stat_interval,
1548 .maxlen = sizeof(sysctl_stat_interval),
1550 .proc_handler = proc_dointvec_jiffies,
1553 .procname = "stat_refresh",
1557 .proc_handler = vmstat_refresh,
1562 .procname = "mmap_min_addr",
1563 .data = &dac_mmap_min_addr,
1564 .maxlen = sizeof(unsigned long),
1566 .proc_handler = mmap_min_addr_handler,
1571 .procname = "numa_zonelist_order",
1572 .data = &numa_zonelist_order,
1573 .maxlen = NUMA_ZONELIST_ORDER_LEN,
1575 .proc_handler = numa_zonelist_order_handler,
1578 #if (defined(CONFIG_X86_32) && !defined(CONFIG_UML))|| \
1579 (defined(CONFIG_SUPERH) && defined(CONFIG_VSYSCALL))
1581 .procname = "vdso_enabled",
1582 #ifdef CONFIG_X86_32
1583 .data = &vdso32_enabled,
1584 .maxlen = sizeof(vdso32_enabled),
1586 .data = &vdso_enabled,
1587 .maxlen = sizeof(vdso_enabled),
1590 .proc_handler = proc_dointvec,
1594 #ifdef CONFIG_HIGHMEM
1596 .procname = "highmem_is_dirtyable",
1597 .data = &vm_highmem_is_dirtyable,
1598 .maxlen = sizeof(vm_highmem_is_dirtyable),
1600 .proc_handler = proc_dointvec_minmax,
1605 #ifdef CONFIG_MEMORY_FAILURE
1607 .procname = "memory_failure_early_kill",
1608 .data = &sysctl_memory_failure_early_kill,
1609 .maxlen = sizeof(sysctl_memory_failure_early_kill),
1611 .proc_handler = proc_dointvec_minmax,
1616 .procname = "memory_failure_recovery",
1617 .data = &sysctl_memory_failure_recovery,
1618 .maxlen = sizeof(sysctl_memory_failure_recovery),
1620 .proc_handler = proc_dointvec_minmax,
1626 .procname = "user_reserve_kbytes",
1627 .data = &sysctl_user_reserve_kbytes,
1628 .maxlen = sizeof(sysctl_user_reserve_kbytes),
1630 .proc_handler = proc_doulongvec_minmax,
1633 .procname = "admin_reserve_kbytes",
1634 .data = &sysctl_admin_reserve_kbytes,
1635 .maxlen = sizeof(sysctl_admin_reserve_kbytes),
1637 .proc_handler = proc_doulongvec_minmax,
1639 #ifdef CONFIG_HAVE_ARCH_MMAP_RND_BITS
1641 .procname = "mmap_rnd_bits",
1642 .data = &mmap_rnd_bits,
1643 .maxlen = sizeof(mmap_rnd_bits),
1645 .proc_handler = proc_dointvec_minmax,
1646 .extra1 = (void *)&mmap_rnd_bits_min,
1647 .extra2 = (void *)&mmap_rnd_bits_max,
1650 #ifdef CONFIG_HAVE_ARCH_MMAP_RND_COMPAT_BITS
1652 .procname = "mmap_rnd_compat_bits",
1653 .data = &mmap_rnd_compat_bits,
1654 .maxlen = sizeof(mmap_rnd_compat_bits),
1656 .proc_handler = proc_dointvec_minmax,
1657 .extra1 = (void *)&mmap_rnd_compat_bits_min,
1658 .extra2 = (void *)&mmap_rnd_compat_bits_max,
1664 static struct ctl_table fs_table[] = {
1666 .procname = "inode-nr",
1667 .data = &inodes_stat,
1668 .maxlen = 2*sizeof(long),
1670 .proc_handler = proc_nr_inodes,
1673 .procname = "inode-state",
1674 .data = &inodes_stat,
1675 .maxlen = 7*sizeof(long),
1677 .proc_handler = proc_nr_inodes,
1680 .procname = "file-nr",
1681 .data = &files_stat,
1682 .maxlen = sizeof(files_stat),
1684 .proc_handler = proc_nr_files,
1687 .procname = "file-max",
1688 .data = &files_stat.max_files,
1689 .maxlen = sizeof(files_stat.max_files),
1691 .proc_handler = proc_doulongvec_minmax,
1694 .procname = "nr_open",
1695 .data = &sysctl_nr_open,
1696 .maxlen = sizeof(unsigned int),
1698 .proc_handler = proc_dointvec_minmax,
1699 .extra1 = &sysctl_nr_open_min,
1700 .extra2 = &sysctl_nr_open_max,
1703 .procname = "dentry-state",
1704 .data = &dentry_stat,
1705 .maxlen = 6*sizeof(long),
1707 .proc_handler = proc_nr_dentry,
1710 .procname = "overflowuid",
1711 .data = &fs_overflowuid,
1712 .maxlen = sizeof(int),
1714 .proc_handler = proc_dointvec_minmax,
1715 .extra1 = &minolduid,
1716 .extra2 = &maxolduid,
1719 .procname = "overflowgid",
1720 .data = &fs_overflowgid,
1721 .maxlen = sizeof(int),
1723 .proc_handler = proc_dointvec_minmax,
1724 .extra1 = &minolduid,
1725 .extra2 = &maxolduid,
1727 #ifdef CONFIG_FILE_LOCKING
1729 .procname = "leases-enable",
1730 .data = &leases_enable,
1731 .maxlen = sizeof(int),
1733 .proc_handler = proc_dointvec,
1736 #ifdef CONFIG_DNOTIFY
1738 .procname = "dir-notify-enable",
1739 .data = &dir_notify_enable,
1740 .maxlen = sizeof(int),
1742 .proc_handler = proc_dointvec,
1746 #ifdef CONFIG_FILE_LOCKING
1748 .procname = "lease-break-time",
1749 .data = &lease_break_time,
1750 .maxlen = sizeof(int),
1752 .proc_handler = proc_dointvec,
1757 .procname = "aio-nr",
1759 .maxlen = sizeof(aio_nr),
1761 .proc_handler = proc_doulongvec_minmax,
1764 .procname = "aio-max-nr",
1765 .data = &aio_max_nr,
1766 .maxlen = sizeof(aio_max_nr),
1768 .proc_handler = proc_doulongvec_minmax,
1770 #endif /* CONFIG_AIO */
1771 #ifdef CONFIG_INOTIFY_USER
1773 .procname = "inotify",
1775 .child = inotify_table,
1780 .procname = "epoll",
1782 .child = epoll_table,
1787 .procname = "protected_symlinks",
1788 .data = &sysctl_protected_symlinks,
1789 .maxlen = sizeof(int),
1791 .proc_handler = proc_dointvec_minmax,
1796 .procname = "protected_hardlinks",
1797 .data = &sysctl_protected_hardlinks,
1798 .maxlen = sizeof(int),
1800 .proc_handler = proc_dointvec_minmax,
1805 .procname = "suid_dumpable",
1806 .data = &suid_dumpable,
1807 .maxlen = sizeof(int),
1809 .proc_handler = proc_dointvec_minmax_coredump,
1813 #if defined(CONFIG_BINFMT_MISC) || defined(CONFIG_BINFMT_MISC_MODULE)
1815 .procname = "binfmt_misc",
1817 .child = sysctl_mount_point,
1821 .procname = "pipe-max-size",
1822 .data = &pipe_max_size,
1823 .maxlen = sizeof(int),
1825 .proc_handler = &pipe_proc_fn,
1826 .extra1 = &pipe_min_size,
1829 .procname = "pipe-user-pages-hard",
1830 .data = &pipe_user_pages_hard,
1831 .maxlen = sizeof(pipe_user_pages_hard),
1833 .proc_handler = proc_doulongvec_minmax,
1836 .procname = "pipe-user-pages-soft",
1837 .data = &pipe_user_pages_soft,
1838 .maxlen = sizeof(pipe_user_pages_soft),
1840 .proc_handler = proc_doulongvec_minmax,
1843 .procname = "mount-max",
1844 .data = &sysctl_mount_max,
1845 .maxlen = sizeof(unsigned int),
1847 .proc_handler = proc_dointvec_minmax,
1853 static struct ctl_table debug_table[] = {
1854 #ifdef CONFIG_SYSCTL_EXCEPTION_TRACE
1856 .procname = "exception-trace",
1857 .data = &show_unhandled_signals,
1858 .maxlen = sizeof(int),
1860 .proc_handler = proc_dointvec
1863 #if defined(CONFIG_OPTPROBES)
1865 .procname = "kprobes-optimization",
1866 .data = &sysctl_kprobes_optimization,
1867 .maxlen = sizeof(int),
1869 .proc_handler = proc_kprobes_optimization_handler,
1877 static struct ctl_table dev_table[] = {
1881 int __init sysctl_init(void)
1883 struct ctl_table_header *hdr;
1885 hdr = register_sysctl_table(sysctl_base_table);
1886 kmemleak_not_leak(hdr);
1890 #endif /* CONFIG_SYSCTL */
1896 #ifdef CONFIG_PROC_SYSCTL
1898 static int _proc_do_string(char *data, int maxlen, int write,
1899 char __user *buffer,
1900 size_t *lenp, loff_t *ppos)
1906 if (!data || !maxlen || !*lenp) {
1912 if (sysctl_writes_strict == SYSCTL_WRITES_STRICT) {
1913 /* Only continue writes not past the end of buffer. */
1915 if (len > maxlen - 1)
1922 /* Start writing from beginning of buffer. */
1928 while ((p - buffer) < *lenp && len < maxlen - 1) {
1929 if (get_user(c, p++))
1931 if (c == 0 || c == '\n')
1952 if (copy_to_user(buffer, data, len))
1955 if (put_user('\n', buffer + len))
1965 static void warn_sysctl_write(struct ctl_table *table)
1967 pr_warn_once("%s wrote to %s when file position was not 0!\n"
1968 "This will not be supported in the future. To silence this\n"
1969 "warning, set kernel.sysctl_writes_strict = -1\n",
1970 current->comm, table->procname);
1974 * proc_first_pos_non_zero_ignore - check if firs position is allowed
1975 * @ppos: file position
1976 * @table: the sysctl table
1978 * Returns true if the first position is non-zero and the sysctl_writes_strict
1979 * mode indicates this is not allowed for numeric input types. String proc
1980 * hadlers can ignore the return value.
1982 static bool proc_first_pos_non_zero_ignore(loff_t *ppos,
1983 struct ctl_table *table)
1988 switch (sysctl_writes_strict) {
1989 case SYSCTL_WRITES_STRICT:
1991 case SYSCTL_WRITES_WARN:
1992 warn_sysctl_write(table);
2000 * proc_dostring - read a string sysctl
2001 * @table: the sysctl table
2002 * @write: %TRUE if this is a write to the sysctl file
2003 * @buffer: the user buffer
2004 * @lenp: the size of the user buffer
2005 * @ppos: file position
2007 * Reads/writes a string from/to the user buffer. If the kernel
2008 * buffer provided is not large enough to hold the string, the
2009 * string is truncated. The copied string is %NULL-terminated.
2010 * If the string is being read by the user process, it is copied
2011 * and a newline '\n' is added. It is truncated if the buffer is
2014 * Returns 0 on success.
2016 int proc_dostring(struct ctl_table *table, int write,
2017 void __user *buffer, size_t *lenp, loff_t *ppos)
2020 proc_first_pos_non_zero_ignore(ppos, table);
2022 return _proc_do_string((char *)(table->data), table->maxlen, write,
2023 (char __user *)buffer, lenp, ppos);
2026 static size_t proc_skip_spaces(char **buf)
2029 char *tmp = skip_spaces(*buf);
2035 static void proc_skip_char(char **buf, size_t *size, const char v)
2045 #define TMPBUFLEN 22
2047 * proc_get_long - reads an ASCII formatted integer from a user buffer
2049 * @buf: a kernel buffer
2050 * @size: size of the kernel buffer
2051 * @val: this is where the number will be stored
2052 * @neg: set to %TRUE if number is negative
2053 * @perm_tr: a vector which contains the allowed trailers
2054 * @perm_tr_len: size of the perm_tr vector
2055 * @tr: pointer to store the trailer character
2057 * In case of success %0 is returned and @buf and @size are updated with
2058 * the amount of bytes read. If @tr is non-NULL and a trailing
2059 * character exists (size is non-zero after returning from this
2060 * function), @tr is updated with the trailing character.
2062 static int proc_get_long(char **buf, size_t *size,
2063 unsigned long *val, bool *neg,
2064 const char *perm_tr, unsigned perm_tr_len, char *tr)
2067 char *p, tmp[TMPBUFLEN];
2073 if (len > TMPBUFLEN - 1)
2074 len = TMPBUFLEN - 1;
2076 memcpy(tmp, *buf, len);
2080 if (*p == '-' && *size > 1) {
2088 *val = simple_strtoul(p, &p, 0);
2092 /* We don't know if the next char is whitespace thus we may accept
2093 * invalid integers (e.g. 1234...a) or two integers instead of one
2094 * (e.g. 123...1). So lets not allow such large numbers. */
2095 if (len == TMPBUFLEN - 1)
2098 if (len < *size && perm_tr_len && !memchr(perm_tr, *p, perm_tr_len))
2101 if (tr && (len < *size))
2111 * proc_put_long - converts an integer to a decimal ASCII formatted string
2113 * @buf: the user buffer
2114 * @size: the size of the user buffer
2115 * @val: the integer to be converted
2116 * @neg: sign of the number, %TRUE for negative
2118 * In case of success %0 is returned and @buf and @size are updated with
2119 * the amount of bytes written.
2121 static int proc_put_long(void __user **buf, size_t *size, unsigned long val,
2125 char tmp[TMPBUFLEN], *p = tmp;
2127 sprintf(p, "%s%lu", neg ? "-" : "", val);
2131 if (copy_to_user(*buf, tmp, len))
2139 static int proc_put_char(void __user **buf, size_t *size, char c)
2142 char __user **buffer = (char __user **)buf;
2143 if (put_user(c, *buffer))
2145 (*size)--, (*buffer)++;
2151 static int do_proc_dointvec_conv(bool *negp, unsigned long *lvalp,
2153 int write, void *data)
2157 if (*lvalp > (unsigned long) INT_MAX + 1)
2161 if (*lvalp > (unsigned long) INT_MAX)
2169 *lvalp = -(unsigned long)val;
2172 *lvalp = (unsigned long)val;
2178 static int do_proc_douintvec_conv(bool *negp, unsigned long *lvalp,
2180 int write, void *data)
2185 if (*lvalp > UINT_MAX)
2189 unsigned int val = *valp;
2191 *lvalp = (unsigned long)val;
2196 static const char proc_wspace_sep[] = { ' ', '\t', '\n' };
2198 static int __do_proc_dointvec(void *tbl_data, struct ctl_table *table,
2199 int write, void __user *buffer,
2200 size_t *lenp, loff_t *ppos,
2201 int (*conv)(bool *negp, unsigned long *lvalp, int *valp,
2202 int write, void *data),
2205 int *i, vleft, first = 1, err = 0;
2207 char *kbuf = NULL, *p;
2209 if (!tbl_data || !table->maxlen || !*lenp || (*ppos && !write)) {
2214 i = (int *) tbl_data;
2215 vleft = table->maxlen / sizeof(*i);
2219 conv = do_proc_dointvec_conv;
2222 if (proc_first_pos_non_zero_ignore(ppos, table))
2225 if (left > PAGE_SIZE - 1)
2226 left = PAGE_SIZE - 1;
2227 p = kbuf = memdup_user_nul(buffer, left);
2229 return PTR_ERR(kbuf);
2232 for (; left && vleft--; i++, first=0) {
2237 left -= proc_skip_spaces(&p);
2241 err = proc_get_long(&p, &left, &lval, &neg,
2243 sizeof(proc_wspace_sep), NULL);
2246 if (conv(&neg, &lval, i, 1, data)) {
2251 if (conv(&neg, &lval, i, 0, data)) {
2256 err = proc_put_char(&buffer, &left, '\t');
2259 err = proc_put_long(&buffer, &left, lval, neg);
2265 if (!write && !first && left && !err)
2266 err = proc_put_char(&buffer, &left, '\n');
2267 if (write && !err && left)
2268 left -= proc_skip_spaces(&p);
2272 return err ? : -EINVAL;
2280 static int do_proc_dointvec(struct ctl_table *table, int write,
2281 void __user *buffer, size_t *lenp, loff_t *ppos,
2282 int (*conv)(bool *negp, unsigned long *lvalp, int *valp,
2283 int write, void *data),
2286 return __do_proc_dointvec(table->data, table, write,
2287 buffer, lenp, ppos, conv, data);
2291 * proc_dointvec - read a vector of integers
2292 * @table: the sysctl table
2293 * @write: %TRUE if this is a write to the sysctl file
2294 * @buffer: the user buffer
2295 * @lenp: the size of the user buffer
2296 * @ppos: file position
2298 * Reads/writes up to table->maxlen/sizeof(unsigned int) integer
2299 * values from/to the user buffer, treated as an ASCII string.
2301 * Returns 0 on success.
2303 int proc_dointvec(struct ctl_table *table, int write,
2304 void __user *buffer, size_t *lenp, loff_t *ppos)
2306 return do_proc_dointvec(table, write, buffer, lenp, ppos, NULL, NULL);
2310 * proc_douintvec - read a vector of unsigned integers
2311 * @table: the sysctl table
2312 * @write: %TRUE if this is a write to the sysctl file
2313 * @buffer: the user buffer
2314 * @lenp: the size of the user buffer
2315 * @ppos: file position
2317 * Reads/writes up to table->maxlen/sizeof(unsigned int) unsigned integer
2318 * values from/to the user buffer, treated as an ASCII string.
2320 * Returns 0 on success.
2322 int proc_douintvec(struct ctl_table *table, int write,
2323 void __user *buffer, size_t *lenp, loff_t *ppos)
2325 return do_proc_dointvec(table, write, buffer, lenp, ppos,
2326 do_proc_douintvec_conv, NULL);
2330 * Taint values can only be increased
2331 * This means we can safely use a temporary.
2333 static int proc_taint(struct ctl_table *table, int write,
2334 void __user *buffer, size_t *lenp, loff_t *ppos)
2337 unsigned long tmptaint = get_taint();
2340 if (write && !capable(CAP_SYS_ADMIN))
2345 err = proc_doulongvec_minmax(&t, write, buffer, lenp, ppos);
2351 * Poor man's atomic or. Not worth adding a primitive
2352 * to everyone's atomic.h for this
2355 for (i = 0; i < BITS_PER_LONG && tmptaint >> i; i++) {
2356 if ((tmptaint >> i) & 1)
2357 add_taint(i, LOCKDEP_STILL_OK);
2364 #ifdef CONFIG_PRINTK
2365 static int proc_dointvec_minmax_sysadmin(struct ctl_table *table, int write,
2366 void __user *buffer, size_t *lenp, loff_t *ppos)
2368 if (write && !capable(CAP_SYS_ADMIN))
2371 return proc_dointvec_minmax(table, write, buffer, lenp, ppos);
2375 struct do_proc_dointvec_minmax_conv_param {
2380 static int do_proc_dointvec_minmax_conv(bool *negp, unsigned long *lvalp,
2382 int write, void *data)
2384 struct do_proc_dointvec_minmax_conv_param *param = data;
2386 int val = *negp ? -*lvalp : *lvalp;
2387 if ((param->min && *param->min > val) ||
2388 (param->max && *param->max < val))
2395 *lvalp = -(unsigned long)val;
2398 *lvalp = (unsigned long)val;
2405 * proc_dointvec_minmax - read a vector of integers with min/max values
2406 * @table: the sysctl table
2407 * @write: %TRUE if this is a write to the sysctl file
2408 * @buffer: the user buffer
2409 * @lenp: the size of the user buffer
2410 * @ppos: file position
2412 * Reads/writes up to table->maxlen/sizeof(unsigned int) integer
2413 * values from/to the user buffer, treated as an ASCII string.
2415 * This routine will ensure the values are within the range specified by
2416 * table->extra1 (min) and table->extra2 (max).
2418 * Returns 0 on success.
2420 int proc_dointvec_minmax(struct ctl_table *table, int write,
2421 void __user *buffer, size_t *lenp, loff_t *ppos)
2423 struct do_proc_dointvec_minmax_conv_param param = {
2424 .min = (int *) table->extra1,
2425 .max = (int *) table->extra2,
2427 return do_proc_dointvec(table, write, buffer, lenp, ppos,
2428 do_proc_dointvec_minmax_conv, ¶m);
2431 static void validate_coredump_safety(void)
2433 #ifdef CONFIG_COREDUMP
2434 if (suid_dumpable == SUID_DUMP_ROOT &&
2435 core_pattern[0] != '/' && core_pattern[0] != '|') {
2437 "Unsafe core_pattern used with fs.suid_dumpable=2.\n"
2438 "Pipe handler or fully qualified core dump path required.\n"
2439 "Set kernel.core_pattern before fs.suid_dumpable.\n"
2445 static int proc_dointvec_minmax_coredump(struct ctl_table *table, int write,
2446 void __user *buffer, size_t *lenp, loff_t *ppos)
2448 int error = proc_dointvec_minmax(table, write, buffer, lenp, ppos);
2450 validate_coredump_safety();
2454 #ifdef CONFIG_COREDUMP
2455 static int proc_dostring_coredump(struct ctl_table *table, int write,
2456 void __user *buffer, size_t *lenp, loff_t *ppos)
2458 int error = proc_dostring(table, write, buffer, lenp, ppos);
2460 validate_coredump_safety();
2465 static int __do_proc_doulongvec_minmax(void *data, struct ctl_table *table, int write,
2466 void __user *buffer,
2467 size_t *lenp, loff_t *ppos,
2468 unsigned long convmul,
2469 unsigned long convdiv)
2471 unsigned long *i, *min, *max;
2472 int vleft, first = 1, err = 0;
2474 char *kbuf = NULL, *p;
2476 if (!data || !table->maxlen || !*lenp || (*ppos && !write)) {
2481 i = (unsigned long *) data;
2482 min = (unsigned long *) table->extra1;
2483 max = (unsigned long *) table->extra2;
2484 vleft = table->maxlen / sizeof(unsigned long);
2488 if (proc_first_pos_non_zero_ignore(ppos, table))
2491 if (left > PAGE_SIZE - 1)
2492 left = PAGE_SIZE - 1;
2493 p = kbuf = memdup_user_nul(buffer, left);
2495 return PTR_ERR(kbuf);
2498 for (; left && vleft--; i++, first = 0) {
2504 left -= proc_skip_spaces(&p);
2506 err = proc_get_long(&p, &left, &val, &neg,
2508 sizeof(proc_wspace_sep), NULL);
2513 val = convmul * val / convdiv;
2514 if ((min && val < *min) || (max && val > *max))
2518 val = convdiv * (*i) / convmul;
2520 err = proc_put_char(&buffer, &left, '\t');
2524 err = proc_put_long(&buffer, &left, val, false);
2530 if (!write && !first && left && !err)
2531 err = proc_put_char(&buffer, &left, '\n');
2533 left -= proc_skip_spaces(&p);
2537 return err ? : -EINVAL;
2545 static int do_proc_doulongvec_minmax(struct ctl_table *table, int write,
2546 void __user *buffer,
2547 size_t *lenp, loff_t *ppos,
2548 unsigned long convmul,
2549 unsigned long convdiv)
2551 return __do_proc_doulongvec_minmax(table->data, table, write,
2552 buffer, lenp, ppos, convmul, convdiv);
2556 * proc_doulongvec_minmax - read a vector of long integers with min/max values
2557 * @table: the sysctl table
2558 * @write: %TRUE if this is a write to the sysctl file
2559 * @buffer: the user buffer
2560 * @lenp: the size of the user buffer
2561 * @ppos: file position
2563 * Reads/writes up to table->maxlen/sizeof(unsigned long) unsigned long
2564 * values from/to the user buffer, treated as an ASCII string.
2566 * This routine will ensure the values are within the range specified by
2567 * table->extra1 (min) and table->extra2 (max).
2569 * Returns 0 on success.
2571 int proc_doulongvec_minmax(struct ctl_table *table, int write,
2572 void __user *buffer, size_t *lenp, loff_t *ppos)
2574 return do_proc_doulongvec_minmax(table, write, buffer, lenp, ppos, 1l, 1l);
2578 * proc_doulongvec_ms_jiffies_minmax - read a vector of millisecond values with min/max values
2579 * @table: the sysctl table
2580 * @write: %TRUE if this is a write to the sysctl file
2581 * @buffer: the user buffer
2582 * @lenp: the size of the user buffer
2583 * @ppos: file position
2585 * Reads/writes up to table->maxlen/sizeof(unsigned long) unsigned long
2586 * values from/to the user buffer, treated as an ASCII string. The values
2587 * are treated as milliseconds, and converted to jiffies when they are stored.
2589 * This routine will ensure the values are within the range specified by
2590 * table->extra1 (min) and table->extra2 (max).
2592 * Returns 0 on success.
2594 int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int write,
2595 void __user *buffer,
2596 size_t *lenp, loff_t *ppos)
2598 return do_proc_doulongvec_minmax(table, write, buffer,
2599 lenp, ppos, HZ, 1000l);
2603 static int do_proc_dointvec_jiffies_conv(bool *negp, unsigned long *lvalp,
2605 int write, void *data)
2608 if (*lvalp > INT_MAX / HZ)
2610 *valp = *negp ? -(*lvalp*HZ) : (*lvalp*HZ);
2616 lval = -(unsigned long)val;
2619 lval = (unsigned long)val;
2626 static int do_proc_dointvec_userhz_jiffies_conv(bool *negp, unsigned long *lvalp,
2628 int write, void *data)
2631 if (USER_HZ < HZ && *lvalp > (LONG_MAX / HZ) * USER_HZ)
2633 *valp = clock_t_to_jiffies(*negp ? -*lvalp : *lvalp);
2639 lval = -(unsigned long)val;
2642 lval = (unsigned long)val;
2644 *lvalp = jiffies_to_clock_t(lval);
2649 static int do_proc_dointvec_ms_jiffies_conv(bool *negp, unsigned long *lvalp,
2651 int write, void *data)
2654 unsigned long jif = msecs_to_jiffies(*negp ? -*lvalp : *lvalp);
2664 lval = -(unsigned long)val;
2667 lval = (unsigned long)val;
2669 *lvalp = jiffies_to_msecs(lval);
2675 * proc_dointvec_jiffies - read a vector of integers as seconds
2676 * @table: the sysctl table
2677 * @write: %TRUE if this is a write to the sysctl file
2678 * @buffer: the user buffer
2679 * @lenp: the size of the user buffer
2680 * @ppos: file position
2682 * Reads/writes up to table->maxlen/sizeof(unsigned int) integer
2683 * values from/to the user buffer, treated as an ASCII string.
2684 * The values read are assumed to be in seconds, and are converted into
2687 * Returns 0 on success.
2689 int proc_dointvec_jiffies(struct ctl_table *table, int write,
2690 void __user *buffer, size_t *lenp, loff_t *ppos)
2692 return do_proc_dointvec(table,write,buffer,lenp,ppos,
2693 do_proc_dointvec_jiffies_conv,NULL);
2697 * proc_dointvec_userhz_jiffies - read a vector of integers as 1/USER_HZ seconds
2698 * @table: the sysctl table
2699 * @write: %TRUE if this is a write to the sysctl file
2700 * @buffer: the user buffer
2701 * @lenp: the size of the user buffer
2702 * @ppos: pointer to the file position
2704 * Reads/writes up to table->maxlen/sizeof(unsigned int) integer
2705 * values from/to the user buffer, treated as an ASCII string.
2706 * The values read are assumed to be in 1/USER_HZ seconds, and
2707 * are converted into jiffies.
2709 * Returns 0 on success.
2711 int proc_dointvec_userhz_jiffies(struct ctl_table *table, int write,
2712 void __user *buffer, size_t *lenp, loff_t *ppos)
2714 return do_proc_dointvec(table,write,buffer,lenp,ppos,
2715 do_proc_dointvec_userhz_jiffies_conv,NULL);
2719 * proc_dointvec_ms_jiffies - read a vector of integers as 1 milliseconds
2720 * @table: the sysctl table
2721 * @write: %TRUE if this is a write to the sysctl file
2722 * @buffer: the user buffer
2723 * @lenp: the size of the user buffer
2724 * @ppos: file position
2725 * @ppos: the current position in the file
2727 * Reads/writes up to table->maxlen/sizeof(unsigned int) integer
2728 * values from/to the user buffer, treated as an ASCII string.
2729 * The values read are assumed to be in 1/1000 seconds, and
2730 * are converted into jiffies.
2732 * Returns 0 on success.
2734 int proc_dointvec_ms_jiffies(struct ctl_table *table, int write,
2735 void __user *buffer, size_t *lenp, loff_t *ppos)
2737 return do_proc_dointvec(table, write, buffer, lenp, ppos,
2738 do_proc_dointvec_ms_jiffies_conv, NULL);
2741 static int proc_do_cad_pid(struct ctl_table *table, int write,
2742 void __user *buffer, size_t *lenp, loff_t *ppos)
2744 struct pid *new_pid;
2748 tmp = pid_vnr(cad_pid);
2750 r = __do_proc_dointvec(&tmp, table, write, buffer,
2751 lenp, ppos, NULL, NULL);
2755 new_pid = find_get_pid(tmp);
2759 put_pid(xchg(&cad_pid, new_pid));
2764 * proc_do_large_bitmap - read/write from/to a large bitmap
2765 * @table: the sysctl table
2766 * @write: %TRUE if this is a write to the sysctl file
2767 * @buffer: the user buffer
2768 * @lenp: the size of the user buffer
2769 * @ppos: file position
2771 * The bitmap is stored at table->data and the bitmap length (in bits)
2774 * We use a range comma separated format (e.g. 1,3-4,10-10) so that
2775 * large bitmaps may be represented in a compact manner. Writing into
2776 * the file will clear the bitmap then update it with the given input.
2778 * Returns 0 on success.
2780 int proc_do_large_bitmap(struct ctl_table *table, int write,
2781 void __user *buffer, size_t *lenp, loff_t *ppos)
2785 size_t left = *lenp;
2786 unsigned long bitmap_len = table->maxlen;
2787 unsigned long *bitmap = *(unsigned long **) table->data;
2788 unsigned long *tmp_bitmap = NULL;
2789 char tr_a[] = { '-', ',', '\n' }, tr_b[] = { ',', '\n', 0 }, c;
2791 if (!bitmap || !bitmap_len || !left || (*ppos && !write)) {
2799 if (left > PAGE_SIZE - 1)
2800 left = PAGE_SIZE - 1;
2802 p = kbuf = memdup_user_nul(buffer, left);
2804 return PTR_ERR(kbuf);
2806 tmp_bitmap = kzalloc(BITS_TO_LONGS(bitmap_len) * sizeof(unsigned long),
2812 proc_skip_char(&p, &left, '\n');
2813 while (!err && left) {
2814 unsigned long val_a, val_b;
2817 err = proc_get_long(&p, &left, &val_a, &neg, tr_a,
2821 if (val_a >= bitmap_len || neg) {
2833 err = proc_get_long(&p, &left, &val_b,
2834 &neg, tr_b, sizeof(tr_b),
2838 if (val_b >= bitmap_len || neg ||
2849 bitmap_set(tmp_bitmap, val_a, val_b - val_a + 1);
2851 proc_skip_char(&p, &left, '\n');
2855 unsigned long bit_a, bit_b = 0;
2858 bit_a = find_next_bit(bitmap, bitmap_len, bit_b);
2859 if (bit_a >= bitmap_len)
2861 bit_b = find_next_zero_bit(bitmap, bitmap_len,
2865 err = proc_put_char(&buffer, &left, ',');
2869 err = proc_put_long(&buffer, &left, bit_a, false);
2872 if (bit_a != bit_b) {
2873 err = proc_put_char(&buffer, &left, '-');
2876 err = proc_put_long(&buffer, &left, bit_b, false);
2884 err = proc_put_char(&buffer, &left, '\n');
2890 bitmap_or(bitmap, bitmap, tmp_bitmap, bitmap_len);
2892 bitmap_copy(bitmap, tmp_bitmap, bitmap_len);
2904 #else /* CONFIG_PROC_SYSCTL */
2906 int proc_dostring(struct ctl_table *table, int write,
2907 void __user *buffer, size_t *lenp, loff_t *ppos)
2912 int proc_dointvec(struct ctl_table *table, int write,
2913 void __user *buffer, size_t *lenp, loff_t *ppos)
2918 int proc_douintvec(struct ctl_table *table, int write,
2919 void __user *buffer, size_t *lenp, loff_t *ppos)
2924 int proc_dointvec_minmax(struct ctl_table *table, int write,
2925 void __user *buffer, size_t *lenp, loff_t *ppos)
2930 int proc_dointvec_jiffies(struct ctl_table *table, int write,
2931 void __user *buffer, size_t *lenp, loff_t *ppos)
2936 int proc_dointvec_userhz_jiffies(struct ctl_table *table, int write,
2937 void __user *buffer, size_t *lenp, loff_t *ppos)
2942 int proc_dointvec_ms_jiffies(struct ctl_table *table, int write,
2943 void __user *buffer, size_t *lenp, loff_t *ppos)
2948 int proc_doulongvec_minmax(struct ctl_table *table, int write,
2949 void __user *buffer, size_t *lenp, loff_t *ppos)
2954 int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int write,
2955 void __user *buffer,
2956 size_t *lenp, loff_t *ppos)
2962 #endif /* CONFIG_PROC_SYSCTL */
2965 * No sense putting this after each symbol definition, twice,
2966 * exception granted :-)
2968 EXPORT_SYMBOL(proc_dointvec);
2969 EXPORT_SYMBOL(proc_douintvec);
2970 EXPORT_SYMBOL(proc_dointvec_jiffies);
2971 EXPORT_SYMBOL(proc_dointvec_minmax);
2972 EXPORT_SYMBOL(proc_dointvec_userhz_jiffies);
2973 EXPORT_SYMBOL(proc_dointvec_ms_jiffies);
2974 EXPORT_SYMBOL(proc_dostring);
2975 EXPORT_SYMBOL(proc_doulongvec_minmax);
2976 EXPORT_SYMBOL(proc_doulongvec_ms_jiffies_minmax);