2 * sysctl.c: General linux system control interface
4 * Begun 24 March 1995, Stephen Tweedie
5 * Added /proc support, Dec 1995
6 * Added bdflush entry and intvec min/max checking, 2/23/96, Tom Dyas.
7 * Added hooks for /proc/sys/net (minor, minor patch), 96/4/1, Mike Shaver.
8 * Added kernel/java-{interpreter,appletviewer}, 96/5/10, Mike Shaver.
9 * Dynamic registration fixes, Stephen Tweedie.
10 * Added kswapd-interval, ctrl-alt-del, printk stuff, 1/8/97, Chris Horn.
11 * Made sysctl support optional via CONFIG_SYSCTL, 1/10/97, Chris
13 * Added proc_doulongvec_ms_jiffies_minmax, 09/08/99, Carlos H. Bauer.
14 * Added proc_doulongvec_minmax, 09/08/99, Carlos H. Bauer.
15 * Changed linked lists to use list.h instead of lists.h, 02/24/00, Bill
17 * The list_for_each() macro wasn't appropriate for the sysctl loop.
18 * Removed it and replaced it with older style, 03/23/00, Bill Wendling
21 #include <linux/module.h>
22 #include <linux/aio.h>
24 #include <linux/swap.h>
25 #include <linux/slab.h>
26 #include <linux/sysctl.h>
27 #include <linux/bitmap.h>
28 #include <linux/signal.h>
29 #include <linux/printk.h>
30 #include <linux/proc_fs.h>
31 #include <linux/security.h>
32 #include <linux/ctype.h>
33 #include <linux/kmemcheck.h>
34 #include <linux/kmemleak.h>
36 #include <linux/init.h>
37 #include <linux/kernel.h>
38 #include <linux/kobject.h>
39 #include <linux/net.h>
40 #include <linux/sysrq.h>
41 #include <linux/highuid.h>
42 #include <linux/writeback.h>
43 #include <linux/ratelimit.h>
44 #include <linux/compaction.h>
45 #include <linux/hugetlb.h>
46 #include <linux/initrd.h>
47 #include <linux/key.h>
48 #include <linux/times.h>
49 #include <linux/limits.h>
50 #include <linux/dcache.h>
51 #include <linux/dnotify.h>
52 #include <linux/syscalls.h>
53 #include <linux/vmstat.h>
54 #include <linux/nfs_fs.h>
55 #include <linux/acpi.h>
56 #include <linux/reboot.h>
57 #include <linux/ftrace.h>
58 #include <linux/perf_event.h>
59 #include <linux/kprobes.h>
60 #include <linux/pipe_fs_i.h>
61 #include <linux/oom.h>
62 #include <linux/kmod.h>
63 #include <linux/capability.h>
64 #include <linux/binfmts.h>
65 #include <linux/sched/sysctl.h>
66 #include <linux/kexec.h>
67 #include <linux/bpf.h>
68 #include <linux/mount.h>
70 #include <asm/uaccess.h>
71 #include <asm/processor.h>
75 #include <asm/stacktrace.h>
79 #include <asm/setup.h>
81 #ifdef CONFIG_BSD_PROCESS_ACCT
82 #include <linux/acct.h>
84 #ifdef CONFIG_RT_MUTEXES
85 #include <linux/rtmutex.h>
87 #if defined(CONFIG_PROVE_LOCKING) || defined(CONFIG_LOCK_STAT)
88 #include <linux/lockdep.h>
90 #ifdef CONFIG_CHR_DEV_SG
94 #ifdef CONFIG_LOCKUP_DETECTOR
95 #include <linux/nmi.h>
98 #if defined(CONFIG_SYSCTL)
100 /* External variables not in a header file. */
101 extern int suid_dumpable;
102 #ifdef CONFIG_COREDUMP
103 extern int core_uses_pid;
104 extern char core_pattern[];
105 extern unsigned int core_pipe_limit;
108 extern int pid_max_min, pid_max_max;
109 extern int percpu_pagelist_fraction;
110 extern int latencytop_enabled;
111 extern unsigned int sysctl_nr_open_min, sysctl_nr_open_max;
113 extern int sysctl_nr_trim_pages;
116 /* Constants used for minimum and maximum */
117 #ifdef CONFIG_LOCKUP_DETECTOR
118 static int sixty = 60;
121 static int __maybe_unused neg_one = -1;
124 static int __maybe_unused one = 1;
125 static int __maybe_unused two = 2;
126 static int __maybe_unused four = 4;
127 static unsigned long zero_ul;
128 static unsigned long one_ul = 1;
129 static unsigned long long_max = LONG_MAX;
130 static int one_hundred = 100;
131 static int one_thousand = 1000;
133 static int ten_thousand = 10000;
135 #ifdef CONFIG_PERF_EVENTS
136 static int six_hundred_forty_kb = 640 * 1024;
139 /* this is needed for the proc_doulongvec_minmax of vm_dirty_bytes */
140 static unsigned long dirty_bytes_min = 2 * PAGE_SIZE;
142 /* this is needed for the proc_dointvec_minmax for [fs_]overflow UID and GID */
143 static int maxolduid = 65535;
144 static int minolduid;
146 static int ngroups_max = NGROUPS_MAX;
147 static const int cap_last_cap = CAP_LAST_CAP;
149 /*this is needed for proc_doulongvec_minmax of sysctl_hung_task_timeout_secs */
150 #ifdef CONFIG_DETECT_HUNG_TASK
151 static unsigned long hung_task_timeout_max = (LONG_MAX/HZ);
154 #ifdef CONFIG_INOTIFY_USER
155 #include <linux/inotify.h>
161 extern int pwrsw_enabled;
164 #ifdef CONFIG_SYSCTL_ARCH_UNALIGN_ALLOW
165 extern int unaligned_enabled;
169 extern int unaligned_dump_stack;
172 #ifdef CONFIG_SYSCTL_ARCH_UNALIGN_NO_WARN
173 extern int no_unaligned_warning;
176 #ifdef CONFIG_PROC_SYSCTL
178 #define SYSCTL_WRITES_LEGACY -1
179 #define SYSCTL_WRITES_WARN 0
180 #define SYSCTL_WRITES_STRICT 1
182 static int sysctl_writes_strict = SYSCTL_WRITES_STRICT;
184 static int proc_do_cad_pid(struct ctl_table *table, int write,
185 void __user *buffer, size_t *lenp, loff_t *ppos);
186 static int proc_taint(struct ctl_table *table, int write,
187 void __user *buffer, size_t *lenp, loff_t *ppos);
191 static int proc_dointvec_minmax_sysadmin(struct ctl_table *table, int write,
192 void __user *buffer, size_t *lenp, loff_t *ppos);
195 static int proc_dointvec_minmax_coredump(struct ctl_table *table, int write,
196 void __user *buffer, size_t *lenp, loff_t *ppos);
197 #ifdef CONFIG_COREDUMP
198 static int proc_dostring_coredump(struct ctl_table *table, int write,
199 void __user *buffer, size_t *lenp, loff_t *ppos);
202 #ifdef CONFIG_MAGIC_SYSRQ
203 /* Note: sysrq code uses it's own private copy */
204 static int __sysrq_enabled = CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE;
206 static int sysrq_sysctl_handler(struct ctl_table *table, int write,
207 void __user *buffer, size_t *lenp,
212 error = proc_dointvec(table, write, buffer, lenp, ppos);
217 sysrq_toggle_support(__sysrq_enabled);
224 #ifdef CONFIG_BPF_SYSCALL
225 static int bpf_unpriv_handler(struct ctl_table *table, int write,
226 void *buffer, size_t *lenp, loff_t *ppos)
228 int ret, unpriv_enable = *(int *)table->data;
229 bool locked_state = unpriv_enable == 1;
230 struct ctl_table tmp = *table;
232 if (write && !capable(CAP_SYS_ADMIN))
235 tmp.data = &unpriv_enable;
236 ret = proc_dointvec_minmax(&tmp, write, buffer, lenp, ppos);
238 if (locked_state && unpriv_enable != 1)
240 *(int *)table->data = unpriv_enable;
246 static struct ctl_table kern_table[];
247 static struct ctl_table vm_table[];
248 static struct ctl_table fs_table[];
249 static struct ctl_table debug_table[];
250 static struct ctl_table dev_table[];
251 extern struct ctl_table random_table[];
253 extern struct ctl_table epoll_table[];
256 #ifdef HAVE_ARCH_PICK_MMAP_LAYOUT
257 int sysctl_legacy_va_layout;
260 /* The default sysctl tables: */
262 static struct ctl_table sysctl_base_table[] = {
264 .procname = "kernel",
281 .child = debug_table,
291 #ifdef CONFIG_SCHED_DEBUG
292 static int min_sched_granularity_ns = 100000; /* 100 usecs */
293 static int max_sched_granularity_ns = NSEC_PER_SEC; /* 1 second */
294 static int min_wakeup_granularity_ns; /* 0 usecs */
295 static int max_wakeup_granularity_ns = NSEC_PER_SEC; /* 1 second */
297 static int min_sched_tunable_scaling = SCHED_TUNABLESCALING_NONE;
298 static int max_sched_tunable_scaling = SCHED_TUNABLESCALING_END-1;
299 #endif /* CONFIG_SMP */
300 #endif /* CONFIG_SCHED_DEBUG */
302 #ifdef CONFIG_COMPACTION
303 static int min_extfrag_threshold;
304 static int max_extfrag_threshold = 1000;
307 static struct ctl_table kern_table[] = {
309 .procname = "sched_child_runs_first",
310 .data = &sysctl_sched_child_runs_first,
311 .maxlen = sizeof(unsigned int),
313 .proc_handler = proc_dointvec,
315 #ifdef CONFIG_SCHED_DEBUG
317 .procname = "sched_min_granularity_ns",
318 .data = &sysctl_sched_min_granularity,
319 .maxlen = sizeof(unsigned int),
321 .proc_handler = sched_proc_update_handler,
322 .extra1 = &min_sched_granularity_ns,
323 .extra2 = &max_sched_granularity_ns,
326 .procname = "sched_latency_ns",
327 .data = &sysctl_sched_latency,
328 .maxlen = sizeof(unsigned int),
330 .proc_handler = sched_proc_update_handler,
331 .extra1 = &min_sched_granularity_ns,
332 .extra2 = &max_sched_granularity_ns,
335 .procname = "sched_wakeup_granularity_ns",
336 .data = &sysctl_sched_wakeup_granularity,
337 .maxlen = sizeof(unsigned int),
339 .proc_handler = sched_proc_update_handler,
340 .extra1 = &min_wakeup_granularity_ns,
341 .extra2 = &max_wakeup_granularity_ns,
345 .procname = "sched_tunable_scaling",
346 .data = &sysctl_sched_tunable_scaling,
347 .maxlen = sizeof(enum sched_tunable_scaling),
349 .proc_handler = sched_proc_update_handler,
350 .extra1 = &min_sched_tunable_scaling,
351 .extra2 = &max_sched_tunable_scaling,
354 .procname = "sched_migration_cost_ns",
355 .data = &sysctl_sched_migration_cost,
356 .maxlen = sizeof(unsigned int),
358 .proc_handler = proc_dointvec,
361 .procname = "sched_nr_migrate",
362 .data = &sysctl_sched_nr_migrate,
363 .maxlen = sizeof(unsigned int),
365 .proc_handler = proc_dointvec,
368 .procname = "sched_time_avg_ms",
369 .data = &sysctl_sched_time_avg,
370 .maxlen = sizeof(unsigned int),
372 .proc_handler = proc_dointvec_minmax,
376 .procname = "sched_shares_window_ns",
377 .data = &sysctl_sched_shares_window,
378 .maxlen = sizeof(unsigned int),
380 .proc_handler = proc_dointvec,
382 #ifdef CONFIG_SCHEDSTATS
384 .procname = "sched_schedstats",
386 .maxlen = sizeof(unsigned int),
388 .proc_handler = sysctl_schedstats,
392 #endif /* CONFIG_SCHEDSTATS */
393 #endif /* CONFIG_SMP */
394 #ifdef CONFIG_NUMA_BALANCING
396 .procname = "numa_balancing_scan_delay_ms",
397 .data = &sysctl_numa_balancing_scan_delay,
398 .maxlen = sizeof(unsigned int),
400 .proc_handler = proc_dointvec,
403 .procname = "numa_balancing_scan_period_min_ms",
404 .data = &sysctl_numa_balancing_scan_period_min,
405 .maxlen = sizeof(unsigned int),
407 .proc_handler = proc_dointvec,
410 .procname = "numa_balancing_scan_period_max_ms",
411 .data = &sysctl_numa_balancing_scan_period_max,
412 .maxlen = sizeof(unsigned int),
414 .proc_handler = proc_dointvec,
417 .procname = "numa_balancing_scan_size_mb",
418 .data = &sysctl_numa_balancing_scan_size,
419 .maxlen = sizeof(unsigned int),
421 .proc_handler = proc_dointvec_minmax,
425 .procname = "numa_balancing",
426 .data = NULL, /* filled in by handler */
427 .maxlen = sizeof(unsigned int),
429 .proc_handler = sysctl_numa_balancing,
433 #endif /* CONFIG_NUMA_BALANCING */
434 #endif /* CONFIG_SCHED_DEBUG */
436 .procname = "sched_rt_period_us",
437 .data = &sysctl_sched_rt_period,
438 .maxlen = sizeof(unsigned int),
440 .proc_handler = sched_rt_handler,
443 .procname = "sched_rt_runtime_us",
444 .data = &sysctl_sched_rt_runtime,
445 .maxlen = sizeof(int),
447 .proc_handler = sched_rt_handler,
450 .procname = "sched_rr_timeslice_ms",
451 .data = &sysctl_sched_rr_timeslice,
452 .maxlen = sizeof(int),
454 .proc_handler = sched_rr_handler,
456 #ifdef CONFIG_SCHED_AUTOGROUP
458 .procname = "sched_autogroup_enabled",
459 .data = &sysctl_sched_autogroup_enabled,
460 .maxlen = sizeof(unsigned int),
462 .proc_handler = proc_dointvec_minmax,
467 #ifdef CONFIG_CFS_BANDWIDTH
469 .procname = "sched_cfs_bandwidth_slice_us",
470 .data = &sysctl_sched_cfs_bandwidth_slice,
471 .maxlen = sizeof(unsigned int),
473 .proc_handler = proc_dointvec_minmax,
477 #ifdef CONFIG_PROVE_LOCKING
479 .procname = "prove_locking",
480 .data = &prove_locking,
481 .maxlen = sizeof(int),
483 .proc_handler = proc_dointvec,
486 #ifdef CONFIG_LOCK_STAT
488 .procname = "lock_stat",
490 .maxlen = sizeof(int),
492 .proc_handler = proc_dointvec,
497 .data = &panic_timeout,
498 .maxlen = sizeof(int),
500 .proc_handler = proc_dointvec,
502 #ifdef CONFIG_COREDUMP
504 .procname = "core_uses_pid",
505 .data = &core_uses_pid,
506 .maxlen = sizeof(int),
508 .proc_handler = proc_dointvec,
511 .procname = "core_pattern",
512 .data = core_pattern,
513 .maxlen = CORENAME_MAX_SIZE,
515 .proc_handler = proc_dostring_coredump,
518 .procname = "core_pipe_limit",
519 .data = &core_pipe_limit,
520 .maxlen = sizeof(unsigned int),
522 .proc_handler = proc_dointvec,
525 #ifdef CONFIG_PROC_SYSCTL
527 .procname = "tainted",
528 .maxlen = sizeof(long),
530 .proc_handler = proc_taint,
533 .procname = "sysctl_writes_strict",
534 .data = &sysctl_writes_strict,
535 .maxlen = sizeof(int),
537 .proc_handler = proc_dointvec_minmax,
542 #ifdef CONFIG_LATENCYTOP
544 .procname = "latencytop",
545 .data = &latencytop_enabled,
546 .maxlen = sizeof(int),
548 .proc_handler = sysctl_latencytop,
551 #ifdef CONFIG_BLK_DEV_INITRD
553 .procname = "real-root-dev",
554 .data = &real_root_dev,
555 .maxlen = sizeof(int),
557 .proc_handler = proc_dointvec,
561 .procname = "print-fatal-signals",
562 .data = &print_fatal_signals,
563 .maxlen = sizeof(int),
565 .proc_handler = proc_dointvec,
569 .procname = "reboot-cmd",
570 .data = reboot_command,
573 .proc_handler = proc_dostring,
576 .procname = "stop-a",
577 .data = &stop_a_enabled,
578 .maxlen = sizeof (int),
580 .proc_handler = proc_dointvec,
583 .procname = "scons-poweroff",
584 .data = &scons_pwroff,
585 .maxlen = sizeof (int),
587 .proc_handler = proc_dointvec,
590 #ifdef CONFIG_SPARC64
592 .procname = "tsb-ratio",
593 .data = &sysctl_tsb_ratio,
594 .maxlen = sizeof (int),
596 .proc_handler = proc_dointvec,
601 .procname = "soft-power",
602 .data = &pwrsw_enabled,
603 .maxlen = sizeof (int),
605 .proc_handler = proc_dointvec,
608 #ifdef CONFIG_SYSCTL_ARCH_UNALIGN_ALLOW
610 .procname = "unaligned-trap",
611 .data = &unaligned_enabled,
612 .maxlen = sizeof (int),
614 .proc_handler = proc_dointvec,
618 .procname = "ctrl-alt-del",
620 .maxlen = sizeof(int),
622 .proc_handler = proc_dointvec,
624 #ifdef CONFIG_FUNCTION_TRACER
626 .procname = "ftrace_enabled",
627 .data = &ftrace_enabled,
628 .maxlen = sizeof(int),
630 .proc_handler = ftrace_enable_sysctl,
633 #ifdef CONFIG_STACK_TRACER
635 .procname = "stack_tracer_enabled",
636 .data = &stack_tracer_enabled,
637 .maxlen = sizeof(int),
639 .proc_handler = stack_trace_sysctl,
642 #ifdef CONFIG_TRACING
644 .procname = "ftrace_dump_on_oops",
645 .data = &ftrace_dump_on_oops,
646 .maxlen = sizeof(int),
648 .proc_handler = proc_dointvec,
651 .procname = "traceoff_on_warning",
652 .data = &__disable_trace_on_warning,
653 .maxlen = sizeof(__disable_trace_on_warning),
655 .proc_handler = proc_dointvec,
658 .procname = "tracepoint_printk",
659 .data = &tracepoint_printk,
660 .maxlen = sizeof(tracepoint_printk),
662 .proc_handler = proc_dointvec,
665 #ifdef CONFIG_KEXEC_CORE
667 .procname = "kexec_load_disabled",
668 .data = &kexec_load_disabled,
669 .maxlen = sizeof(int),
671 /* only handle a transition from default "0" to "1" */
672 .proc_handler = proc_dointvec_minmax,
677 #ifdef CONFIG_MODULES
679 .procname = "modprobe",
680 .data = &modprobe_path,
681 .maxlen = KMOD_PATH_LEN,
683 .proc_handler = proc_dostring,
686 .procname = "modules_disabled",
687 .data = &modules_disabled,
688 .maxlen = sizeof(int),
690 /* only handle a transition from default "0" to "1" */
691 .proc_handler = proc_dointvec_minmax,
696 #ifdef CONFIG_UEVENT_HELPER
698 .procname = "hotplug",
699 .data = &uevent_helper,
700 .maxlen = UEVENT_HELPER_PATH_LEN,
702 .proc_handler = proc_dostring,
705 #ifdef CONFIG_CHR_DEV_SG
707 .procname = "sg-big-buff",
708 .data = &sg_big_buff,
709 .maxlen = sizeof (int),
711 .proc_handler = proc_dointvec,
714 #ifdef CONFIG_BSD_PROCESS_ACCT
718 .maxlen = 3*sizeof(int),
720 .proc_handler = proc_dointvec,
723 #ifdef CONFIG_MAGIC_SYSRQ
726 .data = &__sysrq_enabled,
727 .maxlen = sizeof (int),
729 .proc_handler = sysrq_sysctl_handler,
732 #ifdef CONFIG_PROC_SYSCTL
734 .procname = "cad_pid",
736 .maxlen = sizeof (int),
738 .proc_handler = proc_do_cad_pid,
742 .procname = "threads-max",
744 .maxlen = sizeof(int),
746 .proc_handler = sysctl_max_threads,
749 .procname = "random",
751 .child = random_table,
754 .procname = "usermodehelper",
756 .child = usermodehelper_table,
759 .procname = "overflowuid",
760 .data = &overflowuid,
761 .maxlen = sizeof(int),
763 .proc_handler = proc_dointvec_minmax,
764 .extra1 = &minolduid,
765 .extra2 = &maxolduid,
768 .procname = "overflowgid",
769 .data = &overflowgid,
770 .maxlen = sizeof(int),
772 .proc_handler = proc_dointvec_minmax,
773 .extra1 = &minolduid,
774 .extra2 = &maxolduid,
777 #ifdef CONFIG_MATHEMU
779 .procname = "ieee_emulation_warnings",
780 .data = &sysctl_ieee_emulation_warnings,
781 .maxlen = sizeof(int),
783 .proc_handler = proc_dointvec,
787 .procname = "userprocess_debug",
788 .data = &show_unhandled_signals,
789 .maxlen = sizeof(int),
791 .proc_handler = proc_dointvec,
795 .procname = "pid_max",
797 .maxlen = sizeof (int),
799 .proc_handler = proc_dointvec_minmax,
800 .extra1 = &pid_max_min,
801 .extra2 = &pid_max_max,
804 .procname = "panic_on_oops",
805 .data = &panic_on_oops,
806 .maxlen = sizeof(int),
808 .proc_handler = proc_dointvec,
810 #if defined CONFIG_PRINTK
812 .procname = "printk",
813 .data = &console_loglevel,
814 .maxlen = 4*sizeof(int),
816 .proc_handler = proc_dointvec,
819 .procname = "printk_ratelimit",
820 .data = &printk_ratelimit_state.interval,
821 .maxlen = sizeof(int),
823 .proc_handler = proc_dointvec_jiffies,
826 .procname = "printk_ratelimit_burst",
827 .data = &printk_ratelimit_state.burst,
828 .maxlen = sizeof(int),
830 .proc_handler = proc_dointvec,
833 .procname = "printk_delay",
834 .data = &printk_delay_msec,
835 .maxlen = sizeof(int),
837 .proc_handler = proc_dointvec_minmax,
839 .extra2 = &ten_thousand,
842 .procname = "printk_devkmsg",
843 .data = devkmsg_log_str,
844 .maxlen = DEVKMSG_STR_MAX_SIZE,
846 .proc_handler = devkmsg_sysctl_set_loglvl,
849 .procname = "dmesg_restrict",
850 .data = &dmesg_restrict,
851 .maxlen = sizeof(int),
853 .proc_handler = proc_dointvec_minmax_sysadmin,
858 .procname = "kptr_restrict",
859 .data = &kptr_restrict,
860 .maxlen = sizeof(int),
862 .proc_handler = proc_dointvec_minmax_sysadmin,
868 .procname = "ngroups_max",
869 .data = &ngroups_max,
870 .maxlen = sizeof (int),
872 .proc_handler = proc_dointvec,
875 .procname = "cap_last_cap",
876 .data = (void *)&cap_last_cap,
877 .maxlen = sizeof(int),
879 .proc_handler = proc_dointvec,
881 #if defined(CONFIG_LOCKUP_DETECTOR)
883 .procname = "watchdog",
884 .data = &watchdog_user_enabled,
885 .maxlen = sizeof (int),
887 .proc_handler = proc_watchdog,
892 .procname = "watchdog_thresh",
893 .data = &watchdog_thresh,
894 .maxlen = sizeof(int),
896 .proc_handler = proc_watchdog_thresh,
901 .procname = "nmi_watchdog",
902 .data = &nmi_watchdog_enabled,
903 .maxlen = sizeof (int),
905 .proc_handler = proc_nmi_watchdog,
907 #if defined(CONFIG_HAVE_NMI_WATCHDOG) || defined(CONFIG_HARDLOCKUP_DETECTOR)
914 .procname = "soft_watchdog",
915 .data = &soft_watchdog_enabled,
916 .maxlen = sizeof (int),
918 .proc_handler = proc_soft_watchdog,
923 .procname = "watchdog_cpumask",
924 .data = &watchdog_cpumask_bits,
927 .proc_handler = proc_watchdog_cpumask,
930 .procname = "softlockup_panic",
931 .data = &softlockup_panic,
932 .maxlen = sizeof(int),
934 .proc_handler = proc_dointvec_minmax,
938 #ifdef CONFIG_HARDLOCKUP_DETECTOR
940 .procname = "hardlockup_panic",
941 .data = &hardlockup_panic,
942 .maxlen = sizeof(int),
944 .proc_handler = proc_dointvec_minmax,
951 .procname = "softlockup_all_cpu_backtrace",
952 .data = &sysctl_softlockup_all_cpu_backtrace,
953 .maxlen = sizeof(int),
955 .proc_handler = proc_dointvec_minmax,
960 .procname = "hardlockup_all_cpu_backtrace",
961 .data = &sysctl_hardlockup_all_cpu_backtrace,
962 .maxlen = sizeof(int),
964 .proc_handler = proc_dointvec_minmax,
968 #endif /* CONFIG_SMP */
970 #if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86)
972 .procname = "unknown_nmi_panic",
973 .data = &unknown_nmi_panic,
974 .maxlen = sizeof (int),
976 .proc_handler = proc_dointvec,
979 #if defined(CONFIG_X86)
981 .procname = "panic_on_unrecovered_nmi",
982 .data = &panic_on_unrecovered_nmi,
983 .maxlen = sizeof(int),
985 .proc_handler = proc_dointvec,
988 .procname = "panic_on_io_nmi",
989 .data = &panic_on_io_nmi,
990 .maxlen = sizeof(int),
992 .proc_handler = proc_dointvec,
994 #ifdef CONFIG_DEBUG_STACKOVERFLOW
996 .procname = "panic_on_stackoverflow",
997 .data = &sysctl_panic_on_stackoverflow,
998 .maxlen = sizeof(int),
1000 .proc_handler = proc_dointvec,
1004 .procname = "bootloader_type",
1005 .data = &bootloader_type,
1006 .maxlen = sizeof (int),
1008 .proc_handler = proc_dointvec,
1011 .procname = "bootloader_version",
1012 .data = &bootloader_version,
1013 .maxlen = sizeof (int),
1015 .proc_handler = proc_dointvec,
1018 .procname = "kstack_depth_to_print",
1019 .data = &kstack_depth_to_print,
1020 .maxlen = sizeof(int),
1022 .proc_handler = proc_dointvec,
1025 .procname = "io_delay_type",
1026 .data = &io_delay_type,
1027 .maxlen = sizeof(int),
1029 .proc_handler = proc_dointvec,
1032 #if defined(CONFIG_MMU)
1034 .procname = "randomize_va_space",
1035 .data = &randomize_va_space,
1036 .maxlen = sizeof(int),
1038 .proc_handler = proc_dointvec,
1041 #if defined(CONFIG_S390) && defined(CONFIG_SMP)
1043 .procname = "spin_retry",
1044 .data = &spin_retry,
1045 .maxlen = sizeof (int),
1047 .proc_handler = proc_dointvec,
1050 #if defined(CONFIG_ACPI_SLEEP) && defined(CONFIG_X86)
1052 .procname = "acpi_video_flags",
1053 .data = &acpi_realmode_flags,
1054 .maxlen = sizeof (unsigned long),
1056 .proc_handler = proc_doulongvec_minmax,
1059 #ifdef CONFIG_SYSCTL_ARCH_UNALIGN_NO_WARN
1061 .procname = "ignore-unaligned-usertrap",
1062 .data = &no_unaligned_warning,
1063 .maxlen = sizeof (int),
1065 .proc_handler = proc_dointvec,
1070 .procname = "unaligned-dump-stack",
1071 .data = &unaligned_dump_stack,
1072 .maxlen = sizeof (int),
1074 .proc_handler = proc_dointvec,
1077 #ifdef CONFIG_DETECT_HUNG_TASK
1079 .procname = "hung_task_panic",
1080 .data = &sysctl_hung_task_panic,
1081 .maxlen = sizeof(int),
1083 .proc_handler = proc_dointvec_minmax,
1088 .procname = "hung_task_check_count",
1089 .data = &sysctl_hung_task_check_count,
1090 .maxlen = sizeof(int),
1092 .proc_handler = proc_dointvec_minmax,
1096 .procname = "hung_task_timeout_secs",
1097 .data = &sysctl_hung_task_timeout_secs,
1098 .maxlen = sizeof(unsigned long),
1100 .proc_handler = proc_dohung_task_timeout_secs,
1101 .extra2 = &hung_task_timeout_max,
1104 .procname = "hung_task_warnings",
1105 .data = &sysctl_hung_task_warnings,
1106 .maxlen = sizeof(int),
1108 .proc_handler = proc_dointvec_minmax,
1112 #ifdef CONFIG_RT_MUTEXES
1114 .procname = "max_lock_depth",
1115 .data = &max_lock_depth,
1116 .maxlen = sizeof(int),
1118 .proc_handler = proc_dointvec,
1122 .procname = "poweroff_cmd",
1123 .data = &poweroff_cmd,
1124 .maxlen = POWEROFF_CMD_PATH_LEN,
1126 .proc_handler = proc_dostring,
1132 .child = key_sysctls,
1135 #ifdef CONFIG_PERF_EVENTS
1137 * User-space scripts rely on the existence of this file
1138 * as a feature check for perf_events being enabled.
1140 * So it's an ABI, do not remove!
1143 .procname = "perf_event_paranoid",
1144 .data = &sysctl_perf_event_paranoid,
1145 .maxlen = sizeof(sysctl_perf_event_paranoid),
1147 .proc_handler = proc_dointvec,
1150 .procname = "perf_event_mlock_kb",
1151 .data = &sysctl_perf_event_mlock,
1152 .maxlen = sizeof(sysctl_perf_event_mlock),
1154 .proc_handler = proc_dointvec,
1157 .procname = "perf_event_max_sample_rate",
1158 .data = &sysctl_perf_event_sample_rate,
1159 .maxlen = sizeof(sysctl_perf_event_sample_rate),
1161 .proc_handler = perf_proc_update_handler,
1165 .procname = "perf_cpu_time_max_percent",
1166 .data = &sysctl_perf_cpu_time_max_percent,
1167 .maxlen = sizeof(sysctl_perf_cpu_time_max_percent),
1169 .proc_handler = perf_cpu_time_max_percent_handler,
1171 .extra2 = &one_hundred,
1174 .procname = "perf_event_max_stack",
1175 .data = &sysctl_perf_event_max_stack,
1176 .maxlen = sizeof(sysctl_perf_event_max_stack),
1178 .proc_handler = perf_event_max_stack_handler,
1180 .extra2 = &six_hundred_forty_kb,
1183 .procname = "perf_event_max_contexts_per_stack",
1184 .data = &sysctl_perf_event_max_contexts_per_stack,
1185 .maxlen = sizeof(sysctl_perf_event_max_contexts_per_stack),
1187 .proc_handler = perf_event_max_stack_handler,
1189 .extra2 = &one_thousand,
1192 #ifdef CONFIG_KMEMCHECK
1194 .procname = "kmemcheck",
1195 .data = &kmemcheck_enabled,
1196 .maxlen = sizeof(int),
1198 .proc_handler = proc_dointvec,
1202 .procname = "panic_on_warn",
1203 .data = &panic_on_warn,
1204 .maxlen = sizeof(int),
1206 .proc_handler = proc_dointvec_minmax,
1210 #if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ_COMMON)
1212 .procname = "timer_migration",
1213 .data = &sysctl_timer_migration,
1214 .maxlen = sizeof(unsigned int),
1216 .proc_handler = timer_migration_handler,
1221 #ifdef CONFIG_BPF_SYSCALL
1223 .procname = "unprivileged_bpf_disabled",
1224 .data = &sysctl_unprivileged_bpf_disabled,
1225 .maxlen = sizeof(sysctl_unprivileged_bpf_disabled),
1227 .proc_handler = bpf_unpriv_handler,
1232 #if defined(CONFIG_TREE_RCU) || defined(CONFIG_PREEMPT_RCU)
1234 .procname = "panic_on_rcu_stall",
1235 .data = &sysctl_panic_on_rcu_stall,
1236 .maxlen = sizeof(sysctl_panic_on_rcu_stall),
1238 .proc_handler = proc_dointvec_minmax,
1246 static struct ctl_table vm_table[] = {
1248 .procname = "overcommit_memory",
1249 .data = &sysctl_overcommit_memory,
1250 .maxlen = sizeof(sysctl_overcommit_memory),
1252 .proc_handler = proc_dointvec_minmax,
1257 .procname = "panic_on_oom",
1258 .data = &sysctl_panic_on_oom,
1259 .maxlen = sizeof(sysctl_panic_on_oom),
1261 .proc_handler = proc_dointvec_minmax,
1266 .procname = "oom_kill_allocating_task",
1267 .data = &sysctl_oom_kill_allocating_task,
1268 .maxlen = sizeof(sysctl_oom_kill_allocating_task),
1270 .proc_handler = proc_dointvec,
1273 .procname = "oom_dump_tasks",
1274 .data = &sysctl_oom_dump_tasks,
1275 .maxlen = sizeof(sysctl_oom_dump_tasks),
1277 .proc_handler = proc_dointvec,
1280 .procname = "overcommit_ratio",
1281 .data = &sysctl_overcommit_ratio,
1282 .maxlen = sizeof(sysctl_overcommit_ratio),
1284 .proc_handler = overcommit_ratio_handler,
1287 .procname = "overcommit_kbytes",
1288 .data = &sysctl_overcommit_kbytes,
1289 .maxlen = sizeof(sysctl_overcommit_kbytes),
1291 .proc_handler = overcommit_kbytes_handler,
1294 .procname = "page-cluster",
1295 .data = &page_cluster,
1296 .maxlen = sizeof(int),
1298 .proc_handler = proc_dointvec_minmax,
1302 .procname = "dirty_background_ratio",
1303 .data = &dirty_background_ratio,
1304 .maxlen = sizeof(dirty_background_ratio),
1306 .proc_handler = dirty_background_ratio_handler,
1308 .extra2 = &one_hundred,
1311 .procname = "dirty_background_bytes",
1312 .data = &dirty_background_bytes,
1313 .maxlen = sizeof(dirty_background_bytes),
1315 .proc_handler = dirty_background_bytes_handler,
1319 .procname = "dirty_ratio",
1320 .data = &vm_dirty_ratio,
1321 .maxlen = sizeof(vm_dirty_ratio),
1323 .proc_handler = dirty_ratio_handler,
1325 .extra2 = &one_hundred,
1328 .procname = "dirty_bytes",
1329 .data = &vm_dirty_bytes,
1330 .maxlen = sizeof(vm_dirty_bytes),
1332 .proc_handler = dirty_bytes_handler,
1333 .extra1 = &dirty_bytes_min,
1336 .procname = "dirty_writeback_centisecs",
1337 .data = &dirty_writeback_interval,
1338 .maxlen = sizeof(dirty_writeback_interval),
1340 .proc_handler = dirty_writeback_centisecs_handler,
1343 .procname = "dirty_expire_centisecs",
1344 .data = &dirty_expire_interval,
1345 .maxlen = sizeof(dirty_expire_interval),
1347 .proc_handler = proc_dointvec_minmax,
1351 .procname = "dirtytime_expire_seconds",
1352 .data = &dirtytime_expire_interval,
1353 .maxlen = sizeof(dirty_expire_interval),
1355 .proc_handler = dirtytime_interval_handler,
1359 .procname = "nr_pdflush_threads",
1360 .mode = 0444 /* read-only */,
1361 .proc_handler = pdflush_proc_obsolete,
1364 .procname = "swappiness",
1365 .data = &vm_swappiness,
1366 .maxlen = sizeof(vm_swappiness),
1368 .proc_handler = proc_dointvec_minmax,
1370 .extra2 = &one_hundred,
1372 #ifdef CONFIG_HUGETLB_PAGE
1374 .procname = "nr_hugepages",
1376 .maxlen = sizeof(unsigned long),
1378 .proc_handler = hugetlb_sysctl_handler,
1382 .procname = "nr_hugepages_mempolicy",
1384 .maxlen = sizeof(unsigned long),
1386 .proc_handler = &hugetlb_mempolicy_sysctl_handler,
1390 .procname = "hugetlb_shm_group",
1391 .data = &sysctl_hugetlb_shm_group,
1392 .maxlen = sizeof(gid_t),
1394 .proc_handler = proc_dointvec,
1397 .procname = "hugepages_treat_as_movable",
1398 .data = &hugepages_treat_as_movable,
1399 .maxlen = sizeof(int),
1401 .proc_handler = proc_dointvec,
1404 .procname = "nr_overcommit_hugepages",
1406 .maxlen = sizeof(unsigned long),
1408 .proc_handler = hugetlb_overcommit_handler,
1412 .procname = "lowmem_reserve_ratio",
1413 .data = &sysctl_lowmem_reserve_ratio,
1414 .maxlen = sizeof(sysctl_lowmem_reserve_ratio),
1416 .proc_handler = lowmem_reserve_ratio_sysctl_handler,
1419 .procname = "drop_caches",
1420 .data = &sysctl_drop_caches,
1421 .maxlen = sizeof(int),
1423 .proc_handler = drop_caches_sysctl_handler,
1427 #ifdef CONFIG_COMPACTION
1429 .procname = "compact_memory",
1430 .data = &sysctl_compact_memory,
1431 .maxlen = sizeof(int),
1433 .proc_handler = sysctl_compaction_handler,
1436 .procname = "extfrag_threshold",
1437 .data = &sysctl_extfrag_threshold,
1438 .maxlen = sizeof(int),
1440 .proc_handler = sysctl_extfrag_handler,
1441 .extra1 = &min_extfrag_threshold,
1442 .extra2 = &max_extfrag_threshold,
1445 .procname = "compact_unevictable_allowed",
1446 .data = &sysctl_compact_unevictable_allowed,
1447 .maxlen = sizeof(int),
1449 .proc_handler = proc_dointvec,
1454 #endif /* CONFIG_COMPACTION */
1456 .procname = "min_free_kbytes",
1457 .data = &min_free_kbytes,
1458 .maxlen = sizeof(min_free_kbytes),
1460 .proc_handler = min_free_kbytes_sysctl_handler,
1464 .procname = "watermark_scale_factor",
1465 .data = &watermark_scale_factor,
1466 .maxlen = sizeof(watermark_scale_factor),
1468 .proc_handler = watermark_scale_factor_sysctl_handler,
1470 .extra2 = &one_thousand,
1473 .procname = "percpu_pagelist_fraction",
1474 .data = &percpu_pagelist_fraction,
1475 .maxlen = sizeof(percpu_pagelist_fraction),
1477 .proc_handler = percpu_pagelist_fraction_sysctl_handler,
1482 .procname = "max_map_count",
1483 .data = &sysctl_max_map_count,
1484 .maxlen = sizeof(sysctl_max_map_count),
1486 .proc_handler = proc_dointvec_minmax,
1491 .procname = "nr_trim_pages",
1492 .data = &sysctl_nr_trim_pages,
1493 .maxlen = sizeof(sysctl_nr_trim_pages),
1495 .proc_handler = proc_dointvec_minmax,
1500 .procname = "laptop_mode",
1501 .data = &laptop_mode,
1502 .maxlen = sizeof(laptop_mode),
1504 .proc_handler = proc_dointvec_jiffies,
1507 .procname = "block_dump",
1508 .data = &block_dump,
1509 .maxlen = sizeof(block_dump),
1511 .proc_handler = proc_dointvec,
1515 .procname = "vfs_cache_pressure",
1516 .data = &sysctl_vfs_cache_pressure,
1517 .maxlen = sizeof(sysctl_vfs_cache_pressure),
1519 .proc_handler = proc_dointvec,
1522 #ifdef HAVE_ARCH_PICK_MMAP_LAYOUT
1524 .procname = "legacy_va_layout",
1525 .data = &sysctl_legacy_va_layout,
1526 .maxlen = sizeof(sysctl_legacy_va_layout),
1528 .proc_handler = proc_dointvec,
1534 .procname = "zone_reclaim_mode",
1535 .data = &node_reclaim_mode,
1536 .maxlen = sizeof(node_reclaim_mode),
1538 .proc_handler = proc_dointvec,
1542 .procname = "min_unmapped_ratio",
1543 .data = &sysctl_min_unmapped_ratio,
1544 .maxlen = sizeof(sysctl_min_unmapped_ratio),
1546 .proc_handler = sysctl_min_unmapped_ratio_sysctl_handler,
1548 .extra2 = &one_hundred,
1551 .procname = "min_slab_ratio",
1552 .data = &sysctl_min_slab_ratio,
1553 .maxlen = sizeof(sysctl_min_slab_ratio),
1555 .proc_handler = sysctl_min_slab_ratio_sysctl_handler,
1557 .extra2 = &one_hundred,
1562 .procname = "stat_interval",
1563 .data = &sysctl_stat_interval,
1564 .maxlen = sizeof(sysctl_stat_interval),
1566 .proc_handler = proc_dointvec_jiffies,
1569 .procname = "stat_refresh",
1573 .proc_handler = vmstat_refresh,
1578 .procname = "mmap_min_addr",
1579 .data = &dac_mmap_min_addr,
1580 .maxlen = sizeof(unsigned long),
1582 .proc_handler = mmap_min_addr_handler,
1587 .procname = "numa_zonelist_order",
1588 .data = &numa_zonelist_order,
1589 .maxlen = NUMA_ZONELIST_ORDER_LEN,
1591 .proc_handler = numa_zonelist_order_handler,
1594 #if (defined(CONFIG_X86_32) && !defined(CONFIG_UML))|| \
1595 (defined(CONFIG_SUPERH) && defined(CONFIG_VSYSCALL))
1597 .procname = "vdso_enabled",
1598 #ifdef CONFIG_X86_32
1599 .data = &vdso32_enabled,
1600 .maxlen = sizeof(vdso32_enabled),
1602 .data = &vdso_enabled,
1603 .maxlen = sizeof(vdso_enabled),
1606 .proc_handler = proc_dointvec,
1610 #ifdef CONFIG_HIGHMEM
1612 .procname = "highmem_is_dirtyable",
1613 .data = &vm_highmem_is_dirtyable,
1614 .maxlen = sizeof(vm_highmem_is_dirtyable),
1616 .proc_handler = proc_dointvec_minmax,
1621 #ifdef CONFIG_MEMORY_FAILURE
1623 .procname = "memory_failure_early_kill",
1624 .data = &sysctl_memory_failure_early_kill,
1625 .maxlen = sizeof(sysctl_memory_failure_early_kill),
1627 .proc_handler = proc_dointvec_minmax,
1632 .procname = "memory_failure_recovery",
1633 .data = &sysctl_memory_failure_recovery,
1634 .maxlen = sizeof(sysctl_memory_failure_recovery),
1636 .proc_handler = proc_dointvec_minmax,
1642 .procname = "user_reserve_kbytes",
1643 .data = &sysctl_user_reserve_kbytes,
1644 .maxlen = sizeof(sysctl_user_reserve_kbytes),
1646 .proc_handler = proc_doulongvec_minmax,
1649 .procname = "admin_reserve_kbytes",
1650 .data = &sysctl_admin_reserve_kbytes,
1651 .maxlen = sizeof(sysctl_admin_reserve_kbytes),
1653 .proc_handler = proc_doulongvec_minmax,
1655 #ifdef CONFIG_HAVE_ARCH_MMAP_RND_BITS
1657 .procname = "mmap_rnd_bits",
1658 .data = &mmap_rnd_bits,
1659 .maxlen = sizeof(mmap_rnd_bits),
1661 .proc_handler = proc_dointvec_minmax,
1662 .extra1 = (void *)&mmap_rnd_bits_min,
1663 .extra2 = (void *)&mmap_rnd_bits_max,
1666 #ifdef CONFIG_HAVE_ARCH_MMAP_RND_COMPAT_BITS
1668 .procname = "mmap_rnd_compat_bits",
1669 .data = &mmap_rnd_compat_bits,
1670 .maxlen = sizeof(mmap_rnd_compat_bits),
1672 .proc_handler = proc_dointvec_minmax,
1673 .extra1 = (void *)&mmap_rnd_compat_bits_min,
1674 .extra2 = (void *)&mmap_rnd_compat_bits_max,
1680 static struct ctl_table fs_table[] = {
1682 .procname = "inode-nr",
1683 .data = &inodes_stat,
1684 .maxlen = 2*sizeof(long),
1686 .proc_handler = proc_nr_inodes,
1689 .procname = "inode-state",
1690 .data = &inodes_stat,
1691 .maxlen = 7*sizeof(long),
1693 .proc_handler = proc_nr_inodes,
1696 .procname = "file-nr",
1697 .data = &files_stat,
1698 .maxlen = sizeof(files_stat),
1700 .proc_handler = proc_nr_files,
1703 .procname = "file-max",
1704 .data = &files_stat.max_files,
1705 .maxlen = sizeof(files_stat.max_files),
1707 .proc_handler = proc_doulongvec_minmax,
1709 .extra2 = &long_max,
1712 .procname = "nr_open",
1713 .data = &sysctl_nr_open,
1714 .maxlen = sizeof(unsigned int),
1716 .proc_handler = proc_dointvec_minmax,
1717 .extra1 = &sysctl_nr_open_min,
1718 .extra2 = &sysctl_nr_open_max,
1721 .procname = "dentry-state",
1722 .data = &dentry_stat,
1723 .maxlen = 6*sizeof(long),
1725 .proc_handler = proc_nr_dentry,
1728 .procname = "overflowuid",
1729 .data = &fs_overflowuid,
1730 .maxlen = sizeof(int),
1732 .proc_handler = proc_dointvec_minmax,
1733 .extra1 = &minolduid,
1734 .extra2 = &maxolduid,
1737 .procname = "overflowgid",
1738 .data = &fs_overflowgid,
1739 .maxlen = sizeof(int),
1741 .proc_handler = proc_dointvec_minmax,
1742 .extra1 = &minolduid,
1743 .extra2 = &maxolduid,
1745 #ifdef CONFIG_FILE_LOCKING
1747 .procname = "leases-enable",
1748 .data = &leases_enable,
1749 .maxlen = sizeof(int),
1751 .proc_handler = proc_dointvec,
1754 #ifdef CONFIG_DNOTIFY
1756 .procname = "dir-notify-enable",
1757 .data = &dir_notify_enable,
1758 .maxlen = sizeof(int),
1760 .proc_handler = proc_dointvec,
1764 #ifdef CONFIG_FILE_LOCKING
1766 .procname = "lease-break-time",
1767 .data = &lease_break_time,
1768 .maxlen = sizeof(int),
1770 .proc_handler = proc_dointvec,
1775 .procname = "aio-nr",
1777 .maxlen = sizeof(aio_nr),
1779 .proc_handler = proc_doulongvec_minmax,
1782 .procname = "aio-max-nr",
1783 .data = &aio_max_nr,
1784 .maxlen = sizeof(aio_max_nr),
1786 .proc_handler = proc_doulongvec_minmax,
1788 #endif /* CONFIG_AIO */
1789 #ifdef CONFIG_INOTIFY_USER
1791 .procname = "inotify",
1793 .child = inotify_table,
1798 .procname = "epoll",
1800 .child = epoll_table,
1805 .procname = "protected_symlinks",
1806 .data = &sysctl_protected_symlinks,
1807 .maxlen = sizeof(int),
1809 .proc_handler = proc_dointvec_minmax,
1814 .procname = "protected_hardlinks",
1815 .data = &sysctl_protected_hardlinks,
1816 .maxlen = sizeof(int),
1818 .proc_handler = proc_dointvec_minmax,
1823 .procname = "protected_fifos",
1824 .data = &sysctl_protected_fifos,
1825 .maxlen = sizeof(int),
1827 .proc_handler = proc_dointvec_minmax,
1832 .procname = "protected_regular",
1833 .data = &sysctl_protected_regular,
1834 .maxlen = sizeof(int),
1836 .proc_handler = proc_dointvec_minmax,
1841 .procname = "suid_dumpable",
1842 .data = &suid_dumpable,
1843 .maxlen = sizeof(int),
1845 .proc_handler = proc_dointvec_minmax_coredump,
1849 #if defined(CONFIG_BINFMT_MISC) || defined(CONFIG_BINFMT_MISC_MODULE)
1851 .procname = "binfmt_misc",
1853 .child = sysctl_mount_point,
1857 .procname = "pipe-max-size",
1858 .data = &pipe_max_size,
1859 .maxlen = sizeof(int),
1861 .proc_handler = &pipe_proc_fn,
1862 .extra1 = &pipe_min_size,
1865 .procname = "pipe-user-pages-hard",
1866 .data = &pipe_user_pages_hard,
1867 .maxlen = sizeof(pipe_user_pages_hard),
1869 .proc_handler = proc_doulongvec_minmax,
1872 .procname = "pipe-user-pages-soft",
1873 .data = &pipe_user_pages_soft,
1874 .maxlen = sizeof(pipe_user_pages_soft),
1876 .proc_handler = proc_doulongvec_minmax,
1879 .procname = "mount-max",
1880 .data = &sysctl_mount_max,
1881 .maxlen = sizeof(unsigned int),
1883 .proc_handler = proc_dointvec_minmax,
1889 static struct ctl_table debug_table[] = {
1890 #ifdef CONFIG_SYSCTL_EXCEPTION_TRACE
1892 .procname = "exception-trace",
1893 .data = &show_unhandled_signals,
1894 .maxlen = sizeof(int),
1896 .proc_handler = proc_dointvec
1899 #if defined(CONFIG_OPTPROBES)
1901 .procname = "kprobes-optimization",
1902 .data = &sysctl_kprobes_optimization,
1903 .maxlen = sizeof(int),
1905 .proc_handler = proc_kprobes_optimization_handler,
1913 static struct ctl_table dev_table[] = {
1917 int __init sysctl_init(void)
1919 struct ctl_table_header *hdr;
1921 hdr = register_sysctl_table(sysctl_base_table);
1922 kmemleak_not_leak(hdr);
1926 #endif /* CONFIG_SYSCTL */
1932 #ifdef CONFIG_PROC_SYSCTL
1934 static int _proc_do_string(char *data, int maxlen, int write,
1935 char __user *buffer,
1936 size_t *lenp, loff_t *ppos)
1942 if (!data || !maxlen || !*lenp) {
1948 if (sysctl_writes_strict == SYSCTL_WRITES_STRICT) {
1949 /* Only continue writes not past the end of buffer. */
1951 if (len > maxlen - 1)
1958 /* Start writing from beginning of buffer. */
1964 while ((p - buffer) < *lenp && len < maxlen - 1) {
1965 if (get_user(c, p++))
1967 if (c == 0 || c == '\n')
1988 if (copy_to_user(buffer, data, len))
1991 if (put_user('\n', buffer + len))
2001 static void warn_sysctl_write(struct ctl_table *table)
2003 pr_warn_once("%s wrote to %s when file position was not 0!\n"
2004 "This will not be supported in the future. To silence this\n"
2005 "warning, set kernel.sysctl_writes_strict = -1\n",
2006 current->comm, table->procname);
2010 * proc_dostring - read a string sysctl
2011 * @table: the sysctl table
2012 * @write: %TRUE if this is a write to the sysctl file
2013 * @buffer: the user buffer
2014 * @lenp: the size of the user buffer
2015 * @ppos: file position
2017 * Reads/writes a string from/to the user buffer. If the kernel
2018 * buffer provided is not large enough to hold the string, the
2019 * string is truncated. The copied string is %NULL-terminated.
2020 * If the string is being read by the user process, it is copied
2021 * and a newline '\n' is added. It is truncated if the buffer is
2024 * Returns 0 on success.
2026 int proc_dostring(struct ctl_table *table, int write,
2027 void __user *buffer, size_t *lenp, loff_t *ppos)
2029 if (write && *ppos && sysctl_writes_strict == SYSCTL_WRITES_WARN)
2030 warn_sysctl_write(table);
2032 return _proc_do_string((char *)(table->data), table->maxlen, write,
2033 (char __user *)buffer, lenp, ppos);
2036 static size_t proc_skip_spaces(char **buf)
2039 char *tmp = skip_spaces(*buf);
2045 static void proc_skip_char(char **buf, size_t *size, const char v)
2055 #define TMPBUFLEN 22
2057 * proc_get_long - reads an ASCII formatted integer from a user buffer
2059 * @buf: a kernel buffer
2060 * @size: size of the kernel buffer
2061 * @val: this is where the number will be stored
2062 * @neg: set to %TRUE if number is negative
2063 * @perm_tr: a vector which contains the allowed trailers
2064 * @perm_tr_len: size of the perm_tr vector
2065 * @tr: pointer to store the trailer character
2067 * In case of success %0 is returned and @buf and @size are updated with
2068 * the amount of bytes read. If @tr is non-NULL and a trailing
2069 * character exists (size is non-zero after returning from this
2070 * function), @tr is updated with the trailing character.
2072 static int proc_get_long(char **buf, size_t *size,
2073 unsigned long *val, bool *neg,
2074 const char *perm_tr, unsigned perm_tr_len, char *tr)
2077 char *p, tmp[TMPBUFLEN];
2083 if (len > TMPBUFLEN - 1)
2084 len = TMPBUFLEN - 1;
2086 memcpy(tmp, *buf, len);
2090 if (*p == '-' && *size > 1) {
2098 *val = simple_strtoul(p, &p, 0);
2102 /* We don't know if the next char is whitespace thus we may accept
2103 * invalid integers (e.g. 1234...a) or two integers instead of one
2104 * (e.g. 123...1). So lets not allow such large numbers. */
2105 if (len == TMPBUFLEN - 1)
2108 if (len < *size && perm_tr_len && !memchr(perm_tr, *p, perm_tr_len))
2111 if (tr && (len < *size))
2121 * proc_put_long - converts an integer to a decimal ASCII formatted string
2123 * @buf: the user buffer
2124 * @size: the size of the user buffer
2125 * @val: the integer to be converted
2126 * @neg: sign of the number, %TRUE for negative
2128 * In case of success %0 is returned and @buf and @size are updated with
2129 * the amount of bytes written.
2131 static int proc_put_long(void __user **buf, size_t *size, unsigned long val,
2135 char tmp[TMPBUFLEN], *p = tmp;
2137 sprintf(p, "%s%lu", neg ? "-" : "", val);
2141 if (copy_to_user(*buf, tmp, len))
2149 static int proc_put_char(void __user **buf, size_t *size, char c)
2152 char __user **buffer = (char __user **)buf;
2153 if (put_user(c, *buffer))
2155 (*size)--, (*buffer)++;
2161 static int do_proc_dointvec_conv(bool *negp, unsigned long *lvalp,
2163 int write, void *data)
2167 if (*lvalp > (unsigned long) INT_MAX + 1)
2171 if (*lvalp > (unsigned long) INT_MAX)
2179 *lvalp = -(unsigned long)val;
2182 *lvalp = (unsigned long)val;
2188 static int do_proc_douintvec_conv(bool *negp, unsigned long *lvalp,
2190 int write, void *data)
2195 if (*lvalp > UINT_MAX)
2199 unsigned int val = *valp;
2201 *lvalp = (unsigned long)val;
2206 static const char proc_wspace_sep[] = { ' ', '\t', '\n' };
2208 static int __do_proc_dointvec(void *tbl_data, struct ctl_table *table,
2209 int write, void __user *buffer,
2210 size_t *lenp, loff_t *ppos,
2211 int (*conv)(bool *negp, unsigned long *lvalp, int *valp,
2212 int write, void *data),
2215 int *i, vleft, first = 1, err = 0;
2217 char *kbuf = NULL, *p;
2219 if (!tbl_data || !table->maxlen || !*lenp || (*ppos && !write)) {
2224 i = (int *) tbl_data;
2225 vleft = table->maxlen / sizeof(*i);
2229 conv = do_proc_dointvec_conv;
2233 switch (sysctl_writes_strict) {
2234 case SYSCTL_WRITES_STRICT:
2236 case SYSCTL_WRITES_WARN:
2237 warn_sysctl_write(table);
2244 if (left > PAGE_SIZE - 1)
2245 left = PAGE_SIZE - 1;
2246 p = kbuf = memdup_user_nul(buffer, left);
2248 return PTR_ERR(kbuf);
2251 for (; left && vleft--; i++, first=0) {
2256 left -= proc_skip_spaces(&p);
2260 err = proc_get_long(&p, &left, &lval, &neg,
2262 sizeof(proc_wspace_sep), NULL);
2265 if (conv(&neg, &lval, i, 1, data)) {
2270 if (conv(&neg, &lval, i, 0, data)) {
2275 err = proc_put_char(&buffer, &left, '\t');
2278 err = proc_put_long(&buffer, &left, lval, neg);
2284 if (!write && !first && left && !err)
2285 err = proc_put_char(&buffer, &left, '\n');
2286 if (write && !err && left)
2287 left -= proc_skip_spaces(&p);
2291 return err ? : -EINVAL;
2299 static int do_proc_dointvec(struct ctl_table *table, int write,
2300 void __user *buffer, size_t *lenp, loff_t *ppos,
2301 int (*conv)(bool *negp, unsigned long *lvalp, int *valp,
2302 int write, void *data),
2305 return __do_proc_dointvec(table->data, table, write,
2306 buffer, lenp, ppos, conv, data);
2310 * proc_dointvec - read a vector of 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) integer
2318 * values from/to the user buffer, treated as an ASCII string.
2320 * Returns 0 on success.
2322 int proc_dointvec(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, NULL, NULL);
2329 * proc_douintvec - read a vector of unsigned integers
2330 * @table: the sysctl table
2331 * @write: %TRUE if this is a write to the sysctl file
2332 * @buffer: the user buffer
2333 * @lenp: the size of the user buffer
2334 * @ppos: file position
2336 * Reads/writes up to table->maxlen/sizeof(unsigned int) unsigned integer
2337 * values from/to the user buffer, treated as an ASCII string.
2339 * Returns 0 on success.
2341 int proc_douintvec(struct ctl_table *table, int write,
2342 void __user *buffer, size_t *lenp, loff_t *ppos)
2344 return do_proc_dointvec(table, write, buffer, lenp, ppos,
2345 do_proc_douintvec_conv, NULL);
2349 * Taint values can only be increased
2350 * This means we can safely use a temporary.
2352 static int proc_taint(struct ctl_table *table, int write,
2353 void __user *buffer, size_t *lenp, loff_t *ppos)
2356 unsigned long tmptaint = get_taint();
2359 if (write && !capable(CAP_SYS_ADMIN))
2364 err = proc_doulongvec_minmax(&t, write, buffer, lenp, ppos);
2370 * Poor man's atomic or. Not worth adding a primitive
2371 * to everyone's atomic.h for this
2374 for (i = 0; i < BITS_PER_LONG && tmptaint >> i; i++) {
2375 if ((tmptaint >> i) & 1)
2376 add_taint(i, LOCKDEP_STILL_OK);
2383 #ifdef CONFIG_PRINTK
2384 static int proc_dointvec_minmax_sysadmin(struct ctl_table *table, int write,
2385 void __user *buffer, size_t *lenp, loff_t *ppos)
2387 if (write && !capable(CAP_SYS_ADMIN))
2390 return proc_dointvec_minmax(table, write, buffer, lenp, ppos);
2394 struct do_proc_dointvec_minmax_conv_param {
2399 static int do_proc_dointvec_minmax_conv(bool *negp, unsigned long *lvalp,
2401 int write, void *data)
2403 struct do_proc_dointvec_minmax_conv_param *param = data;
2407 if (*lvalp > (unsigned long) INT_MAX + 1)
2411 if (*lvalp > (unsigned long) INT_MAX)
2415 if ((param->min && *param->min > val) ||
2416 (param->max && *param->max < val))
2423 *lvalp = -(unsigned long)val;
2426 *lvalp = (unsigned long)val;
2433 * proc_dointvec_minmax - read a vector of integers with min/max values
2434 * @table: the sysctl table
2435 * @write: %TRUE if this is a write to the sysctl file
2436 * @buffer: the user buffer
2437 * @lenp: the size of the user buffer
2438 * @ppos: file position
2440 * Reads/writes up to table->maxlen/sizeof(unsigned int) integer
2441 * values from/to the user buffer, treated as an ASCII string.
2443 * This routine will ensure the values are within the range specified by
2444 * table->extra1 (min) and table->extra2 (max).
2446 * Returns 0 on success.
2448 int proc_dointvec_minmax(struct ctl_table *table, int write,
2449 void __user *buffer, size_t *lenp, loff_t *ppos)
2451 struct do_proc_dointvec_minmax_conv_param param = {
2452 .min = (int *) table->extra1,
2453 .max = (int *) table->extra2,
2455 return do_proc_dointvec(table, write, buffer, lenp, ppos,
2456 do_proc_dointvec_minmax_conv, ¶m);
2459 static void validate_coredump_safety(void)
2461 #ifdef CONFIG_COREDUMP
2462 if (suid_dumpable == SUID_DUMP_ROOT &&
2463 core_pattern[0] != '/' && core_pattern[0] != '|') {
2464 printk(KERN_WARNING "Unsafe core_pattern used with "\
2465 "suid_dumpable=2. Pipe handler or fully qualified "\
2466 "core dump path required.\n");
2471 static int proc_dointvec_minmax_coredump(struct ctl_table *table, int write,
2472 void __user *buffer, size_t *lenp, loff_t *ppos)
2474 int error = proc_dointvec_minmax(table, write, buffer, lenp, ppos);
2476 validate_coredump_safety();
2480 #ifdef CONFIG_COREDUMP
2481 static int proc_dostring_coredump(struct ctl_table *table, int write,
2482 void __user *buffer, size_t *lenp, loff_t *ppos)
2484 int error = proc_dostring(table, write, buffer, lenp, ppos);
2486 validate_coredump_safety();
2491 static int __do_proc_doulongvec_minmax(void *data, struct ctl_table *table, int write,
2492 void __user *buffer,
2493 size_t *lenp, loff_t *ppos,
2494 unsigned long convmul,
2495 unsigned long convdiv)
2497 unsigned long *i, *min, *max;
2498 int vleft, first = 1, err = 0;
2500 char *kbuf = NULL, *p;
2502 if (!data || !table->maxlen || !*lenp || (*ppos && !write)) {
2507 i = (unsigned long *) data;
2508 min = (unsigned long *) table->extra1;
2509 max = (unsigned long *) table->extra2;
2510 vleft = table->maxlen / sizeof(unsigned long);
2515 switch (sysctl_writes_strict) {
2516 case SYSCTL_WRITES_STRICT:
2518 case SYSCTL_WRITES_WARN:
2519 warn_sysctl_write(table);
2526 if (left > PAGE_SIZE - 1)
2527 left = PAGE_SIZE - 1;
2528 p = kbuf = memdup_user_nul(buffer, left);
2530 return PTR_ERR(kbuf);
2533 for (; left && vleft--; i++, first = 0) {
2539 left -= proc_skip_spaces(&p);
2543 err = proc_get_long(&p, &left, &val, &neg,
2545 sizeof(proc_wspace_sep), NULL);
2550 val = convmul * val / convdiv;
2551 if ((min && val < *min) || (max && val > *max)) {
2557 val = convdiv * (*i) / convmul;
2559 err = proc_put_char(&buffer, &left, '\t');
2563 err = proc_put_long(&buffer, &left, val, false);
2569 if (!write && !first && left && !err)
2570 err = proc_put_char(&buffer, &left, '\n');
2572 left -= proc_skip_spaces(&p);
2576 return err ? : -EINVAL;
2584 static int do_proc_doulongvec_minmax(struct ctl_table *table, int write,
2585 void __user *buffer,
2586 size_t *lenp, loff_t *ppos,
2587 unsigned long convmul,
2588 unsigned long convdiv)
2590 return __do_proc_doulongvec_minmax(table->data, table, write,
2591 buffer, lenp, ppos, convmul, convdiv);
2595 * proc_doulongvec_minmax - read a vector of long integers with min/max values
2596 * @table: the sysctl table
2597 * @write: %TRUE if this is a write to the sysctl file
2598 * @buffer: the user buffer
2599 * @lenp: the size of the user buffer
2600 * @ppos: file position
2602 * Reads/writes up to table->maxlen/sizeof(unsigned long) unsigned long
2603 * values from/to the user buffer, treated as an ASCII string.
2605 * This routine will ensure the values are within the range specified by
2606 * table->extra1 (min) and table->extra2 (max).
2608 * Returns 0 on success.
2610 int proc_doulongvec_minmax(struct ctl_table *table, int write,
2611 void __user *buffer, size_t *lenp, loff_t *ppos)
2613 return do_proc_doulongvec_minmax(table, write, buffer, lenp, ppos, 1l, 1l);
2617 * proc_doulongvec_ms_jiffies_minmax - read a vector of millisecond values with min/max values
2618 * @table: the sysctl table
2619 * @write: %TRUE if this is a write to the sysctl file
2620 * @buffer: the user buffer
2621 * @lenp: the size of the user buffer
2622 * @ppos: file position
2624 * Reads/writes up to table->maxlen/sizeof(unsigned long) unsigned long
2625 * values from/to the user buffer, treated as an ASCII string. The values
2626 * are treated as milliseconds, and converted to jiffies when they are stored.
2628 * This routine will ensure the values are within the range specified by
2629 * table->extra1 (min) and table->extra2 (max).
2631 * Returns 0 on success.
2633 int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int write,
2634 void __user *buffer,
2635 size_t *lenp, loff_t *ppos)
2637 return do_proc_doulongvec_minmax(table, write, buffer,
2638 lenp, ppos, HZ, 1000l);
2642 static int do_proc_dointvec_jiffies_conv(bool *negp, unsigned long *lvalp,
2644 int write, void *data)
2647 if (*lvalp > LONG_MAX / HZ)
2649 *valp = *negp ? -(*lvalp*HZ) : (*lvalp*HZ);
2655 lval = -(unsigned long)val;
2658 lval = (unsigned long)val;
2665 static int do_proc_dointvec_userhz_jiffies_conv(bool *negp, unsigned long *lvalp,
2667 int write, void *data)
2670 if (USER_HZ < HZ && *lvalp > (LONG_MAX / HZ) * USER_HZ)
2672 *valp = clock_t_to_jiffies(*negp ? -*lvalp : *lvalp);
2678 lval = -(unsigned long)val;
2681 lval = (unsigned long)val;
2683 *lvalp = jiffies_to_clock_t(lval);
2688 static int do_proc_dointvec_ms_jiffies_conv(bool *negp, unsigned long *lvalp,
2690 int write, void *data)
2693 unsigned long jif = msecs_to_jiffies(*negp ? -*lvalp : *lvalp);
2703 lval = -(unsigned long)val;
2706 lval = (unsigned long)val;
2708 *lvalp = jiffies_to_msecs(lval);
2714 * proc_dointvec_jiffies - read a vector of integers as seconds
2715 * @table: the sysctl table
2716 * @write: %TRUE if this is a write to the sysctl file
2717 * @buffer: the user buffer
2718 * @lenp: the size of the user buffer
2719 * @ppos: file position
2721 * Reads/writes up to table->maxlen/sizeof(unsigned int) integer
2722 * values from/to the user buffer, treated as an ASCII string.
2723 * The values read are assumed to be in seconds, and are converted into
2726 * Returns 0 on success.
2728 int proc_dointvec_jiffies(struct ctl_table *table, int write,
2729 void __user *buffer, size_t *lenp, loff_t *ppos)
2731 return do_proc_dointvec(table,write,buffer,lenp,ppos,
2732 do_proc_dointvec_jiffies_conv,NULL);
2736 * proc_dointvec_userhz_jiffies - read a vector of integers as 1/USER_HZ seconds
2737 * @table: the sysctl table
2738 * @write: %TRUE if this is a write to the sysctl file
2739 * @buffer: the user buffer
2740 * @lenp: the size of the user buffer
2741 * @ppos: pointer to the file position
2743 * Reads/writes up to table->maxlen/sizeof(unsigned int) integer
2744 * values from/to the user buffer, treated as an ASCII string.
2745 * The values read are assumed to be in 1/USER_HZ seconds, and
2746 * are converted into jiffies.
2748 * Returns 0 on success.
2750 int proc_dointvec_userhz_jiffies(struct ctl_table *table, int write,
2751 void __user *buffer, size_t *lenp, loff_t *ppos)
2753 return do_proc_dointvec(table,write,buffer,lenp,ppos,
2754 do_proc_dointvec_userhz_jiffies_conv,NULL);
2758 * proc_dointvec_ms_jiffies - read a vector of integers as 1 milliseconds
2759 * @table: the sysctl table
2760 * @write: %TRUE if this is a write to the sysctl file
2761 * @buffer: the user buffer
2762 * @lenp: the size of the user buffer
2763 * @ppos: file position
2764 * @ppos: the current position in the file
2766 * Reads/writes up to table->maxlen/sizeof(unsigned int) integer
2767 * values from/to the user buffer, treated as an ASCII string.
2768 * The values read are assumed to be in 1/1000 seconds, and
2769 * are converted into jiffies.
2771 * Returns 0 on success.
2773 int proc_dointvec_ms_jiffies(struct ctl_table *table, int write,
2774 void __user *buffer, size_t *lenp, loff_t *ppos)
2776 return do_proc_dointvec(table, write, buffer, lenp, ppos,
2777 do_proc_dointvec_ms_jiffies_conv, NULL);
2780 static int proc_do_cad_pid(struct ctl_table *table, int write,
2781 void __user *buffer, size_t *lenp, loff_t *ppos)
2783 struct pid *new_pid;
2787 tmp = pid_vnr(cad_pid);
2789 r = __do_proc_dointvec(&tmp, table, write, buffer,
2790 lenp, ppos, NULL, NULL);
2794 new_pid = find_get_pid(tmp);
2798 put_pid(xchg(&cad_pid, new_pid));
2803 * proc_do_large_bitmap - read/write from/to a large bitmap
2804 * @table: the sysctl table
2805 * @write: %TRUE if this is a write to the sysctl file
2806 * @buffer: the user buffer
2807 * @lenp: the size of the user buffer
2808 * @ppos: file position
2810 * The bitmap is stored at table->data and the bitmap length (in bits)
2813 * We use a range comma separated format (e.g. 1,3-4,10-10) so that
2814 * large bitmaps may be represented in a compact manner. Writing into
2815 * the file will clear the bitmap then update it with the given input.
2817 * Returns 0 on success.
2819 int proc_do_large_bitmap(struct ctl_table *table, int write,
2820 void __user *buffer, size_t *lenp, loff_t *ppos)
2824 size_t left = *lenp;
2825 unsigned long bitmap_len = table->maxlen;
2826 unsigned long *bitmap = *(unsigned long **) table->data;
2827 unsigned long *tmp_bitmap = NULL;
2828 char tr_a[] = { '-', ',', '\n' }, tr_b[] = { ',', '\n', 0 }, c;
2830 if (!bitmap || !bitmap_len || !left || (*ppos && !write)) {
2838 if (left > PAGE_SIZE - 1)
2839 left = PAGE_SIZE - 1;
2841 p = kbuf = memdup_user_nul(buffer, left);
2843 return PTR_ERR(kbuf);
2845 tmp_bitmap = kzalloc(BITS_TO_LONGS(bitmap_len) * sizeof(unsigned long),
2851 proc_skip_char(&p, &left, '\n');
2852 while (!err && left) {
2853 unsigned long val_a, val_b;
2856 err = proc_get_long(&p, &left, &val_a, &neg, tr_a,
2860 if (val_a >= bitmap_len || neg) {
2872 err = proc_get_long(&p, &left, &val_b,
2873 &neg, tr_b, sizeof(tr_b),
2877 if (val_b >= bitmap_len || neg ||
2888 bitmap_set(tmp_bitmap, val_a, val_b - val_a + 1);
2890 proc_skip_char(&p, &left, '\n');
2894 unsigned long bit_a, bit_b = 0;
2897 bit_a = find_next_bit(bitmap, bitmap_len, bit_b);
2898 if (bit_a >= bitmap_len)
2900 bit_b = find_next_zero_bit(bitmap, bitmap_len,
2904 err = proc_put_char(&buffer, &left, ',');
2908 err = proc_put_long(&buffer, &left, bit_a, false);
2911 if (bit_a != bit_b) {
2912 err = proc_put_char(&buffer, &left, '-');
2915 err = proc_put_long(&buffer, &left, bit_b, false);
2923 err = proc_put_char(&buffer, &left, '\n');
2929 bitmap_or(bitmap, bitmap, tmp_bitmap, bitmap_len);
2931 bitmap_copy(bitmap, tmp_bitmap, bitmap_len);
2943 #else /* CONFIG_PROC_SYSCTL */
2945 int proc_dostring(struct ctl_table *table, int write,
2946 void __user *buffer, size_t *lenp, loff_t *ppos)
2951 int proc_dointvec(struct ctl_table *table, int write,
2952 void __user *buffer, size_t *lenp, loff_t *ppos)
2957 int proc_douintvec(struct ctl_table *table, int write,
2958 void __user *buffer, size_t *lenp, loff_t *ppos)
2963 int proc_dointvec_minmax(struct ctl_table *table, int write,
2964 void __user *buffer, size_t *lenp, loff_t *ppos)
2969 int proc_dointvec_jiffies(struct ctl_table *table, int write,
2970 void __user *buffer, size_t *lenp, loff_t *ppos)
2975 int proc_dointvec_userhz_jiffies(struct ctl_table *table, int write,
2976 void __user *buffer, size_t *lenp, loff_t *ppos)
2981 int proc_dointvec_ms_jiffies(struct ctl_table *table, int write,
2982 void __user *buffer, size_t *lenp, loff_t *ppos)
2987 int proc_doulongvec_minmax(struct ctl_table *table, int write,
2988 void __user *buffer, size_t *lenp, loff_t *ppos)
2993 int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int write,
2994 void __user *buffer,
2995 size_t *lenp, loff_t *ppos)
3001 #endif /* CONFIG_PROC_SYSCTL */
3004 * No sense putting this after each symbol definition, twice,
3005 * exception granted :-)
3007 EXPORT_SYMBOL(proc_dointvec);
3008 EXPORT_SYMBOL(proc_douintvec);
3009 EXPORT_SYMBOL(proc_dointvec_jiffies);
3010 EXPORT_SYMBOL(proc_dointvec_minmax);
3011 EXPORT_SYMBOL(proc_dointvec_userhz_jiffies);
3012 EXPORT_SYMBOL(proc_dointvec_ms_jiffies);
3013 EXPORT_SYMBOL(proc_dostring);
3014 EXPORT_SYMBOL(proc_doulongvec_minmax);
3015 EXPORT_SYMBOL(proc_doulongvec_ms_jiffies_minmax);