2 * sysctl.c: General linux system control interface
4 * Begun 24 March 1995, Stephen Tweedie
5 * Added /proc support, Dec 1995
6 * Added bdflush entry and intvec min/max checking, 2/23/96, Tom Dyas.
7 * Added hooks for /proc/sys/net (minor, minor patch), 96/4/1, Mike Shaver.
8 * Added kernel/java-{interpreter,appletviewer}, 96/5/10, Mike Shaver.
9 * Dynamic registration fixes, Stephen Tweedie.
10 * Added kswapd-interval, ctrl-alt-del, printk stuff, 1/8/97, Chris Horn.
11 * Made sysctl support optional via CONFIG_SYSCTL, 1/10/97, Chris
13 * Added proc_doulongvec_ms_jiffies_minmax, 09/08/99, Carlos H. Bauer.
14 * Added proc_doulongvec_minmax, 09/08/99, Carlos H. Bauer.
15 * Changed linked lists to use list.h instead of lists.h, 02/24/00, Bill
17 * The list_for_each() macro wasn't appropriate for the sysctl loop.
18 * Removed it and replaced it with older style, 03/23/00, Bill Wendling
21 #include <linux/module.h>
22 #include <linux/aio.h>
24 #include <linux/swap.h>
25 #include <linux/slab.h>
26 #include <linux/sysctl.h>
27 #include <linux/bitmap.h>
28 #include <linux/signal.h>
29 #include <linux/printk.h>
30 #include <linux/proc_fs.h>
31 #include <linux/security.h>
32 #include <linux/ctype.h>
33 #include <linux/kmemcheck.h>
34 #include <linux/kmemleak.h>
36 #include <linux/init.h>
37 #include <linux/kernel.h>
38 #include <linux/kobject.h>
39 #include <linux/net.h>
40 #include <linux/sysrq.h>
41 #include <linux/highuid.h>
42 #include <linux/writeback.h>
43 #include <linux/ratelimit.h>
44 #include <linux/compaction.h>
45 #include <linux/hugetlb.h>
46 #include <linux/initrd.h>
47 #include <linux/key.h>
48 #include <linux/times.h>
49 #include <linux/limits.h>
50 #include <linux/dcache.h>
51 #include <linux/dnotify.h>
52 #include <linux/syscalls.h>
53 #include <linux/vmstat.h>
54 #include <linux/nfs_fs.h>
55 #include <linux/acpi.h>
56 #include <linux/reboot.h>
57 #include <linux/ftrace.h>
58 #include <linux/perf_event.h>
59 #include <linux/kprobes.h>
60 #include <linux/pipe_fs_i.h>
61 #include <linux/oom.h>
62 #include <linux/kmod.h>
63 #include <linux/capability.h>
64 #include <linux/binfmts.h>
65 #include <linux/sched/sysctl.h>
66 #include <linux/kexec.h>
67 #include <linux/bpf.h>
69 #include <asm/uaccess.h>
70 #include <asm/processor.h>
74 #include <asm/stacktrace.h>
78 #include <asm/setup.h>
80 #ifdef CONFIG_BSD_PROCESS_ACCT
81 #include <linux/acct.h>
83 #ifdef CONFIG_RT_MUTEXES
84 #include <linux/rtmutex.h>
86 #if defined(CONFIG_PROVE_LOCKING) || defined(CONFIG_LOCK_STAT)
87 #include <linux/lockdep.h>
89 #ifdef CONFIG_CHR_DEV_SG
93 #ifdef CONFIG_LOCKUP_DETECTOR
94 #include <linux/nmi.h>
97 #if defined(CONFIG_SYSCTL)
99 /* External variables not in a header file. */
100 extern int suid_dumpable
;
101 #ifdef CONFIG_COREDUMP
102 extern int core_uses_pid
;
103 extern char core_pattern
[];
104 extern unsigned int core_pipe_limit
;
106 #ifdef CONFIG_USER_NS
107 extern int unprivileged_userns_clone
;
110 extern int pid_max_min
, pid_max_max
;
111 extern int percpu_pagelist_fraction
;
112 extern int compat_log
;
113 extern int latencytop_enabled
;
114 extern int sysctl_nr_open_min
, sysctl_nr_open_max
;
116 extern int sysctl_nr_trim_pages
;
119 /* Constants used for minimum and maximum */
120 #ifdef CONFIG_LOCKUP_DETECTOR
121 static int sixty
= 60;
124 static int __maybe_unused neg_one
= -1;
127 static int __maybe_unused one
= 1;
128 static int __maybe_unused two
= 2;
129 static int __maybe_unused four
= 4;
130 static unsigned long one_ul
= 1;
131 static int one_hundred
= 100;
133 static int ten_thousand
= 10000;
136 /* this is needed for the proc_doulongvec_minmax of vm_dirty_bytes */
137 static unsigned long dirty_bytes_min
= 2 * PAGE_SIZE
;
139 /* this is needed for the proc_dointvec_minmax for [fs_]overflow UID and GID */
140 static int maxolduid
= 65535;
141 static int minolduid
;
143 static int ngroups_max
= NGROUPS_MAX
;
144 static const int cap_last_cap
= CAP_LAST_CAP
;
146 /*this is needed for proc_doulongvec_minmax of sysctl_hung_task_timeout_secs */
147 #ifdef CONFIG_DETECT_HUNG_TASK
148 static unsigned long hung_task_timeout_max
= (LONG_MAX
/HZ
);
151 #ifdef CONFIG_INOTIFY_USER
152 #include <linux/inotify.h>
158 extern int pwrsw_enabled
;
161 #ifdef CONFIG_SYSCTL_ARCH_UNALIGN_ALLOW
162 extern int unaligned_enabled
;
166 extern int unaligned_dump_stack
;
169 #ifdef CONFIG_SYSCTL_ARCH_UNALIGN_NO_WARN
170 extern int no_unaligned_warning
;
173 #ifdef CONFIG_PROC_SYSCTL
175 #define SYSCTL_WRITES_LEGACY -1
176 #define SYSCTL_WRITES_WARN 0
177 #define SYSCTL_WRITES_STRICT 1
179 static int sysctl_writes_strict
= SYSCTL_WRITES_WARN
;
181 static int proc_do_cad_pid(struct ctl_table
*table
, int write
,
182 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
);
183 static int proc_taint(struct ctl_table
*table
, int write
,
184 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
);
188 static int proc_dointvec_minmax_sysadmin(struct ctl_table
*table
, int write
,
189 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
);
192 static int proc_dointvec_minmax_coredump(struct ctl_table
*table
, int write
,
193 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
);
194 #ifdef CONFIG_COREDUMP
195 static int proc_dostring_coredump(struct ctl_table
*table
, int write
,
196 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
);
199 #ifdef CONFIG_MAGIC_SYSRQ
200 /* Note: sysrq code uses it's own private copy */
201 static int __sysrq_enabled
= CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE
;
203 static int sysrq_sysctl_handler(struct ctl_table
*table
, int write
,
204 void __user
*buffer
, size_t *lenp
,
209 error
= proc_dointvec(table
, write
, buffer
, lenp
, ppos
);
214 sysrq_toggle_support(__sysrq_enabled
);
221 static struct ctl_table kern_table
[];
222 static struct ctl_table vm_table
[];
223 static struct ctl_table fs_table
[];
224 static struct ctl_table debug_table
[];
225 static struct ctl_table dev_table
[];
226 extern struct ctl_table random_table
[];
228 extern struct ctl_table epoll_table
[];
231 #ifdef HAVE_ARCH_PICK_MMAP_LAYOUT
232 int sysctl_legacy_va_layout
;
235 /* The default sysctl tables: */
237 static struct ctl_table sysctl_base_table
[] = {
239 .procname
= "kernel",
256 .child
= debug_table
,
266 #ifdef CONFIG_SCHED_DEBUG
267 static int min_sched_granularity_ns
= 100000; /* 100 usecs */
268 static int max_sched_granularity_ns
= NSEC_PER_SEC
; /* 1 second */
269 static int min_wakeup_granularity_ns
; /* 0 usecs */
270 static int max_wakeup_granularity_ns
= NSEC_PER_SEC
; /* 1 second */
272 static int min_sched_tunable_scaling
= SCHED_TUNABLESCALING_NONE
;
273 static int max_sched_tunable_scaling
= SCHED_TUNABLESCALING_END
-1;
274 #endif /* CONFIG_SMP */
275 #endif /* CONFIG_SCHED_DEBUG */
277 #ifdef CONFIG_COMPACTION
278 static int min_extfrag_threshold
;
279 static int max_extfrag_threshold
= 1000;
282 static struct ctl_table kern_table
[] = {
284 .procname
= "sched_child_runs_first",
285 .data
= &sysctl_sched_child_runs_first
,
286 .maxlen
= sizeof(unsigned int),
288 .proc_handler
= proc_dointvec
,
290 #ifdef CONFIG_SCHED_DEBUG
292 .procname
= "sched_min_granularity_ns",
293 .data
= &sysctl_sched_min_granularity
,
294 .maxlen
= sizeof(unsigned int),
296 .proc_handler
= sched_proc_update_handler
,
297 .extra1
= &min_sched_granularity_ns
,
298 .extra2
= &max_sched_granularity_ns
,
301 .procname
= "sched_latency_ns",
302 .data
= &sysctl_sched_latency
,
303 .maxlen
= sizeof(unsigned int),
305 .proc_handler
= sched_proc_update_handler
,
306 .extra1
= &min_sched_granularity_ns
,
307 .extra2
= &max_sched_granularity_ns
,
310 .procname
= "sched_wakeup_granularity_ns",
311 .data
= &sysctl_sched_wakeup_granularity
,
312 .maxlen
= sizeof(unsigned int),
314 .proc_handler
= sched_proc_update_handler
,
315 .extra1
= &min_wakeup_granularity_ns
,
316 .extra2
= &max_wakeup_granularity_ns
,
320 .procname
= "sched_tunable_scaling",
321 .data
= &sysctl_sched_tunable_scaling
,
322 .maxlen
= sizeof(enum sched_tunable_scaling
),
324 .proc_handler
= sched_proc_update_handler
,
325 .extra1
= &min_sched_tunable_scaling
,
326 .extra2
= &max_sched_tunable_scaling
,
329 .procname
= "sched_migration_cost_ns",
330 .data
= &sysctl_sched_migration_cost
,
331 .maxlen
= sizeof(unsigned int),
333 .proc_handler
= proc_dointvec
,
336 .procname
= "sched_nr_migrate",
337 .data
= &sysctl_sched_nr_migrate
,
338 .maxlen
= sizeof(unsigned int),
340 .proc_handler
= proc_dointvec
,
343 .procname
= "sched_time_avg_ms",
344 .data
= &sysctl_sched_time_avg
,
345 .maxlen
= sizeof(unsigned int),
347 .proc_handler
= proc_dointvec
,
350 .procname
= "sched_shares_window_ns",
351 .data
= &sysctl_sched_shares_window
,
352 .maxlen
= sizeof(unsigned int),
354 .proc_handler
= proc_dointvec
,
356 #endif /* CONFIG_SMP */
357 #ifdef CONFIG_NUMA_BALANCING
359 .procname
= "numa_balancing_scan_delay_ms",
360 .data
= &sysctl_numa_balancing_scan_delay
,
361 .maxlen
= sizeof(unsigned int),
363 .proc_handler
= proc_dointvec
,
366 .procname
= "numa_balancing_scan_period_min_ms",
367 .data
= &sysctl_numa_balancing_scan_period_min
,
368 .maxlen
= sizeof(unsigned int),
370 .proc_handler
= proc_dointvec
,
373 .procname
= "numa_balancing_scan_period_max_ms",
374 .data
= &sysctl_numa_balancing_scan_period_max
,
375 .maxlen
= sizeof(unsigned int),
377 .proc_handler
= proc_dointvec
,
380 .procname
= "numa_balancing_scan_size_mb",
381 .data
= &sysctl_numa_balancing_scan_size
,
382 .maxlen
= sizeof(unsigned int),
384 .proc_handler
= proc_dointvec_minmax
,
388 .procname
= "numa_balancing",
389 .data
= NULL
, /* filled in by handler */
390 .maxlen
= sizeof(unsigned int),
392 .proc_handler
= sysctl_numa_balancing
,
396 #endif /* CONFIG_NUMA_BALANCING */
397 #endif /* CONFIG_SCHED_DEBUG */
399 .procname
= "sched_rt_period_us",
400 .data
= &sysctl_sched_rt_period
,
401 .maxlen
= sizeof(unsigned int),
403 .proc_handler
= sched_rt_handler
,
406 .procname
= "sched_rt_runtime_us",
407 .data
= &sysctl_sched_rt_runtime
,
408 .maxlen
= sizeof(int),
410 .proc_handler
= sched_rt_handler
,
413 .procname
= "sched_rr_timeslice_ms",
414 .data
= &sched_rr_timeslice
,
415 .maxlen
= sizeof(int),
417 .proc_handler
= sched_rr_handler
,
419 #ifdef CONFIG_SCHED_AUTOGROUP
421 .procname
= "sched_autogroup_enabled",
422 .data
= &sysctl_sched_autogroup_enabled
,
423 .maxlen
= sizeof(unsigned int),
425 .proc_handler
= proc_dointvec_minmax
,
430 #ifdef CONFIG_CFS_BANDWIDTH
432 .procname
= "sched_cfs_bandwidth_slice_us",
433 .data
= &sysctl_sched_cfs_bandwidth_slice
,
434 .maxlen
= sizeof(unsigned int),
436 .proc_handler
= proc_dointvec_minmax
,
440 #ifdef CONFIG_PROVE_LOCKING
442 .procname
= "prove_locking",
443 .data
= &prove_locking
,
444 .maxlen
= sizeof(int),
446 .proc_handler
= proc_dointvec
,
449 #ifdef CONFIG_LOCK_STAT
451 .procname
= "lock_stat",
453 .maxlen
= sizeof(int),
455 .proc_handler
= proc_dointvec
,
460 .data
= &panic_timeout
,
461 .maxlen
= sizeof(int),
463 .proc_handler
= proc_dointvec
,
465 #ifdef CONFIG_COREDUMP
467 .procname
= "core_uses_pid",
468 .data
= &core_uses_pid
,
469 .maxlen
= sizeof(int),
471 .proc_handler
= proc_dointvec
,
474 .procname
= "core_pattern",
475 .data
= core_pattern
,
476 .maxlen
= CORENAME_MAX_SIZE
,
478 .proc_handler
= proc_dostring_coredump
,
481 .procname
= "core_pipe_limit",
482 .data
= &core_pipe_limit
,
483 .maxlen
= sizeof(unsigned int),
485 .proc_handler
= proc_dointvec
,
488 #ifdef CONFIG_USER_NS
490 .procname
= "unprivileged_userns_clone",
491 .data
= &unprivileged_userns_clone
,
492 .maxlen
= sizeof(int),
494 .proc_handler
= proc_dointvec
,
497 #ifdef CONFIG_PROC_SYSCTL
499 .procname
= "tainted",
500 .maxlen
= sizeof(long),
502 .proc_handler
= proc_taint
,
505 .procname
= "sysctl_writes_strict",
506 .data
= &sysctl_writes_strict
,
507 .maxlen
= sizeof(int),
509 .proc_handler
= proc_dointvec_minmax
,
514 #ifdef CONFIG_LATENCYTOP
516 .procname
= "latencytop",
517 .data
= &latencytop_enabled
,
518 .maxlen
= sizeof(int),
520 .proc_handler
= proc_dointvec
,
523 #ifdef CONFIG_BLK_DEV_INITRD
525 .procname
= "real-root-dev",
526 .data
= &real_root_dev
,
527 .maxlen
= sizeof(int),
529 .proc_handler
= proc_dointvec
,
533 .procname
= "print-fatal-signals",
534 .data
= &print_fatal_signals
,
535 .maxlen
= sizeof(int),
537 .proc_handler
= proc_dointvec
,
541 .procname
= "reboot-cmd",
542 .data
= reboot_command
,
545 .proc_handler
= proc_dostring
,
548 .procname
= "stop-a",
549 .data
= &stop_a_enabled
,
550 .maxlen
= sizeof (int),
552 .proc_handler
= proc_dointvec
,
555 .procname
= "scons-poweroff",
556 .data
= &scons_pwroff
,
557 .maxlen
= sizeof (int),
559 .proc_handler
= proc_dointvec
,
562 #ifdef CONFIG_SPARC64
564 .procname
= "tsb-ratio",
565 .data
= &sysctl_tsb_ratio
,
566 .maxlen
= sizeof (int),
568 .proc_handler
= proc_dointvec
,
573 .procname
= "soft-power",
574 .data
= &pwrsw_enabled
,
575 .maxlen
= sizeof (int),
577 .proc_handler
= proc_dointvec
,
580 #ifdef CONFIG_SYSCTL_ARCH_UNALIGN_ALLOW
582 .procname
= "unaligned-trap",
583 .data
= &unaligned_enabled
,
584 .maxlen
= sizeof (int),
586 .proc_handler
= proc_dointvec
,
590 .procname
= "ctrl-alt-del",
592 .maxlen
= sizeof(int),
594 .proc_handler
= proc_dointvec
,
596 #ifdef CONFIG_FUNCTION_TRACER
598 .procname
= "ftrace_enabled",
599 .data
= &ftrace_enabled
,
600 .maxlen
= sizeof(int),
602 .proc_handler
= ftrace_enable_sysctl
,
605 #ifdef CONFIG_STACK_TRACER
607 .procname
= "stack_tracer_enabled",
608 .data
= &stack_tracer_enabled
,
609 .maxlen
= sizeof(int),
611 .proc_handler
= stack_trace_sysctl
,
614 #ifdef CONFIG_TRACING
616 .procname
= "ftrace_dump_on_oops",
617 .data
= &ftrace_dump_on_oops
,
618 .maxlen
= sizeof(int),
620 .proc_handler
= proc_dointvec
,
623 .procname
= "traceoff_on_warning",
624 .data
= &__disable_trace_on_warning
,
625 .maxlen
= sizeof(__disable_trace_on_warning
),
627 .proc_handler
= proc_dointvec
,
630 .procname
= "tracepoint_printk",
631 .data
= &tracepoint_printk
,
632 .maxlen
= sizeof(tracepoint_printk
),
634 .proc_handler
= proc_dointvec
,
637 #ifdef CONFIG_KEXEC_CORE
639 .procname
= "kexec_load_disabled",
640 .data
= &kexec_load_disabled
,
641 .maxlen
= sizeof(int),
643 /* only handle a transition from default "0" to "1" */
644 .proc_handler
= proc_dointvec_minmax
,
649 #ifdef CONFIG_MODULES
651 .procname
= "modprobe",
652 .data
= &modprobe_path
,
653 .maxlen
= KMOD_PATH_LEN
,
655 .proc_handler
= proc_dostring
,
658 .procname
= "modules_disabled",
659 .data
= &modules_disabled
,
660 .maxlen
= sizeof(int),
662 /* only handle a transition from default "0" to "1" */
663 .proc_handler
= proc_dointvec_minmax
,
668 #ifdef CONFIG_UEVENT_HELPER
670 .procname
= "hotplug",
671 .data
= &uevent_helper
,
672 .maxlen
= UEVENT_HELPER_PATH_LEN
,
674 .proc_handler
= proc_dostring
,
677 #ifdef CONFIG_CHR_DEV_SG
679 .procname
= "sg-big-buff",
680 .data
= &sg_big_buff
,
681 .maxlen
= sizeof (int),
683 .proc_handler
= proc_dointvec
,
686 #ifdef CONFIG_BSD_PROCESS_ACCT
690 .maxlen
= 3*sizeof(int),
692 .proc_handler
= proc_dointvec
,
695 #ifdef CONFIG_MAGIC_SYSRQ
698 .data
= &__sysrq_enabled
,
699 .maxlen
= sizeof (int),
701 .proc_handler
= sysrq_sysctl_handler
,
704 #ifdef CONFIG_PROC_SYSCTL
706 .procname
= "cad_pid",
708 .maxlen
= sizeof (int),
710 .proc_handler
= proc_do_cad_pid
,
714 .procname
= "threads-max",
716 .maxlen
= sizeof(int),
718 .proc_handler
= sysctl_max_threads
,
721 .procname
= "random",
723 .child
= random_table
,
726 .procname
= "usermodehelper",
728 .child
= usermodehelper_table
,
731 .procname
= "overflowuid",
732 .data
= &overflowuid
,
733 .maxlen
= sizeof(int),
735 .proc_handler
= proc_dointvec_minmax
,
736 .extra1
= &minolduid
,
737 .extra2
= &maxolduid
,
740 .procname
= "overflowgid",
741 .data
= &overflowgid
,
742 .maxlen
= sizeof(int),
744 .proc_handler
= proc_dointvec_minmax
,
745 .extra1
= &minolduid
,
746 .extra2
= &maxolduid
,
749 #ifdef CONFIG_MATHEMU
751 .procname
= "ieee_emulation_warnings",
752 .data
= &sysctl_ieee_emulation_warnings
,
753 .maxlen
= sizeof(int),
755 .proc_handler
= proc_dointvec
,
759 .procname
= "userprocess_debug",
760 .data
= &show_unhandled_signals
,
761 .maxlen
= sizeof(int),
763 .proc_handler
= proc_dointvec
,
767 .procname
= "pid_max",
769 .maxlen
= sizeof (int),
771 .proc_handler
= proc_dointvec_minmax
,
772 .extra1
= &pid_max_min
,
773 .extra2
= &pid_max_max
,
776 .procname
= "panic_on_oops",
777 .data
= &panic_on_oops
,
778 .maxlen
= sizeof(int),
780 .proc_handler
= proc_dointvec
,
782 #if defined CONFIG_PRINTK
784 .procname
= "printk",
785 .data
= &console_loglevel
,
786 .maxlen
= 4*sizeof(int),
788 .proc_handler
= proc_dointvec
,
791 .procname
= "printk_ratelimit",
792 .data
= &printk_ratelimit_state
.interval
,
793 .maxlen
= sizeof(int),
795 .proc_handler
= proc_dointvec_jiffies
,
798 .procname
= "printk_ratelimit_burst",
799 .data
= &printk_ratelimit_state
.burst
,
800 .maxlen
= sizeof(int),
802 .proc_handler
= proc_dointvec
,
805 .procname
= "printk_delay",
806 .data
= &printk_delay_msec
,
807 .maxlen
= sizeof(int),
809 .proc_handler
= proc_dointvec_minmax
,
811 .extra2
= &ten_thousand
,
814 .procname
= "dmesg_restrict",
815 .data
= &dmesg_restrict
,
816 .maxlen
= sizeof(int),
818 .proc_handler
= proc_dointvec_minmax_sysadmin
,
823 .procname
= "kptr_restrict",
824 .data
= &kptr_restrict
,
825 .maxlen
= sizeof(int),
827 .proc_handler
= proc_dointvec_minmax_sysadmin
,
833 .procname
= "ngroups_max",
834 .data
= &ngroups_max
,
835 .maxlen
= sizeof (int),
837 .proc_handler
= proc_dointvec
,
840 .procname
= "cap_last_cap",
841 .data
= (void *)&cap_last_cap
,
842 .maxlen
= sizeof(int),
844 .proc_handler
= proc_dointvec
,
846 #if defined(CONFIG_LOCKUP_DETECTOR)
848 .procname
= "watchdog",
849 .data
= &watchdog_user_enabled
,
850 .maxlen
= sizeof (int),
852 .proc_handler
= proc_watchdog
,
857 .procname
= "watchdog_thresh",
858 .data
= &watchdog_thresh
,
859 .maxlen
= sizeof(int),
861 .proc_handler
= proc_watchdog_thresh
,
866 .procname
= "nmi_watchdog",
867 .data
= &nmi_watchdog_enabled
,
868 .maxlen
= sizeof (int),
870 .proc_handler
= proc_nmi_watchdog
,
872 #if defined(CONFIG_HAVE_NMI_WATCHDOG) || defined(CONFIG_HARDLOCKUP_DETECTOR)
879 .procname
= "soft_watchdog",
880 .data
= &soft_watchdog_enabled
,
881 .maxlen
= sizeof (int),
883 .proc_handler
= proc_soft_watchdog
,
888 .procname
= "watchdog_cpumask",
889 .data
= &watchdog_cpumask_bits
,
892 .proc_handler
= proc_watchdog_cpumask
,
895 .procname
= "softlockup_panic",
896 .data
= &softlockup_panic
,
897 .maxlen
= sizeof(int),
899 .proc_handler
= proc_dointvec_minmax
,
903 #ifdef CONFIG_HARDLOCKUP_DETECTOR
905 .procname
= "hardlockup_panic",
906 .data
= &hardlockup_panic
,
907 .maxlen
= sizeof(int),
909 .proc_handler
= proc_dointvec_minmax
,
916 .procname
= "softlockup_all_cpu_backtrace",
917 .data
= &sysctl_softlockup_all_cpu_backtrace
,
918 .maxlen
= sizeof(int),
920 .proc_handler
= proc_dointvec_minmax
,
925 .procname
= "hardlockup_all_cpu_backtrace",
926 .data
= &sysctl_hardlockup_all_cpu_backtrace
,
927 .maxlen
= sizeof(int),
929 .proc_handler
= proc_dointvec_minmax
,
933 #endif /* CONFIG_SMP */
935 #if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86)
937 .procname
= "unknown_nmi_panic",
938 .data
= &unknown_nmi_panic
,
939 .maxlen
= sizeof (int),
941 .proc_handler
= proc_dointvec
,
944 #if defined(CONFIG_X86)
946 .procname
= "panic_on_unrecovered_nmi",
947 .data
= &panic_on_unrecovered_nmi
,
948 .maxlen
= sizeof(int),
950 .proc_handler
= proc_dointvec
,
953 .procname
= "panic_on_io_nmi",
954 .data
= &panic_on_io_nmi
,
955 .maxlen
= sizeof(int),
957 .proc_handler
= proc_dointvec
,
959 #ifdef CONFIG_DEBUG_STACKOVERFLOW
961 .procname
= "panic_on_stackoverflow",
962 .data
= &sysctl_panic_on_stackoverflow
,
963 .maxlen
= sizeof(int),
965 .proc_handler
= proc_dointvec
,
969 .procname
= "bootloader_type",
970 .data
= &bootloader_type
,
971 .maxlen
= sizeof (int),
973 .proc_handler
= proc_dointvec
,
976 .procname
= "bootloader_version",
977 .data
= &bootloader_version
,
978 .maxlen
= sizeof (int),
980 .proc_handler
= proc_dointvec
,
983 .procname
= "kstack_depth_to_print",
984 .data
= &kstack_depth_to_print
,
985 .maxlen
= sizeof(int),
987 .proc_handler
= proc_dointvec
,
990 .procname
= "io_delay_type",
991 .data
= &io_delay_type
,
992 .maxlen
= sizeof(int),
994 .proc_handler
= proc_dointvec
,
997 #if defined(CONFIG_MMU)
999 .procname
= "randomize_va_space",
1000 .data
= &randomize_va_space
,
1001 .maxlen
= sizeof(int),
1003 .proc_handler
= proc_dointvec
,
1006 #if defined(CONFIG_S390) && defined(CONFIG_SMP)
1008 .procname
= "spin_retry",
1009 .data
= &spin_retry
,
1010 .maxlen
= sizeof (int),
1012 .proc_handler
= proc_dointvec
,
1015 #if defined(CONFIG_ACPI_SLEEP) && defined(CONFIG_X86)
1017 .procname
= "acpi_video_flags",
1018 .data
= &acpi_realmode_flags
,
1019 .maxlen
= sizeof (unsigned long),
1021 .proc_handler
= proc_doulongvec_minmax
,
1024 #ifdef CONFIG_SYSCTL_ARCH_UNALIGN_NO_WARN
1026 .procname
= "ignore-unaligned-usertrap",
1027 .data
= &no_unaligned_warning
,
1028 .maxlen
= sizeof (int),
1030 .proc_handler
= proc_dointvec
,
1035 .procname
= "unaligned-dump-stack",
1036 .data
= &unaligned_dump_stack
,
1037 .maxlen
= sizeof (int),
1039 .proc_handler
= proc_dointvec
,
1042 #ifdef CONFIG_DETECT_HUNG_TASK
1044 .procname
= "hung_task_panic",
1045 .data
= &sysctl_hung_task_panic
,
1046 .maxlen
= sizeof(int),
1048 .proc_handler
= proc_dointvec_minmax
,
1053 .procname
= "hung_task_check_count",
1054 .data
= &sysctl_hung_task_check_count
,
1055 .maxlen
= sizeof(int),
1057 .proc_handler
= proc_dointvec_minmax
,
1061 .procname
= "hung_task_timeout_secs",
1062 .data
= &sysctl_hung_task_timeout_secs
,
1063 .maxlen
= sizeof(unsigned long),
1065 .proc_handler
= proc_dohung_task_timeout_secs
,
1066 .extra2
= &hung_task_timeout_max
,
1069 .procname
= "hung_task_warnings",
1070 .data
= &sysctl_hung_task_warnings
,
1071 .maxlen
= sizeof(int),
1073 .proc_handler
= proc_dointvec_minmax
,
1077 #ifdef CONFIG_COMPAT
1079 .procname
= "compat-log",
1080 .data
= &compat_log
,
1081 .maxlen
= sizeof (int),
1083 .proc_handler
= proc_dointvec
,
1086 #ifdef CONFIG_RT_MUTEXES
1088 .procname
= "max_lock_depth",
1089 .data
= &max_lock_depth
,
1090 .maxlen
= sizeof(int),
1092 .proc_handler
= proc_dointvec
,
1096 .procname
= "poweroff_cmd",
1097 .data
= &poweroff_cmd
,
1098 .maxlen
= POWEROFF_CMD_PATH_LEN
,
1100 .proc_handler
= proc_dostring
,
1106 .child
= key_sysctls
,
1109 #ifdef CONFIG_PERF_EVENTS
1111 * User-space scripts rely on the existence of this file
1112 * as a feature check for perf_events being enabled.
1114 * So it's an ABI, do not remove!
1117 .procname
= "perf_event_paranoid",
1118 .data
= &sysctl_perf_event_paranoid
,
1119 .maxlen
= sizeof(sysctl_perf_event_paranoid
),
1121 .proc_handler
= proc_dointvec
,
1124 .procname
= "perf_event_mlock_kb",
1125 .data
= &sysctl_perf_event_mlock
,
1126 .maxlen
= sizeof(sysctl_perf_event_mlock
),
1128 .proc_handler
= proc_dointvec
,
1131 .procname
= "perf_event_max_sample_rate",
1132 .data
= &sysctl_perf_event_sample_rate
,
1133 .maxlen
= sizeof(sysctl_perf_event_sample_rate
),
1135 .proc_handler
= perf_proc_update_handler
,
1139 .procname
= "perf_cpu_time_max_percent",
1140 .data
= &sysctl_perf_cpu_time_max_percent
,
1141 .maxlen
= sizeof(sysctl_perf_cpu_time_max_percent
),
1143 .proc_handler
= perf_cpu_time_max_percent_handler
,
1145 .extra2
= &one_hundred
,
1148 #ifdef CONFIG_KMEMCHECK
1150 .procname
= "kmemcheck",
1151 .data
= &kmemcheck_enabled
,
1152 .maxlen
= sizeof(int),
1154 .proc_handler
= proc_dointvec
,
1158 .procname
= "panic_on_warn",
1159 .data
= &panic_on_warn
,
1160 .maxlen
= sizeof(int),
1162 .proc_handler
= proc_dointvec_minmax
,
1166 #if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ_COMMON)
1168 .procname
= "timer_migration",
1169 .data
= &sysctl_timer_migration
,
1170 .maxlen
= sizeof(unsigned int),
1172 .proc_handler
= timer_migration_handler
,
1175 #ifdef CONFIG_BPF_SYSCALL
1177 .procname
= "unprivileged_bpf_disabled",
1178 .data
= &sysctl_unprivileged_bpf_disabled
,
1179 .maxlen
= sizeof(sysctl_unprivileged_bpf_disabled
),
1181 /* only handle a transition from default "0" to "1" */
1182 .proc_handler
= proc_dointvec_minmax
,
1190 static struct ctl_table vm_table
[] = {
1192 .procname
= "overcommit_memory",
1193 .data
= &sysctl_overcommit_memory
,
1194 .maxlen
= sizeof(sysctl_overcommit_memory
),
1196 .proc_handler
= proc_dointvec_minmax
,
1201 .procname
= "panic_on_oom",
1202 .data
= &sysctl_panic_on_oom
,
1203 .maxlen
= sizeof(sysctl_panic_on_oom
),
1205 .proc_handler
= proc_dointvec_minmax
,
1210 .procname
= "oom_kill_allocating_task",
1211 .data
= &sysctl_oom_kill_allocating_task
,
1212 .maxlen
= sizeof(sysctl_oom_kill_allocating_task
),
1214 .proc_handler
= proc_dointvec
,
1217 .procname
= "oom_dump_tasks",
1218 .data
= &sysctl_oom_dump_tasks
,
1219 .maxlen
= sizeof(sysctl_oom_dump_tasks
),
1221 .proc_handler
= proc_dointvec
,
1224 .procname
= "overcommit_ratio",
1225 .data
= &sysctl_overcommit_ratio
,
1226 .maxlen
= sizeof(sysctl_overcommit_ratio
),
1228 .proc_handler
= overcommit_ratio_handler
,
1231 .procname
= "overcommit_kbytes",
1232 .data
= &sysctl_overcommit_kbytes
,
1233 .maxlen
= sizeof(sysctl_overcommit_kbytes
),
1235 .proc_handler
= overcommit_kbytes_handler
,
1238 .procname
= "page-cluster",
1239 .data
= &page_cluster
,
1240 .maxlen
= sizeof(int),
1242 .proc_handler
= proc_dointvec_minmax
,
1246 .procname
= "dirty_background_ratio",
1247 .data
= &dirty_background_ratio
,
1248 .maxlen
= sizeof(dirty_background_ratio
),
1250 .proc_handler
= dirty_background_ratio_handler
,
1252 .extra2
= &one_hundred
,
1255 .procname
= "dirty_background_bytes",
1256 .data
= &dirty_background_bytes
,
1257 .maxlen
= sizeof(dirty_background_bytes
),
1259 .proc_handler
= dirty_background_bytes_handler
,
1263 .procname
= "dirty_ratio",
1264 .data
= &vm_dirty_ratio
,
1265 .maxlen
= sizeof(vm_dirty_ratio
),
1267 .proc_handler
= dirty_ratio_handler
,
1269 .extra2
= &one_hundred
,
1272 .procname
= "dirty_bytes",
1273 .data
= &vm_dirty_bytes
,
1274 .maxlen
= sizeof(vm_dirty_bytes
),
1276 .proc_handler
= dirty_bytes_handler
,
1277 .extra1
= &dirty_bytes_min
,
1280 .procname
= "dirty_writeback_centisecs",
1281 .data
= &dirty_writeback_interval
,
1282 .maxlen
= sizeof(dirty_writeback_interval
),
1284 .proc_handler
= dirty_writeback_centisecs_handler
,
1287 .procname
= "dirty_expire_centisecs",
1288 .data
= &dirty_expire_interval
,
1289 .maxlen
= sizeof(dirty_expire_interval
),
1291 .proc_handler
= proc_dointvec_minmax
,
1295 .procname
= "dirtytime_expire_seconds",
1296 .data
= &dirtytime_expire_interval
,
1297 .maxlen
= sizeof(dirty_expire_interval
),
1299 .proc_handler
= dirtytime_interval_handler
,
1303 .procname
= "nr_pdflush_threads",
1304 .mode
= 0444 /* read-only */,
1305 .proc_handler
= pdflush_proc_obsolete
,
1308 .procname
= "swappiness",
1309 .data
= &vm_swappiness
,
1310 .maxlen
= sizeof(vm_swappiness
),
1312 .proc_handler
= proc_dointvec_minmax
,
1314 .extra2
= &one_hundred
,
1316 #ifdef CONFIG_HUGETLB_PAGE
1318 .procname
= "nr_hugepages",
1320 .maxlen
= sizeof(unsigned long),
1322 .proc_handler
= hugetlb_sysctl_handler
,
1326 .procname
= "nr_hugepages_mempolicy",
1328 .maxlen
= sizeof(unsigned long),
1330 .proc_handler
= &hugetlb_mempolicy_sysctl_handler
,
1334 .procname
= "hugetlb_shm_group",
1335 .data
= &sysctl_hugetlb_shm_group
,
1336 .maxlen
= sizeof(gid_t
),
1338 .proc_handler
= proc_dointvec
,
1341 .procname
= "hugepages_treat_as_movable",
1342 .data
= &hugepages_treat_as_movable
,
1343 .maxlen
= sizeof(int),
1345 .proc_handler
= proc_dointvec
,
1348 .procname
= "nr_overcommit_hugepages",
1350 .maxlen
= sizeof(unsigned long),
1352 .proc_handler
= hugetlb_overcommit_handler
,
1356 .procname
= "lowmem_reserve_ratio",
1357 .data
= &sysctl_lowmem_reserve_ratio
,
1358 .maxlen
= sizeof(sysctl_lowmem_reserve_ratio
),
1360 .proc_handler
= lowmem_reserve_ratio_sysctl_handler
,
1363 .procname
= "drop_caches",
1364 .data
= &sysctl_drop_caches
,
1365 .maxlen
= sizeof(int),
1367 .proc_handler
= drop_caches_sysctl_handler
,
1371 #ifdef CONFIG_COMPACTION
1373 .procname
= "compact_memory",
1374 .data
= &sysctl_compact_memory
,
1375 .maxlen
= sizeof(int),
1377 .proc_handler
= sysctl_compaction_handler
,
1380 .procname
= "extfrag_threshold",
1381 .data
= &sysctl_extfrag_threshold
,
1382 .maxlen
= sizeof(int),
1384 .proc_handler
= sysctl_extfrag_handler
,
1385 .extra1
= &min_extfrag_threshold
,
1386 .extra2
= &max_extfrag_threshold
,
1389 .procname
= "compact_unevictable_allowed",
1390 .data
= &sysctl_compact_unevictable_allowed
,
1391 .maxlen
= sizeof(int),
1393 .proc_handler
= proc_dointvec
,
1398 #endif /* CONFIG_COMPACTION */
1400 .procname
= "min_free_kbytes",
1401 .data
= &min_free_kbytes
,
1402 .maxlen
= sizeof(min_free_kbytes
),
1404 .proc_handler
= min_free_kbytes_sysctl_handler
,
1408 .procname
= "percpu_pagelist_fraction",
1409 .data
= &percpu_pagelist_fraction
,
1410 .maxlen
= sizeof(percpu_pagelist_fraction
),
1412 .proc_handler
= percpu_pagelist_fraction_sysctl_handler
,
1417 .procname
= "max_map_count",
1418 .data
= &sysctl_max_map_count
,
1419 .maxlen
= sizeof(sysctl_max_map_count
),
1421 .proc_handler
= proc_dointvec_minmax
,
1426 .procname
= "nr_trim_pages",
1427 .data
= &sysctl_nr_trim_pages
,
1428 .maxlen
= sizeof(sysctl_nr_trim_pages
),
1430 .proc_handler
= proc_dointvec_minmax
,
1435 .procname
= "laptop_mode",
1436 .data
= &laptop_mode
,
1437 .maxlen
= sizeof(laptop_mode
),
1439 .proc_handler
= proc_dointvec_jiffies
,
1442 .procname
= "block_dump",
1443 .data
= &block_dump
,
1444 .maxlen
= sizeof(block_dump
),
1446 .proc_handler
= proc_dointvec
,
1450 .procname
= "vfs_cache_pressure",
1451 .data
= &sysctl_vfs_cache_pressure
,
1452 .maxlen
= sizeof(sysctl_vfs_cache_pressure
),
1454 .proc_handler
= proc_dointvec
,
1457 #ifdef HAVE_ARCH_PICK_MMAP_LAYOUT
1459 .procname
= "legacy_va_layout",
1460 .data
= &sysctl_legacy_va_layout
,
1461 .maxlen
= sizeof(sysctl_legacy_va_layout
),
1463 .proc_handler
= proc_dointvec
,
1469 .procname
= "zone_reclaim_mode",
1470 .data
= &zone_reclaim_mode
,
1471 .maxlen
= sizeof(zone_reclaim_mode
),
1473 .proc_handler
= proc_dointvec
,
1477 .procname
= "min_unmapped_ratio",
1478 .data
= &sysctl_min_unmapped_ratio
,
1479 .maxlen
= sizeof(sysctl_min_unmapped_ratio
),
1481 .proc_handler
= sysctl_min_unmapped_ratio_sysctl_handler
,
1483 .extra2
= &one_hundred
,
1486 .procname
= "min_slab_ratio",
1487 .data
= &sysctl_min_slab_ratio
,
1488 .maxlen
= sizeof(sysctl_min_slab_ratio
),
1490 .proc_handler
= sysctl_min_slab_ratio_sysctl_handler
,
1492 .extra2
= &one_hundred
,
1497 .procname
= "stat_interval",
1498 .data
= &sysctl_stat_interval
,
1499 .maxlen
= sizeof(sysctl_stat_interval
),
1501 .proc_handler
= proc_dointvec_jiffies
,
1506 .procname
= "mmap_min_addr",
1507 .data
= &dac_mmap_min_addr
,
1508 .maxlen
= sizeof(unsigned long),
1510 .proc_handler
= mmap_min_addr_handler
,
1515 .procname
= "numa_zonelist_order",
1516 .data
= &numa_zonelist_order
,
1517 .maxlen
= NUMA_ZONELIST_ORDER_LEN
,
1519 .proc_handler
= numa_zonelist_order_handler
,
1522 #if (defined(CONFIG_X86_32) && !defined(CONFIG_UML))|| \
1523 (defined(CONFIG_SUPERH) && defined(CONFIG_VSYSCALL))
1525 .procname
= "vdso_enabled",
1526 #ifdef CONFIG_X86_32
1527 .data
= &vdso32_enabled
,
1528 .maxlen
= sizeof(vdso32_enabled
),
1530 .data
= &vdso_enabled
,
1531 .maxlen
= sizeof(vdso_enabled
),
1534 .proc_handler
= proc_dointvec
,
1538 #ifdef CONFIG_HIGHMEM
1540 .procname
= "highmem_is_dirtyable",
1541 .data
= &vm_highmem_is_dirtyable
,
1542 .maxlen
= sizeof(vm_highmem_is_dirtyable
),
1544 .proc_handler
= proc_dointvec_minmax
,
1549 #ifdef CONFIG_MEMORY_FAILURE
1551 .procname
= "memory_failure_early_kill",
1552 .data
= &sysctl_memory_failure_early_kill
,
1553 .maxlen
= sizeof(sysctl_memory_failure_early_kill
),
1555 .proc_handler
= proc_dointvec_minmax
,
1560 .procname
= "memory_failure_recovery",
1561 .data
= &sysctl_memory_failure_recovery
,
1562 .maxlen
= sizeof(sysctl_memory_failure_recovery
),
1564 .proc_handler
= proc_dointvec_minmax
,
1570 .procname
= "user_reserve_kbytes",
1571 .data
= &sysctl_user_reserve_kbytes
,
1572 .maxlen
= sizeof(sysctl_user_reserve_kbytes
),
1574 .proc_handler
= proc_doulongvec_minmax
,
1577 .procname
= "admin_reserve_kbytes",
1578 .data
= &sysctl_admin_reserve_kbytes
,
1579 .maxlen
= sizeof(sysctl_admin_reserve_kbytes
),
1581 .proc_handler
= proc_doulongvec_minmax
,
1586 static struct ctl_table fs_table
[] = {
1588 .procname
= "inode-nr",
1589 .data
= &inodes_stat
,
1590 .maxlen
= 2*sizeof(long),
1592 .proc_handler
= proc_nr_inodes
,
1595 .procname
= "inode-state",
1596 .data
= &inodes_stat
,
1597 .maxlen
= 7*sizeof(long),
1599 .proc_handler
= proc_nr_inodes
,
1602 .procname
= "file-nr",
1603 .data
= &files_stat
,
1604 .maxlen
= sizeof(files_stat
),
1606 .proc_handler
= proc_nr_files
,
1609 .procname
= "file-max",
1610 .data
= &files_stat
.max_files
,
1611 .maxlen
= sizeof(files_stat
.max_files
),
1613 .proc_handler
= proc_doulongvec_minmax
,
1616 .procname
= "nr_open",
1617 .data
= &sysctl_nr_open
,
1618 .maxlen
= sizeof(int),
1620 .proc_handler
= proc_dointvec_minmax
,
1621 .extra1
= &sysctl_nr_open_min
,
1622 .extra2
= &sysctl_nr_open_max
,
1625 .procname
= "dentry-state",
1626 .data
= &dentry_stat
,
1627 .maxlen
= 6*sizeof(long),
1629 .proc_handler
= proc_nr_dentry
,
1632 .procname
= "overflowuid",
1633 .data
= &fs_overflowuid
,
1634 .maxlen
= sizeof(int),
1636 .proc_handler
= proc_dointvec_minmax
,
1637 .extra1
= &minolduid
,
1638 .extra2
= &maxolduid
,
1641 .procname
= "overflowgid",
1642 .data
= &fs_overflowgid
,
1643 .maxlen
= sizeof(int),
1645 .proc_handler
= proc_dointvec_minmax
,
1646 .extra1
= &minolduid
,
1647 .extra2
= &maxolduid
,
1649 #ifdef CONFIG_FILE_LOCKING
1651 .procname
= "leases-enable",
1652 .data
= &leases_enable
,
1653 .maxlen
= sizeof(int),
1655 .proc_handler
= proc_dointvec
,
1658 #ifdef CONFIG_DNOTIFY
1660 .procname
= "dir-notify-enable",
1661 .data
= &dir_notify_enable
,
1662 .maxlen
= sizeof(int),
1664 .proc_handler
= proc_dointvec
,
1668 #ifdef CONFIG_FILE_LOCKING
1670 .procname
= "lease-break-time",
1671 .data
= &lease_break_time
,
1672 .maxlen
= sizeof(int),
1674 .proc_handler
= proc_dointvec
,
1679 .procname
= "aio-nr",
1681 .maxlen
= sizeof(aio_nr
),
1683 .proc_handler
= proc_doulongvec_minmax
,
1686 .procname
= "aio-max-nr",
1687 .data
= &aio_max_nr
,
1688 .maxlen
= sizeof(aio_max_nr
),
1690 .proc_handler
= proc_doulongvec_minmax
,
1692 #endif /* CONFIG_AIO */
1693 #ifdef CONFIG_INOTIFY_USER
1695 .procname
= "inotify",
1697 .child
= inotify_table
,
1702 .procname
= "epoll",
1704 .child
= epoll_table
,
1709 .procname
= "protected_symlinks",
1710 .data
= &sysctl_protected_symlinks
,
1711 .maxlen
= sizeof(int),
1713 .proc_handler
= proc_dointvec_minmax
,
1718 .procname
= "protected_hardlinks",
1719 .data
= &sysctl_protected_hardlinks
,
1720 .maxlen
= sizeof(int),
1722 .proc_handler
= proc_dointvec_minmax
,
1727 .procname
= "suid_dumpable",
1728 .data
= &suid_dumpable
,
1729 .maxlen
= sizeof(int),
1731 .proc_handler
= proc_dointvec_minmax_coredump
,
1735 #if defined(CONFIG_BINFMT_MISC) || defined(CONFIG_BINFMT_MISC_MODULE)
1737 .procname
= "binfmt_misc",
1739 .child
= sysctl_mount_point
,
1743 .procname
= "pipe-max-size",
1744 .data
= &pipe_max_size
,
1745 .maxlen
= sizeof(int),
1747 .proc_handler
= &pipe_proc_fn
,
1748 .extra1
= &pipe_min_size
,
1753 static struct ctl_table debug_table
[] = {
1754 #ifdef CONFIG_SYSCTL_EXCEPTION_TRACE
1756 .procname
= "exception-trace",
1757 .data
= &show_unhandled_signals
,
1758 .maxlen
= sizeof(int),
1760 .proc_handler
= proc_dointvec
1763 #if defined(CONFIG_OPTPROBES)
1765 .procname
= "kprobes-optimization",
1766 .data
= &sysctl_kprobes_optimization
,
1767 .maxlen
= sizeof(int),
1769 .proc_handler
= proc_kprobes_optimization_handler
,
1777 static struct ctl_table dev_table
[] = {
1781 int __init
sysctl_init(void)
1783 struct ctl_table_header
*hdr
;
1785 hdr
= register_sysctl_table(sysctl_base_table
);
1786 kmemleak_not_leak(hdr
);
1790 #endif /* CONFIG_SYSCTL */
1796 #ifdef CONFIG_PROC_SYSCTL
1798 static int _proc_do_string(char *data
, int maxlen
, int write
,
1799 char __user
*buffer
,
1800 size_t *lenp
, loff_t
*ppos
)
1806 if (!data
|| !maxlen
|| !*lenp
) {
1812 if (sysctl_writes_strict
== SYSCTL_WRITES_STRICT
) {
1813 /* Only continue writes not past the end of buffer. */
1815 if (len
> maxlen
- 1)
1822 /* Start writing from beginning of buffer. */
1828 while ((p
- buffer
) < *lenp
&& len
< maxlen
- 1) {
1829 if (get_user(c
, p
++))
1831 if (c
== 0 || c
== '\n')
1852 if (copy_to_user(buffer
, data
, len
))
1855 if (put_user('\n', buffer
+ len
))
1865 static void warn_sysctl_write(struct ctl_table
*table
)
1867 pr_warn_once("%s wrote to %s when file position was not 0!\n"
1868 "This will not be supported in the future. To silence this\n"
1869 "warning, set kernel.sysctl_writes_strict = -1\n",
1870 current
->comm
, table
->procname
);
1874 * proc_dostring - read a string sysctl
1875 * @table: the sysctl table
1876 * @write: %TRUE if this is a write to the sysctl file
1877 * @buffer: the user buffer
1878 * @lenp: the size of the user buffer
1879 * @ppos: file position
1881 * Reads/writes a string from/to the user buffer. If the kernel
1882 * buffer provided is not large enough to hold the string, the
1883 * string is truncated. The copied string is %NULL-terminated.
1884 * If the string is being read by the user process, it is copied
1885 * and a newline '\n' is added. It is truncated if the buffer is
1888 * Returns 0 on success.
1890 int proc_dostring(struct ctl_table
*table
, int write
,
1891 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
)
1893 if (write
&& *ppos
&& sysctl_writes_strict
== SYSCTL_WRITES_WARN
)
1894 warn_sysctl_write(table
);
1896 return _proc_do_string((char *)(table
->data
), table
->maxlen
, write
,
1897 (char __user
*)buffer
, lenp
, ppos
);
1900 static size_t proc_skip_spaces(char **buf
)
1903 char *tmp
= skip_spaces(*buf
);
1909 static void proc_skip_char(char **buf
, size_t *size
, const char v
)
1919 #define TMPBUFLEN 22
1921 * proc_get_long - reads an ASCII formatted integer from a user buffer
1923 * @buf: a kernel buffer
1924 * @size: size of the kernel buffer
1925 * @val: this is where the number will be stored
1926 * @neg: set to %TRUE if number is negative
1927 * @perm_tr: a vector which contains the allowed trailers
1928 * @perm_tr_len: size of the perm_tr vector
1929 * @tr: pointer to store the trailer character
1931 * In case of success %0 is returned and @buf and @size are updated with
1932 * the amount of bytes read. If @tr is non-NULL and a trailing
1933 * character exists (size is non-zero after returning from this
1934 * function), @tr is updated with the trailing character.
1936 static int proc_get_long(char **buf
, size_t *size
,
1937 unsigned long *val
, bool *neg
,
1938 const char *perm_tr
, unsigned perm_tr_len
, char *tr
)
1941 char *p
, tmp
[TMPBUFLEN
];
1947 if (len
> TMPBUFLEN
- 1)
1948 len
= TMPBUFLEN
- 1;
1950 memcpy(tmp
, *buf
, len
);
1954 if (*p
== '-' && *size
> 1) {
1962 *val
= simple_strtoul(p
, &p
, 0);
1966 /* We don't know if the next char is whitespace thus we may accept
1967 * invalid integers (e.g. 1234...a) or two integers instead of one
1968 * (e.g. 123...1). So lets not allow such large numbers. */
1969 if (len
== TMPBUFLEN
- 1)
1972 if (len
< *size
&& perm_tr_len
&& !memchr(perm_tr
, *p
, perm_tr_len
))
1975 if (tr
&& (len
< *size
))
1985 * proc_put_long - converts an integer to a decimal ASCII formatted string
1987 * @buf: the user buffer
1988 * @size: the size of the user buffer
1989 * @val: the integer to be converted
1990 * @neg: sign of the number, %TRUE for negative
1992 * In case of success %0 is returned and @buf and @size are updated with
1993 * the amount of bytes written.
1995 static int proc_put_long(void __user
**buf
, size_t *size
, unsigned long val
,
1999 char tmp
[TMPBUFLEN
], *p
= tmp
;
2001 sprintf(p
, "%s%lu", neg
? "-" : "", val
);
2005 if (copy_to_user(*buf
, tmp
, len
))
2013 static int proc_put_char(void __user
**buf
, size_t *size
, char c
)
2016 char __user
**buffer
= (char __user
**)buf
;
2017 if (put_user(c
, *buffer
))
2019 (*size
)--, (*buffer
)++;
2025 static int do_proc_dointvec_conv(bool *negp
, unsigned long *lvalp
,
2027 int write
, void *data
)
2031 if (*lvalp
> (unsigned long) INT_MAX
+ 1)
2035 if (*lvalp
> (unsigned long) INT_MAX
)
2043 *lvalp
= -(unsigned long)val
;
2046 *lvalp
= (unsigned long)val
;
2052 static const char proc_wspace_sep
[] = { ' ', '\t', '\n' };
2054 static int __do_proc_dointvec(void *tbl_data
, struct ctl_table
*table
,
2055 int write
, void __user
*buffer
,
2056 size_t *lenp
, loff_t
*ppos
,
2057 int (*conv
)(bool *negp
, unsigned long *lvalp
, int *valp
,
2058 int write
, void *data
),
2061 int *i
, vleft
, first
= 1, err
= 0;
2062 unsigned long page
= 0;
2066 if (!tbl_data
|| !table
->maxlen
|| !*lenp
|| (*ppos
&& !write
)) {
2071 i
= (int *) tbl_data
;
2072 vleft
= table
->maxlen
/ sizeof(*i
);
2076 conv
= do_proc_dointvec_conv
;
2080 switch (sysctl_writes_strict
) {
2081 case SYSCTL_WRITES_STRICT
:
2083 case SYSCTL_WRITES_WARN
:
2084 warn_sysctl_write(table
);
2091 if (left
> PAGE_SIZE
- 1)
2092 left
= PAGE_SIZE
- 1;
2093 page
= __get_free_page(GFP_TEMPORARY
);
2094 kbuf
= (char *) page
;
2097 if (copy_from_user(kbuf
, buffer
, left
)) {
2104 for (; left
&& vleft
--; i
++, first
=0) {
2109 left
-= proc_skip_spaces(&kbuf
);
2113 err
= proc_get_long(&kbuf
, &left
, &lval
, &neg
,
2115 sizeof(proc_wspace_sep
), NULL
);
2118 if (conv(&neg
, &lval
, i
, 1, data
)) {
2123 if (conv(&neg
, &lval
, i
, 0, data
)) {
2128 err
= proc_put_char(&buffer
, &left
, '\t');
2131 err
= proc_put_long(&buffer
, &left
, lval
, neg
);
2137 if (!write
&& !first
&& left
&& !err
)
2138 err
= proc_put_char(&buffer
, &left
, '\n');
2139 if (write
&& !err
&& left
)
2140 left
-= proc_skip_spaces(&kbuf
);
2145 return err
? : -EINVAL
;
2153 static int do_proc_dointvec(struct ctl_table
*table
, int write
,
2154 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
,
2155 int (*conv
)(bool *negp
, unsigned long *lvalp
, int *valp
,
2156 int write
, void *data
),
2159 return __do_proc_dointvec(table
->data
, table
, write
,
2160 buffer
, lenp
, ppos
, conv
, data
);
2164 * proc_dointvec - read a vector of integers
2165 * @table: the sysctl table
2166 * @write: %TRUE if this is a write to the sysctl file
2167 * @buffer: the user buffer
2168 * @lenp: the size of the user buffer
2169 * @ppos: file position
2171 * Reads/writes up to table->maxlen/sizeof(unsigned int) integer
2172 * values from/to the user buffer, treated as an ASCII string.
2174 * Returns 0 on success.
2176 int proc_dointvec(struct ctl_table
*table
, int write
,
2177 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
)
2179 return do_proc_dointvec(table
,write
,buffer
,lenp
,ppos
,
2184 * Taint values can only be increased
2185 * This means we can safely use a temporary.
2187 static int proc_taint(struct ctl_table
*table
, int write
,
2188 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
)
2191 unsigned long tmptaint
= get_taint();
2194 if (write
&& !capable(CAP_SYS_ADMIN
))
2199 err
= proc_doulongvec_minmax(&t
, write
, buffer
, lenp
, ppos
);
2205 * Poor man's atomic or. Not worth adding a primitive
2206 * to everyone's atomic.h for this
2209 for (i
= 0; i
< BITS_PER_LONG
&& tmptaint
>> i
; i
++) {
2210 if ((tmptaint
>> i
) & 1)
2211 add_taint(i
, LOCKDEP_STILL_OK
);
2218 #ifdef CONFIG_PRINTK
2219 static int proc_dointvec_minmax_sysadmin(struct ctl_table
*table
, int write
,
2220 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
)
2222 if (write
&& !capable(CAP_SYS_ADMIN
))
2225 return proc_dointvec_minmax(table
, write
, buffer
, lenp
, ppos
);
2229 struct do_proc_dointvec_minmax_conv_param
{
2234 static int do_proc_dointvec_minmax_conv(bool *negp
, unsigned long *lvalp
,
2236 int write
, void *data
)
2238 struct do_proc_dointvec_minmax_conv_param
*param
= data
;
2240 int val
= *negp
? -*lvalp
: *lvalp
;
2241 if ((param
->min
&& *param
->min
> val
) ||
2242 (param
->max
&& *param
->max
< val
))
2249 *lvalp
= -(unsigned long)val
;
2252 *lvalp
= (unsigned long)val
;
2259 * proc_dointvec_minmax - read a vector of integers with min/max values
2260 * @table: the sysctl table
2261 * @write: %TRUE if this is a write to the sysctl file
2262 * @buffer: the user buffer
2263 * @lenp: the size of the user buffer
2264 * @ppos: file position
2266 * Reads/writes up to table->maxlen/sizeof(unsigned int) integer
2267 * values from/to the user buffer, treated as an ASCII string.
2269 * This routine will ensure the values are within the range specified by
2270 * table->extra1 (min) and table->extra2 (max).
2272 * Returns 0 on success.
2274 int proc_dointvec_minmax(struct ctl_table
*table
, int write
,
2275 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
)
2277 struct do_proc_dointvec_minmax_conv_param param
= {
2278 .min
= (int *) table
->extra1
,
2279 .max
= (int *) table
->extra2
,
2281 return do_proc_dointvec(table
, write
, buffer
, lenp
, ppos
,
2282 do_proc_dointvec_minmax_conv
, ¶m
);
2285 static void validate_coredump_safety(void)
2287 #ifdef CONFIG_COREDUMP
2288 if (suid_dumpable
== SUID_DUMP_ROOT
&&
2289 core_pattern
[0] != '/' && core_pattern
[0] != '|') {
2290 printk(KERN_WARNING
"Unsafe core_pattern used with "\
2291 "suid_dumpable=2. Pipe handler or fully qualified "\
2292 "core dump path required.\n");
2297 static int proc_dointvec_minmax_coredump(struct ctl_table
*table
, int write
,
2298 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
)
2300 int error
= proc_dointvec_minmax(table
, write
, buffer
, lenp
, ppos
);
2302 validate_coredump_safety();
2306 #ifdef CONFIG_COREDUMP
2307 static int proc_dostring_coredump(struct ctl_table
*table
, int write
,
2308 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
)
2310 int error
= proc_dostring(table
, write
, buffer
, lenp
, ppos
);
2312 validate_coredump_safety();
2317 static int __do_proc_doulongvec_minmax(void *data
, struct ctl_table
*table
, int write
,
2318 void __user
*buffer
,
2319 size_t *lenp
, loff_t
*ppos
,
2320 unsigned long convmul
,
2321 unsigned long convdiv
)
2323 unsigned long *i
, *min
, *max
;
2324 int vleft
, first
= 1, err
= 0;
2325 unsigned long page
= 0;
2329 if (!data
|| !table
->maxlen
|| !*lenp
|| (*ppos
&& !write
)) {
2334 i
= (unsigned long *) data
;
2335 min
= (unsigned long *) table
->extra1
;
2336 max
= (unsigned long *) table
->extra2
;
2337 vleft
= table
->maxlen
/ sizeof(unsigned long);
2342 switch (sysctl_writes_strict
) {
2343 case SYSCTL_WRITES_STRICT
:
2345 case SYSCTL_WRITES_WARN
:
2346 warn_sysctl_write(table
);
2353 if (left
> PAGE_SIZE
- 1)
2354 left
= PAGE_SIZE
- 1;
2355 page
= __get_free_page(GFP_TEMPORARY
);
2356 kbuf
= (char *) page
;
2359 if (copy_from_user(kbuf
, buffer
, left
)) {
2366 for (; left
&& vleft
--; i
++, first
= 0) {
2372 left
-= proc_skip_spaces(&kbuf
);
2374 err
= proc_get_long(&kbuf
, &left
, &val
, &neg
,
2376 sizeof(proc_wspace_sep
), NULL
);
2381 if ((min
&& val
< *min
) || (max
&& val
> *max
))
2385 val
= convdiv
* (*i
) / convmul
;
2387 err
= proc_put_char(&buffer
, &left
, '\t');
2391 err
= proc_put_long(&buffer
, &left
, val
, false);
2397 if (!write
&& !first
&& left
&& !err
)
2398 err
= proc_put_char(&buffer
, &left
, '\n');
2400 left
-= proc_skip_spaces(&kbuf
);
2405 return err
? : -EINVAL
;
2413 static int do_proc_doulongvec_minmax(struct ctl_table
*table
, int write
,
2414 void __user
*buffer
,
2415 size_t *lenp
, loff_t
*ppos
,
2416 unsigned long convmul
,
2417 unsigned long convdiv
)
2419 return __do_proc_doulongvec_minmax(table
->data
, table
, write
,
2420 buffer
, lenp
, ppos
, convmul
, convdiv
);
2424 * proc_doulongvec_minmax - read a vector of long integers with min/max values
2425 * @table: the sysctl table
2426 * @write: %TRUE if this is a write to the sysctl file
2427 * @buffer: the user buffer
2428 * @lenp: the size of the user buffer
2429 * @ppos: file position
2431 * Reads/writes up to table->maxlen/sizeof(unsigned long) unsigned long
2432 * values from/to the user buffer, treated as an ASCII string.
2434 * This routine will ensure the values are within the range specified by
2435 * table->extra1 (min) and table->extra2 (max).
2437 * Returns 0 on success.
2439 int proc_doulongvec_minmax(struct ctl_table
*table
, int write
,
2440 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
)
2442 return do_proc_doulongvec_minmax(table
, write
, buffer
, lenp
, ppos
, 1l, 1l);
2446 * proc_doulongvec_ms_jiffies_minmax - read a vector of millisecond values with min/max values
2447 * @table: the sysctl table
2448 * @write: %TRUE if this is a write to the sysctl file
2449 * @buffer: the user buffer
2450 * @lenp: the size of the user buffer
2451 * @ppos: file position
2453 * Reads/writes up to table->maxlen/sizeof(unsigned long) unsigned long
2454 * values from/to the user buffer, treated as an ASCII string. The values
2455 * are treated as milliseconds, and converted to jiffies when they are stored.
2457 * This routine will ensure the values are within the range specified by
2458 * table->extra1 (min) and table->extra2 (max).
2460 * Returns 0 on success.
2462 int proc_doulongvec_ms_jiffies_minmax(struct ctl_table
*table
, int write
,
2463 void __user
*buffer
,
2464 size_t *lenp
, loff_t
*ppos
)
2466 return do_proc_doulongvec_minmax(table
, write
, buffer
,
2467 lenp
, ppos
, HZ
, 1000l);
2471 static int do_proc_dointvec_jiffies_conv(bool *negp
, unsigned long *lvalp
,
2473 int write
, void *data
)
2476 if (*lvalp
> LONG_MAX
/ HZ
)
2478 *valp
= *negp
? -(*lvalp
*HZ
) : (*lvalp
*HZ
);
2484 lval
= -(unsigned long)val
;
2487 lval
= (unsigned long)val
;
2494 static int do_proc_dointvec_userhz_jiffies_conv(bool *negp
, unsigned long *lvalp
,
2496 int write
, void *data
)
2499 if (USER_HZ
< HZ
&& *lvalp
> (LONG_MAX
/ HZ
) * USER_HZ
)
2501 *valp
= clock_t_to_jiffies(*negp
? -*lvalp
: *lvalp
);
2507 lval
= -(unsigned long)val
;
2510 lval
= (unsigned long)val
;
2512 *lvalp
= jiffies_to_clock_t(lval
);
2517 static int do_proc_dointvec_ms_jiffies_conv(bool *negp
, unsigned long *lvalp
,
2519 int write
, void *data
)
2522 unsigned long jif
= msecs_to_jiffies(*negp
? -*lvalp
: *lvalp
);
2532 lval
= -(unsigned long)val
;
2535 lval
= (unsigned long)val
;
2537 *lvalp
= jiffies_to_msecs(lval
);
2543 * proc_dointvec_jiffies - read a vector of integers as seconds
2544 * @table: the sysctl table
2545 * @write: %TRUE if this is a write to the sysctl file
2546 * @buffer: the user buffer
2547 * @lenp: the size of the user buffer
2548 * @ppos: file position
2550 * Reads/writes up to table->maxlen/sizeof(unsigned int) integer
2551 * values from/to the user buffer, treated as an ASCII string.
2552 * The values read are assumed to be in seconds, and are converted into
2555 * Returns 0 on success.
2557 int proc_dointvec_jiffies(struct ctl_table
*table
, int write
,
2558 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
)
2560 return do_proc_dointvec(table
,write
,buffer
,lenp
,ppos
,
2561 do_proc_dointvec_jiffies_conv
,NULL
);
2565 * proc_dointvec_userhz_jiffies - read a vector of integers as 1/USER_HZ seconds
2566 * @table: the sysctl table
2567 * @write: %TRUE if this is a write to the sysctl file
2568 * @buffer: the user buffer
2569 * @lenp: the size of the user buffer
2570 * @ppos: pointer to the file position
2572 * Reads/writes up to table->maxlen/sizeof(unsigned int) integer
2573 * values from/to the user buffer, treated as an ASCII string.
2574 * The values read are assumed to be in 1/USER_HZ seconds, and
2575 * are converted into jiffies.
2577 * Returns 0 on success.
2579 int proc_dointvec_userhz_jiffies(struct ctl_table
*table
, int write
,
2580 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
)
2582 return do_proc_dointvec(table
,write
,buffer
,lenp
,ppos
,
2583 do_proc_dointvec_userhz_jiffies_conv
,NULL
);
2587 * proc_dointvec_ms_jiffies - read a vector of integers as 1 milliseconds
2588 * @table: the sysctl table
2589 * @write: %TRUE if this is a write to the sysctl file
2590 * @buffer: the user buffer
2591 * @lenp: the size of the user buffer
2592 * @ppos: file position
2593 * @ppos: the current position in the file
2595 * Reads/writes up to table->maxlen/sizeof(unsigned int) integer
2596 * values from/to the user buffer, treated as an ASCII string.
2597 * The values read are assumed to be in 1/1000 seconds, and
2598 * are converted into jiffies.
2600 * Returns 0 on success.
2602 int proc_dointvec_ms_jiffies(struct ctl_table
*table
, int write
,
2603 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
)
2605 return do_proc_dointvec(table
, write
, buffer
, lenp
, ppos
,
2606 do_proc_dointvec_ms_jiffies_conv
, NULL
);
2609 static int proc_do_cad_pid(struct ctl_table
*table
, int write
,
2610 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
)
2612 struct pid
*new_pid
;
2616 tmp
= pid_vnr(cad_pid
);
2618 r
= __do_proc_dointvec(&tmp
, table
, write
, buffer
,
2619 lenp
, ppos
, NULL
, NULL
);
2623 new_pid
= find_get_pid(tmp
);
2627 put_pid(xchg(&cad_pid
, new_pid
));
2632 * proc_do_large_bitmap - read/write from/to a large bitmap
2633 * @table: the sysctl table
2634 * @write: %TRUE if this is a write to the sysctl file
2635 * @buffer: the user buffer
2636 * @lenp: the size of the user buffer
2637 * @ppos: file position
2639 * The bitmap is stored at table->data and the bitmap length (in bits)
2642 * We use a range comma separated format (e.g. 1,3-4,10-10) so that
2643 * large bitmaps may be represented in a compact manner. Writing into
2644 * the file will clear the bitmap then update it with the given input.
2646 * Returns 0 on success.
2648 int proc_do_large_bitmap(struct ctl_table
*table
, int write
,
2649 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
)
2653 size_t left
= *lenp
;
2654 unsigned long bitmap_len
= table
->maxlen
;
2655 unsigned long *bitmap
= *(unsigned long **) table
->data
;
2656 unsigned long *tmp_bitmap
= NULL
;
2657 char tr_a
[] = { '-', ',', '\n' }, tr_b
[] = { ',', '\n', 0 }, c
;
2659 if (!bitmap
|| !bitmap_len
|| !left
|| (*ppos
&& !write
)) {
2665 unsigned long page
= 0;
2668 if (left
> PAGE_SIZE
- 1)
2669 left
= PAGE_SIZE
- 1;
2671 page
= __get_free_page(GFP_TEMPORARY
);
2672 kbuf
= (char *) page
;
2675 if (copy_from_user(kbuf
, buffer
, left
)) {
2681 tmp_bitmap
= kzalloc(BITS_TO_LONGS(bitmap_len
) * sizeof(unsigned long),
2687 proc_skip_char(&kbuf
, &left
, '\n');
2688 while (!err
&& left
) {
2689 unsigned long val_a
, val_b
;
2692 err
= proc_get_long(&kbuf
, &left
, &val_a
, &neg
, tr_a
,
2696 if (val_a
>= bitmap_len
|| neg
) {
2708 err
= proc_get_long(&kbuf
, &left
, &val_b
,
2709 &neg
, tr_b
, sizeof(tr_b
),
2713 if (val_b
>= bitmap_len
|| neg
||
2724 bitmap_set(tmp_bitmap
, val_a
, val_b
- val_a
+ 1);
2726 proc_skip_char(&kbuf
, &left
, '\n');
2730 unsigned long bit_a
, bit_b
= 0;
2733 bit_a
= find_next_bit(bitmap
, bitmap_len
, bit_b
);
2734 if (bit_a
>= bitmap_len
)
2736 bit_b
= find_next_zero_bit(bitmap
, bitmap_len
,
2740 err
= proc_put_char(&buffer
, &left
, ',');
2744 err
= proc_put_long(&buffer
, &left
, bit_a
, false);
2747 if (bit_a
!= bit_b
) {
2748 err
= proc_put_char(&buffer
, &left
, '-');
2751 err
= proc_put_long(&buffer
, &left
, bit_b
, false);
2759 err
= proc_put_char(&buffer
, &left
, '\n');
2765 bitmap_or(bitmap
, bitmap
, tmp_bitmap
, bitmap_len
);
2767 bitmap_copy(bitmap
, tmp_bitmap
, bitmap_len
);
2779 #else /* CONFIG_PROC_SYSCTL */
2781 int proc_dostring(struct ctl_table
*table
, int write
,
2782 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
)
2787 int proc_dointvec(struct ctl_table
*table
, int write
,
2788 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
)
2793 int proc_dointvec_minmax(struct ctl_table
*table
, int write
,
2794 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
)
2799 int proc_dointvec_jiffies(struct ctl_table
*table
, int write
,
2800 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
)
2805 int proc_dointvec_userhz_jiffies(struct ctl_table
*table
, int write
,
2806 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
)
2811 int proc_dointvec_ms_jiffies(struct ctl_table
*table
, int write
,
2812 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
)
2817 int proc_doulongvec_minmax(struct ctl_table
*table
, int write
,
2818 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
)
2823 int proc_doulongvec_ms_jiffies_minmax(struct ctl_table
*table
, int write
,
2824 void __user
*buffer
,
2825 size_t *lenp
, loff_t
*ppos
)
2831 #endif /* CONFIG_PROC_SYSCTL */
2834 * No sense putting this after each symbol definition, twice,
2835 * exception granted :-)
2837 EXPORT_SYMBOL(proc_dointvec
);
2838 EXPORT_SYMBOL(proc_dointvec_jiffies
);
2839 EXPORT_SYMBOL(proc_dointvec_minmax
);
2840 EXPORT_SYMBOL(proc_dointvec_userhz_jiffies
);
2841 EXPORT_SYMBOL(proc_dointvec_ms_jiffies
);
2842 EXPORT_SYMBOL(proc_dostring
);
2843 EXPORT_SYMBOL(proc_doulongvec_minmax
);
2844 EXPORT_SYMBOL(proc_doulongvec_ms_jiffies_minmax
);