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>
23 #include <linux/swap.h>
24 #include <linux/slab.h>
25 #include <linux/sysctl.h>
26 #include <linux/proc_fs.h>
27 #include <linux/capability.h>
28 #include <linux/ctype.h>
29 #include <linux/utsname.h>
30 #include <linux/capability.h>
31 #include <linux/smp_lock.h>
32 #include <linux/init.h>
33 #include <linux/kernel.h>
34 #include <linux/kobject.h>
35 #include <linux/net.h>
36 #include <linux/sysrq.h>
37 #include <linux/highuid.h>
38 #include <linux/writeback.h>
39 #include <linux/hugetlb.h>
40 #include <linux/security.h>
41 #include <linux/initrd.h>
42 #include <linux/times.h>
43 #include <linux/limits.h>
44 #include <linux/dcache.h>
45 #include <linux/syscalls.h>
46 #include <linux/nfs_fs.h>
47 #include <linux/acpi.h>
49 #include <asm/uaccess.h>
50 #include <asm/processor.h>
52 extern int proc_nr_files(ctl_table
*table
, int write
, struct file
*filp
,
53 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
);
57 #include <asm/stacktrace.h>
60 #if defined(CONFIG_SYSCTL)
62 /* External variables not in a header file. */
64 extern int sysctl_overcommit_memory
;
65 extern int sysctl_overcommit_ratio
;
66 extern int sysctl_panic_on_oom
;
67 extern int max_threads
;
68 extern int core_uses_pid
;
69 extern int suid_dumpable
;
70 extern char core_pattern
[];
72 extern int min_free_kbytes
;
73 extern int printk_ratelimit_jiffies
;
74 extern int printk_ratelimit_burst
;
75 extern int pid_max_min
, pid_max_max
;
76 extern int sysctl_drop_caches
;
77 extern int percpu_pagelist_fraction
;
78 extern int compat_log
;
80 /* this is needed for the proc_dointvec_minmax for [fs_]overflow UID and GID */
81 static int maxolduid
= 65535;
83 static int min_percpu_pagelist_fract
= 8;
85 static int ngroups_max
= NGROUPS_MAX
;
88 extern char modprobe_path
[];
90 #ifdef CONFIG_CHR_DEV_SG
91 extern int sg_big_buff
;
94 static int proc_ipc_dointvec(ctl_table
*table
, int write
, struct file
*filp
,
95 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
);
96 static int proc_ipc_doulongvec_minmax(ctl_table
*table
, int write
, struct file
*filp
,
97 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
);
101 extern char reboot_command
[];
102 extern int stop_a_enabled
;
103 extern int scons_pwroff
;
107 extern int pwrsw_enabled
;
108 extern int unaligned_enabled
;
112 #ifdef CONFIG_MATHEMU
113 extern int sysctl_ieee_emulation_warnings
;
115 extern int sysctl_userprocess_debug
;
116 extern int spin_retry
;
119 extern int sysctl_hz_timer
;
121 #ifdef CONFIG_BSD_PROCESS_ACCT
122 extern int acct_parm
[];
126 extern int no_unaligned_warning
;
129 #ifdef CONFIG_RT_MUTEXES
130 extern int max_lock_depth
;
133 #ifdef CONFIG_SYSCTL_SYSCALL
134 static int parse_table(int __user
*, int, void __user
*, size_t __user
*,
135 void __user
*, size_t, ctl_table
*);
138 #ifdef CONFIG_SYSVIPC
139 static int sysctl_ipc_data(ctl_table
*table
, int __user
*name
, int nlen
,
140 void __user
*oldval
, size_t __user
*oldlenp
,
141 void __user
*newval
, size_t newlen
);
144 #ifdef CONFIG_PROC_SYSCTL
145 static int proc_do_cad_pid(ctl_table
*table
, int write
, struct file
*filp
,
146 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
);
147 static int proc_dointvec_taint(ctl_table
*table
, int write
, struct file
*filp
,
148 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
);
151 static ctl_table root_table
[];
152 static struct ctl_table_header root_table_header
=
153 { root_table
, LIST_HEAD_INIT(root_table_header
.ctl_entry
) };
155 static ctl_table kern_table
[];
156 static ctl_table vm_table
[];
157 static ctl_table fs_table
[];
158 static ctl_table debug_table
[];
159 static ctl_table dev_table
[];
160 extern ctl_table random_table
[];
161 #ifdef CONFIG_UNIX98_PTYS
162 extern ctl_table pty_table
[];
164 #ifdef CONFIG_INOTIFY_USER
165 extern ctl_table inotify_table
[];
168 #ifdef HAVE_ARCH_PICK_MMAP_LAYOUT
169 int sysctl_legacy_va_layout
;
172 #ifdef CONFIG_SYSVIPC
173 static void *get_ipc(ctl_table
*table
, int write
)
175 char *which
= table
->data
;
176 struct ipc_namespace
*ipc_ns
= current
->nsproxy
->ipc_ns
;
177 which
= (which
- (char *)&init_ipc_ns
) + (char *)ipc_ns
;
181 #define get_ipc(T,W) ((T)->data)
184 /* /proc declarations: */
186 #ifdef CONFIG_PROC_SYSCTL
188 static ssize_t
proc_readsys(struct file
*, char __user
*, size_t, loff_t
*);
189 static ssize_t
proc_writesys(struct file
*, const char __user
*, size_t, loff_t
*);
190 static int proc_opensys(struct inode
*, struct file
*);
192 const struct file_operations proc_sys_file_operations
= {
193 .open
= proc_opensys
,
194 .read
= proc_readsys
,
195 .write
= proc_writesys
,
198 extern struct proc_dir_entry
*proc_sys_root
;
200 static void register_proc_table(ctl_table
*, struct proc_dir_entry
*, void *);
201 static void unregister_proc_table(ctl_table
*, struct proc_dir_entry
*);
204 /* The default sysctl tables: */
206 static ctl_table root_table
[] = {
208 .ctl_name
= CTL_KERN
,
209 .procname
= "kernel",
234 .ctl_name
= CTL_DEBUG
,
237 .child
= debug_table
,
249 static ctl_table kern_table
[] = {
251 .ctl_name
= KERN_PANIC
,
253 .data
= &panic_timeout
,
254 .maxlen
= sizeof(int),
256 .proc_handler
= &proc_dointvec
,
259 .ctl_name
= KERN_CORE_USES_PID
,
260 .procname
= "core_uses_pid",
261 .data
= &core_uses_pid
,
262 .maxlen
= sizeof(int),
264 .proc_handler
= &proc_dointvec
,
267 .ctl_name
= KERN_CORE_PATTERN
,
268 .procname
= "core_pattern",
269 .data
= core_pattern
,
272 .proc_handler
= &proc_dostring
,
273 .strategy
= &sysctl_string
,
275 #ifdef CONFIG_PROC_SYSCTL
277 .ctl_name
= KERN_TAINTED
,
278 .procname
= "tainted",
280 .maxlen
= sizeof(int),
282 .proc_handler
= &proc_dointvec_taint
,
286 .ctl_name
= KERN_CAP_BSET
,
287 .procname
= "cap-bound",
289 .maxlen
= sizeof(kernel_cap_t
),
291 .proc_handler
= &proc_dointvec_bset
,
293 #ifdef CONFIG_BLK_DEV_INITRD
295 .ctl_name
= KERN_REALROOTDEV
,
296 .procname
= "real-root-dev",
297 .data
= &real_root_dev
,
298 .maxlen
= sizeof(int),
300 .proc_handler
= &proc_dointvec
,
305 .ctl_name
= KERN_SPARC_REBOOT
,
306 .procname
= "reboot-cmd",
307 .data
= reboot_command
,
310 .proc_handler
= &proc_dostring
,
311 .strategy
= &sysctl_string
,
314 .ctl_name
= KERN_SPARC_STOP_A
,
315 .procname
= "stop-a",
316 .data
= &stop_a_enabled
,
317 .maxlen
= sizeof (int),
319 .proc_handler
= &proc_dointvec
,
322 .ctl_name
= KERN_SPARC_SCONS_PWROFF
,
323 .procname
= "scons-poweroff",
324 .data
= &scons_pwroff
,
325 .maxlen
= sizeof (int),
327 .proc_handler
= &proc_dointvec
,
332 .ctl_name
= KERN_HPPA_PWRSW
,
333 .procname
= "soft-power",
334 .data
= &pwrsw_enabled
,
335 .maxlen
= sizeof (int),
337 .proc_handler
= &proc_dointvec
,
340 .ctl_name
= KERN_HPPA_UNALIGNED
,
341 .procname
= "unaligned-trap",
342 .data
= &unaligned_enabled
,
343 .maxlen
= sizeof (int),
345 .proc_handler
= &proc_dointvec
,
349 .ctl_name
= KERN_CTLALTDEL
,
350 .procname
= "ctrl-alt-del",
352 .maxlen
= sizeof(int),
354 .proc_handler
= &proc_dointvec
,
357 .ctl_name
= KERN_PRINTK
,
358 .procname
= "printk",
359 .data
= &console_loglevel
,
360 .maxlen
= 4*sizeof(int),
362 .proc_handler
= &proc_dointvec
,
366 .ctl_name
= KERN_MODPROBE
,
367 .procname
= "modprobe",
368 .data
= &modprobe_path
,
369 .maxlen
= KMOD_PATH_LEN
,
371 .proc_handler
= &proc_dostring
,
372 .strategy
= &sysctl_string
,
375 #if defined(CONFIG_HOTPLUG) && defined(CONFIG_NET)
377 .ctl_name
= KERN_HOTPLUG
,
378 .procname
= "hotplug",
379 .data
= &uevent_helper
,
380 .maxlen
= UEVENT_HELPER_PATH_LEN
,
382 .proc_handler
= &proc_dostring
,
383 .strategy
= &sysctl_string
,
386 #ifdef CONFIG_CHR_DEV_SG
388 .ctl_name
= KERN_SG_BIG_BUFF
,
389 .procname
= "sg-big-buff",
390 .data
= &sg_big_buff
,
391 .maxlen
= sizeof (int),
393 .proc_handler
= &proc_dointvec
,
396 #ifdef CONFIG_BSD_PROCESS_ACCT
398 .ctl_name
= KERN_ACCT
,
401 .maxlen
= 3*sizeof(int),
403 .proc_handler
= &proc_dointvec
,
406 #ifdef CONFIG_SYSVIPC
408 .ctl_name
= KERN_SHMMAX
,
409 .procname
= "shmmax",
410 .data
= &init_ipc_ns
.shm_ctlmax
,
411 .maxlen
= sizeof (init_ipc_ns
.shm_ctlmax
),
413 .proc_handler
= &proc_ipc_doulongvec_minmax
,
414 .strategy
= sysctl_ipc_data
,
417 .ctl_name
= KERN_SHMALL
,
418 .procname
= "shmall",
419 .data
= &init_ipc_ns
.shm_ctlall
,
420 .maxlen
= sizeof (init_ipc_ns
.shm_ctlall
),
422 .proc_handler
= &proc_ipc_doulongvec_minmax
,
423 .strategy
= sysctl_ipc_data
,
426 .ctl_name
= KERN_SHMMNI
,
427 .procname
= "shmmni",
428 .data
= &init_ipc_ns
.shm_ctlmni
,
429 .maxlen
= sizeof (init_ipc_ns
.shm_ctlmni
),
431 .proc_handler
= &proc_ipc_dointvec
,
432 .strategy
= sysctl_ipc_data
,
435 .ctl_name
= KERN_MSGMAX
,
436 .procname
= "msgmax",
437 .data
= &init_ipc_ns
.msg_ctlmax
,
438 .maxlen
= sizeof (init_ipc_ns
.msg_ctlmax
),
440 .proc_handler
= &proc_ipc_dointvec
,
441 .strategy
= sysctl_ipc_data
,
444 .ctl_name
= KERN_MSGMNI
,
445 .procname
= "msgmni",
446 .data
= &init_ipc_ns
.msg_ctlmni
,
447 .maxlen
= sizeof (init_ipc_ns
.msg_ctlmni
),
449 .proc_handler
= &proc_ipc_dointvec
,
450 .strategy
= sysctl_ipc_data
,
453 .ctl_name
= KERN_MSGMNB
,
454 .procname
= "msgmnb",
455 .data
= &init_ipc_ns
.msg_ctlmnb
,
456 .maxlen
= sizeof (init_ipc_ns
.msg_ctlmnb
),
458 .proc_handler
= &proc_ipc_dointvec
,
459 .strategy
= sysctl_ipc_data
,
462 .ctl_name
= KERN_SEM
,
464 .data
= &init_ipc_ns
.sem_ctls
,
465 .maxlen
= 4*sizeof (int),
467 .proc_handler
= &proc_ipc_dointvec
,
468 .strategy
= sysctl_ipc_data
,
471 #ifdef CONFIG_MAGIC_SYSRQ
473 .ctl_name
= KERN_SYSRQ
,
475 .data
= &__sysrq_enabled
,
476 .maxlen
= sizeof (int),
478 .proc_handler
= &proc_dointvec
,
481 #ifdef CONFIG_PROC_SYSCTL
483 .ctl_name
= KERN_CADPID
,
484 .procname
= "cad_pid",
486 .maxlen
= sizeof (int),
488 .proc_handler
= &proc_do_cad_pid
,
492 .ctl_name
= KERN_MAX_THREADS
,
493 .procname
= "threads-max",
494 .data
= &max_threads
,
495 .maxlen
= sizeof(int),
497 .proc_handler
= &proc_dointvec
,
500 .ctl_name
= KERN_RANDOM
,
501 .procname
= "random",
503 .child
= random_table
,
505 #ifdef CONFIG_UNIX98_PTYS
507 .ctl_name
= KERN_PTY
,
514 .ctl_name
= KERN_OVERFLOWUID
,
515 .procname
= "overflowuid",
516 .data
= &overflowuid
,
517 .maxlen
= sizeof(int),
519 .proc_handler
= &proc_dointvec_minmax
,
520 .strategy
= &sysctl_intvec
,
521 .extra1
= &minolduid
,
522 .extra2
= &maxolduid
,
525 .ctl_name
= KERN_OVERFLOWGID
,
526 .procname
= "overflowgid",
527 .data
= &overflowgid
,
528 .maxlen
= sizeof(int),
530 .proc_handler
= &proc_dointvec_minmax
,
531 .strategy
= &sysctl_intvec
,
532 .extra1
= &minolduid
,
533 .extra2
= &maxolduid
,
536 #ifdef CONFIG_MATHEMU
538 .ctl_name
= KERN_IEEE_EMULATION_WARNINGS
,
539 .procname
= "ieee_emulation_warnings",
540 .data
= &sysctl_ieee_emulation_warnings
,
541 .maxlen
= sizeof(int),
543 .proc_handler
= &proc_dointvec
,
546 #ifdef CONFIG_NO_IDLE_HZ
548 .ctl_name
= KERN_HZ_TIMER
,
549 .procname
= "hz_timer",
550 .data
= &sysctl_hz_timer
,
551 .maxlen
= sizeof(int),
553 .proc_handler
= &proc_dointvec
,
557 .ctl_name
= KERN_S390_USER_DEBUG_LOGGING
,
558 .procname
= "userprocess_debug",
559 .data
= &sysctl_userprocess_debug
,
560 .maxlen
= sizeof(int),
562 .proc_handler
= &proc_dointvec
,
566 .ctl_name
= KERN_PIDMAX
,
567 .procname
= "pid_max",
569 .maxlen
= sizeof (int),
571 .proc_handler
= &proc_dointvec_minmax
,
572 .strategy
= sysctl_intvec
,
573 .extra1
= &pid_max_min
,
574 .extra2
= &pid_max_max
,
577 .ctl_name
= KERN_PANIC_ON_OOPS
,
578 .procname
= "panic_on_oops",
579 .data
= &panic_on_oops
,
580 .maxlen
= sizeof(int),
582 .proc_handler
= &proc_dointvec
,
585 .ctl_name
= KERN_PRINTK_RATELIMIT
,
586 .procname
= "printk_ratelimit",
587 .data
= &printk_ratelimit_jiffies
,
588 .maxlen
= sizeof(int),
590 .proc_handler
= &proc_dointvec_jiffies
,
591 .strategy
= &sysctl_jiffies
,
594 .ctl_name
= KERN_PRINTK_RATELIMIT_BURST
,
595 .procname
= "printk_ratelimit_burst",
596 .data
= &printk_ratelimit_burst
,
597 .maxlen
= sizeof(int),
599 .proc_handler
= &proc_dointvec
,
602 .ctl_name
= KERN_NGROUPS_MAX
,
603 .procname
= "ngroups_max",
604 .data
= &ngroups_max
,
605 .maxlen
= sizeof (int),
607 .proc_handler
= &proc_dointvec
,
609 #if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86)
611 .ctl_name
= KERN_UNKNOWN_NMI_PANIC
,
612 .procname
= "unknown_nmi_panic",
613 .data
= &unknown_nmi_panic
,
614 .maxlen
= sizeof (int),
616 .proc_handler
= &proc_dointvec
,
619 .ctl_name
= KERN_NMI_WATCHDOG
,
620 .procname
= "nmi_watchdog",
621 .data
= &nmi_watchdog_enabled
,
622 .maxlen
= sizeof (int),
624 .proc_handler
= &proc_nmi_enabled
,
627 #if defined(CONFIG_X86)
629 .ctl_name
= KERN_PANIC_ON_NMI
,
630 .procname
= "panic_on_unrecovered_nmi",
631 .data
= &panic_on_unrecovered_nmi
,
632 .maxlen
= sizeof(int),
634 .proc_handler
= &proc_dointvec
,
637 .ctl_name
= KERN_BOOTLOADER_TYPE
,
638 .procname
= "bootloader_type",
639 .data
= &bootloader_type
,
640 .maxlen
= sizeof (int),
642 .proc_handler
= &proc_dointvec
,
645 .ctl_name
= CTL_UNNUMBERED
,
646 .procname
= "kstack_depth_to_print",
647 .data
= &kstack_depth_to_print
,
648 .maxlen
= sizeof(int),
650 .proc_handler
= &proc_dointvec
,
653 #if defined(CONFIG_MMU)
655 .ctl_name
= KERN_RANDOMIZE
,
656 .procname
= "randomize_va_space",
657 .data
= &randomize_va_space
,
658 .maxlen
= sizeof(int),
660 .proc_handler
= &proc_dointvec
,
663 #if defined(CONFIG_S390) && defined(CONFIG_SMP)
665 .ctl_name
= KERN_SPIN_RETRY
,
666 .procname
= "spin_retry",
668 .maxlen
= sizeof (int),
670 .proc_handler
= &proc_dointvec
,
673 #ifdef CONFIG_ACPI_SLEEP
675 .ctl_name
= KERN_ACPI_VIDEO_FLAGS
,
676 .procname
= "acpi_video_flags",
677 .data
= &acpi_video_flags
,
678 .maxlen
= sizeof (unsigned long),
680 .proc_handler
= &proc_doulongvec_minmax
,
685 .ctl_name
= KERN_IA64_UNALIGNED
,
686 .procname
= "ignore-unaligned-usertrap",
687 .data
= &no_unaligned_warning
,
688 .maxlen
= sizeof (int),
690 .proc_handler
= &proc_dointvec
,
695 .ctl_name
= KERN_COMPAT_LOG
,
696 .procname
= "compat-log",
698 .maxlen
= sizeof (int),
700 .proc_handler
= &proc_dointvec
,
703 #ifdef CONFIG_RT_MUTEXES
705 .ctl_name
= KERN_MAX_LOCK_DEPTH
,
706 .procname
= "max_lock_depth",
707 .data
= &max_lock_depth
,
708 .maxlen
= sizeof(int),
710 .proc_handler
= &proc_dointvec
,
717 /* Constants for minimum and maximum testing in vm_table.
718 We use these as one-element integer vectors. */
720 static int one_hundred
= 100;
723 static ctl_table vm_table
[] = {
725 .ctl_name
= VM_OVERCOMMIT_MEMORY
,
726 .procname
= "overcommit_memory",
727 .data
= &sysctl_overcommit_memory
,
728 .maxlen
= sizeof(sysctl_overcommit_memory
),
730 .proc_handler
= &proc_dointvec
,
733 .ctl_name
= VM_PANIC_ON_OOM
,
734 .procname
= "panic_on_oom",
735 .data
= &sysctl_panic_on_oom
,
736 .maxlen
= sizeof(sysctl_panic_on_oom
),
738 .proc_handler
= &proc_dointvec
,
741 .ctl_name
= VM_OVERCOMMIT_RATIO
,
742 .procname
= "overcommit_ratio",
743 .data
= &sysctl_overcommit_ratio
,
744 .maxlen
= sizeof(sysctl_overcommit_ratio
),
746 .proc_handler
= &proc_dointvec
,
749 .ctl_name
= VM_PAGE_CLUSTER
,
750 .procname
= "page-cluster",
751 .data
= &page_cluster
,
752 .maxlen
= sizeof(int),
754 .proc_handler
= &proc_dointvec
,
757 .ctl_name
= VM_DIRTY_BACKGROUND
,
758 .procname
= "dirty_background_ratio",
759 .data
= &dirty_background_ratio
,
760 .maxlen
= sizeof(dirty_background_ratio
),
762 .proc_handler
= &proc_dointvec_minmax
,
763 .strategy
= &sysctl_intvec
,
765 .extra2
= &one_hundred
,
768 .ctl_name
= VM_DIRTY_RATIO
,
769 .procname
= "dirty_ratio",
770 .data
= &vm_dirty_ratio
,
771 .maxlen
= sizeof(vm_dirty_ratio
),
773 .proc_handler
= &proc_dointvec_minmax
,
774 .strategy
= &sysctl_intvec
,
776 .extra2
= &one_hundred
,
779 .ctl_name
= VM_DIRTY_WB_CS
,
780 .procname
= "dirty_writeback_centisecs",
781 .data
= &dirty_writeback_interval
,
782 .maxlen
= sizeof(dirty_writeback_interval
),
784 .proc_handler
= &dirty_writeback_centisecs_handler
,
787 .ctl_name
= VM_DIRTY_EXPIRE_CS
,
788 .procname
= "dirty_expire_centisecs",
789 .data
= &dirty_expire_interval
,
790 .maxlen
= sizeof(dirty_expire_interval
),
792 .proc_handler
= &proc_dointvec_userhz_jiffies
,
795 .ctl_name
= VM_NR_PDFLUSH_THREADS
,
796 .procname
= "nr_pdflush_threads",
797 .data
= &nr_pdflush_threads
,
798 .maxlen
= sizeof nr_pdflush_threads
,
799 .mode
= 0444 /* read-only*/,
800 .proc_handler
= &proc_dointvec
,
803 .ctl_name
= VM_SWAPPINESS
,
804 .procname
= "swappiness",
805 .data
= &vm_swappiness
,
806 .maxlen
= sizeof(vm_swappiness
),
808 .proc_handler
= &proc_dointvec_minmax
,
809 .strategy
= &sysctl_intvec
,
811 .extra2
= &one_hundred
,
813 #ifdef CONFIG_HUGETLB_PAGE
815 .ctl_name
= VM_HUGETLB_PAGES
,
816 .procname
= "nr_hugepages",
817 .data
= &max_huge_pages
,
818 .maxlen
= sizeof(unsigned long),
820 .proc_handler
= &hugetlb_sysctl_handler
,
821 .extra1
= (void *)&hugetlb_zero
,
822 .extra2
= (void *)&hugetlb_infinity
,
825 .ctl_name
= VM_HUGETLB_GROUP
,
826 .procname
= "hugetlb_shm_group",
827 .data
= &sysctl_hugetlb_shm_group
,
828 .maxlen
= sizeof(gid_t
),
830 .proc_handler
= &proc_dointvec
,
834 .ctl_name
= VM_LOWMEM_RESERVE_RATIO
,
835 .procname
= "lowmem_reserve_ratio",
836 .data
= &sysctl_lowmem_reserve_ratio
,
837 .maxlen
= sizeof(sysctl_lowmem_reserve_ratio
),
839 .proc_handler
= &lowmem_reserve_ratio_sysctl_handler
,
840 .strategy
= &sysctl_intvec
,
843 .ctl_name
= VM_DROP_PAGECACHE
,
844 .procname
= "drop_caches",
845 .data
= &sysctl_drop_caches
,
846 .maxlen
= sizeof(int),
848 .proc_handler
= drop_caches_sysctl_handler
,
849 .strategy
= &sysctl_intvec
,
852 .ctl_name
= VM_MIN_FREE_KBYTES
,
853 .procname
= "min_free_kbytes",
854 .data
= &min_free_kbytes
,
855 .maxlen
= sizeof(min_free_kbytes
),
857 .proc_handler
= &min_free_kbytes_sysctl_handler
,
858 .strategy
= &sysctl_intvec
,
862 .ctl_name
= VM_PERCPU_PAGELIST_FRACTION
,
863 .procname
= "percpu_pagelist_fraction",
864 .data
= &percpu_pagelist_fraction
,
865 .maxlen
= sizeof(percpu_pagelist_fraction
),
867 .proc_handler
= &percpu_pagelist_fraction_sysctl_handler
,
868 .strategy
= &sysctl_intvec
,
869 .extra1
= &min_percpu_pagelist_fract
,
873 .ctl_name
= VM_MAX_MAP_COUNT
,
874 .procname
= "max_map_count",
875 .data
= &sysctl_max_map_count
,
876 .maxlen
= sizeof(sysctl_max_map_count
),
878 .proc_handler
= &proc_dointvec
882 .ctl_name
= VM_LAPTOP_MODE
,
883 .procname
= "laptop_mode",
884 .data
= &laptop_mode
,
885 .maxlen
= sizeof(laptop_mode
),
887 .proc_handler
= &proc_dointvec_jiffies
,
888 .strategy
= &sysctl_jiffies
,
891 .ctl_name
= VM_BLOCK_DUMP
,
892 .procname
= "block_dump",
894 .maxlen
= sizeof(block_dump
),
896 .proc_handler
= &proc_dointvec
,
897 .strategy
= &sysctl_intvec
,
901 .ctl_name
= VM_VFS_CACHE_PRESSURE
,
902 .procname
= "vfs_cache_pressure",
903 .data
= &sysctl_vfs_cache_pressure
,
904 .maxlen
= sizeof(sysctl_vfs_cache_pressure
),
906 .proc_handler
= &proc_dointvec
,
907 .strategy
= &sysctl_intvec
,
910 #ifdef HAVE_ARCH_PICK_MMAP_LAYOUT
912 .ctl_name
= VM_LEGACY_VA_LAYOUT
,
913 .procname
= "legacy_va_layout",
914 .data
= &sysctl_legacy_va_layout
,
915 .maxlen
= sizeof(sysctl_legacy_va_layout
),
917 .proc_handler
= &proc_dointvec
,
918 .strategy
= &sysctl_intvec
,
924 .ctl_name
= VM_ZONE_RECLAIM_MODE
,
925 .procname
= "zone_reclaim_mode",
926 .data
= &zone_reclaim_mode
,
927 .maxlen
= sizeof(zone_reclaim_mode
),
929 .proc_handler
= &proc_dointvec
,
930 .strategy
= &sysctl_intvec
,
934 .ctl_name
= VM_MIN_UNMAPPED
,
935 .procname
= "min_unmapped_ratio",
936 .data
= &sysctl_min_unmapped_ratio
,
937 .maxlen
= sizeof(sysctl_min_unmapped_ratio
),
939 .proc_handler
= &sysctl_min_unmapped_ratio_sysctl_handler
,
940 .strategy
= &sysctl_intvec
,
942 .extra2
= &one_hundred
,
945 .ctl_name
= VM_MIN_SLAB
,
946 .procname
= "min_slab_ratio",
947 .data
= &sysctl_min_slab_ratio
,
948 .maxlen
= sizeof(sysctl_min_slab_ratio
),
950 .proc_handler
= &sysctl_min_slab_ratio_sysctl_handler
,
951 .strategy
= &sysctl_intvec
,
953 .extra2
= &one_hundred
,
958 .ctl_name
= VM_VDSO_ENABLED
,
959 .procname
= "vdso_enabled",
960 .data
= &vdso_enabled
,
961 .maxlen
= sizeof(vdso_enabled
),
963 .proc_handler
= &proc_dointvec
,
964 .strategy
= &sysctl_intvec
,
971 static ctl_table fs_table
[] = {
973 .ctl_name
= FS_NRINODE
,
974 .procname
= "inode-nr",
975 .data
= &inodes_stat
,
976 .maxlen
= 2*sizeof(int),
978 .proc_handler
= &proc_dointvec
,
981 .ctl_name
= FS_STATINODE
,
982 .procname
= "inode-state",
983 .data
= &inodes_stat
,
984 .maxlen
= 7*sizeof(int),
986 .proc_handler
= &proc_dointvec
,
989 .ctl_name
= FS_NRFILE
,
990 .procname
= "file-nr",
992 .maxlen
= 3*sizeof(int),
994 .proc_handler
= &proc_nr_files
,
997 .ctl_name
= FS_MAXFILE
,
998 .procname
= "file-max",
999 .data
= &files_stat
.max_files
,
1000 .maxlen
= sizeof(int),
1002 .proc_handler
= &proc_dointvec
,
1005 .ctl_name
= FS_DENTRY
,
1006 .procname
= "dentry-state",
1007 .data
= &dentry_stat
,
1008 .maxlen
= 6*sizeof(int),
1010 .proc_handler
= &proc_dointvec
,
1013 .ctl_name
= FS_OVERFLOWUID
,
1014 .procname
= "overflowuid",
1015 .data
= &fs_overflowuid
,
1016 .maxlen
= sizeof(int),
1018 .proc_handler
= &proc_dointvec_minmax
,
1019 .strategy
= &sysctl_intvec
,
1020 .extra1
= &minolduid
,
1021 .extra2
= &maxolduid
,
1024 .ctl_name
= FS_OVERFLOWGID
,
1025 .procname
= "overflowgid",
1026 .data
= &fs_overflowgid
,
1027 .maxlen
= sizeof(int),
1029 .proc_handler
= &proc_dointvec_minmax
,
1030 .strategy
= &sysctl_intvec
,
1031 .extra1
= &minolduid
,
1032 .extra2
= &maxolduid
,
1035 .ctl_name
= FS_LEASES
,
1036 .procname
= "leases-enable",
1037 .data
= &leases_enable
,
1038 .maxlen
= sizeof(int),
1040 .proc_handler
= &proc_dointvec
,
1042 #ifdef CONFIG_DNOTIFY
1044 .ctl_name
= FS_DIR_NOTIFY
,
1045 .procname
= "dir-notify-enable",
1046 .data
= &dir_notify_enable
,
1047 .maxlen
= sizeof(int),
1049 .proc_handler
= &proc_dointvec
,
1054 .ctl_name
= FS_LEASE_TIME
,
1055 .procname
= "lease-break-time",
1056 .data
= &lease_break_time
,
1057 .maxlen
= sizeof(int),
1059 .proc_handler
= &proc_dointvec
,
1062 .ctl_name
= FS_AIO_NR
,
1063 .procname
= "aio-nr",
1065 .maxlen
= sizeof(aio_nr
),
1067 .proc_handler
= &proc_doulongvec_minmax
,
1070 .ctl_name
= FS_AIO_MAX_NR
,
1071 .procname
= "aio-max-nr",
1072 .data
= &aio_max_nr
,
1073 .maxlen
= sizeof(aio_max_nr
),
1075 .proc_handler
= &proc_doulongvec_minmax
,
1077 #ifdef CONFIG_INOTIFY_USER
1079 .ctl_name
= FS_INOTIFY
,
1080 .procname
= "inotify",
1082 .child
= inotify_table
,
1087 .ctl_name
= KERN_SETUID_DUMPABLE
,
1088 .procname
= "suid_dumpable",
1089 .data
= &suid_dumpable
,
1090 .maxlen
= sizeof(int),
1092 .proc_handler
= &proc_dointvec
,
1097 static ctl_table debug_table
[] = {
1101 static ctl_table dev_table
[] = {
1105 static DEFINE_SPINLOCK(sysctl_lock
);
1107 /* called under sysctl_lock */
1108 static int use_table(struct ctl_table_header
*p
)
1110 if (unlikely(p
->unregistering
))
1116 /* called under sysctl_lock */
1117 static void unuse_table(struct ctl_table_header
*p
)
1120 if (unlikely(p
->unregistering
))
1121 complete(p
->unregistering
);
1124 /* called under sysctl_lock, will reacquire if has to wait */
1125 static void start_unregistering(struct ctl_table_header
*p
)
1128 * if p->used is 0, nobody will ever touch that entry again;
1129 * we'll eliminate all paths to it before dropping sysctl_lock
1131 if (unlikely(p
->used
)) {
1132 struct completion wait
;
1133 init_completion(&wait
);
1134 p
->unregistering
= &wait
;
1135 spin_unlock(&sysctl_lock
);
1136 wait_for_completion(&wait
);
1137 spin_lock(&sysctl_lock
);
1140 * do not remove from the list until nobody holds it; walking the
1141 * list in do_sysctl() relies on that.
1143 list_del_init(&p
->ctl_entry
);
1146 void __init
sysctl_init(void)
1148 #ifdef CONFIG_PROC_SYSCTL
1149 register_proc_table(root_table
, proc_sys_root
, &root_table_header
);
1153 #ifdef CONFIG_SYSCTL_SYSCALL
1154 int do_sysctl(int __user
*name
, int nlen
, void __user
*oldval
, size_t __user
*oldlenp
,
1155 void __user
*newval
, size_t newlen
)
1157 struct list_head
*tmp
;
1158 int error
= -ENOTDIR
;
1160 if (nlen
<= 0 || nlen
>= CTL_MAXNAME
)
1164 if (!oldlenp
|| get_user(old_len
, oldlenp
))
1167 spin_lock(&sysctl_lock
);
1168 tmp
= &root_table_header
.ctl_entry
;
1170 struct ctl_table_header
*head
=
1171 list_entry(tmp
, struct ctl_table_header
, ctl_entry
);
1173 if (!use_table(head
))
1176 spin_unlock(&sysctl_lock
);
1178 error
= parse_table(name
, nlen
, oldval
, oldlenp
,
1179 newval
, newlen
, head
->ctl_table
);
1181 spin_lock(&sysctl_lock
);
1183 if (error
!= -ENOTDIR
)
1185 } while ((tmp
= tmp
->next
) != &root_table_header
.ctl_entry
);
1186 spin_unlock(&sysctl_lock
);
1190 asmlinkage
long sys_sysctl(struct __sysctl_args __user
*args
)
1192 struct __sysctl_args tmp
;
1195 if (copy_from_user(&tmp
, args
, sizeof(tmp
)))
1199 error
= do_sysctl(tmp
.name
, tmp
.nlen
, tmp
.oldval
, tmp
.oldlenp
,
1200 tmp
.newval
, tmp
.newlen
);
1204 #endif /* CONFIG_SYSCTL_SYSCALL */
1207 * ctl_perm does NOT grant the superuser all rights automatically, because
1208 * some sysctl variables are readonly even to root.
1211 static int test_perm(int mode
, int op
)
1215 else if (in_egroup_p(0))
1217 if ((mode
& op
& 0007) == op
)
1222 static inline int ctl_perm(ctl_table
*table
, int op
)
1225 error
= security_sysctl(table
, op
);
1228 return test_perm(table
->mode
, op
);
1231 #ifdef CONFIG_SYSCTL_SYSCALL
1232 static int parse_table(int __user
*name
, int nlen
,
1233 void __user
*oldval
, size_t __user
*oldlenp
,
1234 void __user
*newval
, size_t newlen
,
1241 if (get_user(n
, name
))
1243 for ( ; table
->ctl_name
|| table
->procname
; table
++) {
1244 if (!table
->ctl_name
)
1246 if (n
== table
->ctl_name
|| table
->ctl_name
== CTL_ANY
) {
1249 if (ctl_perm(table
, 001))
1251 if (table
->strategy
) {
1252 error
= table
->strategy(
1261 table
= table
->child
;
1264 error
= do_sysctl_strategy(table
, name
, nlen
,
1273 /* Perform the actual read/write of a sysctl table entry. */
1274 int do_sysctl_strategy (ctl_table
*table
,
1275 int __user
*name
, int nlen
,
1276 void __user
*oldval
, size_t __user
*oldlenp
,
1277 void __user
*newval
, size_t newlen
)
1286 if (ctl_perm(table
, op
))
1289 if (table
->strategy
) {
1290 rc
= table
->strategy(table
, name
, nlen
, oldval
, oldlenp
,
1298 /* If there is no strategy routine, or if the strategy returns
1299 * zero, proceed with automatic r/w */
1300 if (table
->data
&& table
->maxlen
) {
1301 if (oldval
&& oldlenp
) {
1302 if (get_user(len
, oldlenp
))
1305 if (len
> table
->maxlen
)
1306 len
= table
->maxlen
;
1307 if(copy_to_user(oldval
, table
->data
, len
))
1309 if(put_user(len
, oldlenp
))
1313 if (newval
&& newlen
) {
1315 if (len
> table
->maxlen
)
1316 len
= table
->maxlen
;
1317 if(copy_from_user(table
->data
, newval
, len
))
1323 #endif /* CONFIG_SYSCTL_SYSCALL */
1326 * register_sysctl_table - register a sysctl hierarchy
1327 * @table: the top-level table structure
1328 * @insert_at_head: whether the entry should be inserted in front or at the end
1330 * Register a sysctl table hierarchy. @table should be a filled in ctl_table
1331 * array. An entry with a ctl_name of 0 terminates the table.
1333 * The members of the &ctl_table structure are used as follows:
1335 * ctl_name - This is the numeric sysctl value used by sysctl(2). The number
1336 * must be unique within that level of sysctl
1338 * procname - the name of the sysctl file under /proc/sys. Set to %NULL to not
1339 * enter a sysctl file
1341 * data - a pointer to data for use by proc_handler
1343 * maxlen - the maximum size in bytes of the data
1345 * mode - the file permissions for the /proc/sys file, and for sysctl(2)
1347 * child - a pointer to the child sysctl table if this entry is a directory, or
1350 * proc_handler - the text handler routine (described below)
1352 * strategy - the strategy routine (described below)
1354 * de - for internal use by the sysctl routines
1356 * extra1, extra2 - extra pointers usable by the proc handler routines
1358 * Leaf nodes in the sysctl tree will be represented by a single file
1359 * under /proc; non-leaf nodes will be represented by directories.
1361 * sysctl(2) can automatically manage read and write requests through
1362 * the sysctl table. The data and maxlen fields of the ctl_table
1363 * struct enable minimal validation of the values being written to be
1364 * performed, and the mode field allows minimal authentication.
1366 * More sophisticated management can be enabled by the provision of a
1367 * strategy routine with the table entry. This will be called before
1368 * any automatic read or write of the data is performed.
1370 * The strategy routine may return
1372 * < 0 - Error occurred (error is passed to user process)
1374 * 0 - OK - proceed with automatic read or write.
1376 * > 0 - OK - read or write has been done by the strategy routine, so
1377 * return immediately.
1379 * There must be a proc_handler routine for any terminal nodes
1380 * mirrored under /proc/sys (non-terminals are handled by a built-in
1381 * directory handler). Several default handlers are available to
1382 * cover common cases -
1384 * proc_dostring(), proc_dointvec(), proc_dointvec_jiffies(),
1385 * proc_dointvec_userhz_jiffies(), proc_dointvec_minmax(),
1386 * proc_doulongvec_ms_jiffies_minmax(), proc_doulongvec_minmax()
1388 * It is the handler's job to read the input buffer from user memory
1389 * and process it. The handler should return 0 on success.
1391 * This routine returns %NULL on a failure to register, and a pointer
1392 * to the table header on success.
1394 struct ctl_table_header
*register_sysctl_table(ctl_table
* table
,
1397 struct ctl_table_header
*tmp
;
1398 tmp
= kmalloc(sizeof(struct ctl_table_header
), GFP_KERNEL
);
1401 tmp
->ctl_table
= table
;
1402 INIT_LIST_HEAD(&tmp
->ctl_entry
);
1404 tmp
->unregistering
= NULL
;
1405 spin_lock(&sysctl_lock
);
1407 list_add(&tmp
->ctl_entry
, &root_table_header
.ctl_entry
);
1409 list_add_tail(&tmp
->ctl_entry
, &root_table_header
.ctl_entry
);
1410 spin_unlock(&sysctl_lock
);
1411 #ifdef CONFIG_PROC_SYSCTL
1412 register_proc_table(table
, proc_sys_root
, tmp
);
1418 * unregister_sysctl_table - unregister a sysctl table hierarchy
1419 * @header: the header returned from register_sysctl_table
1421 * Unregisters the sysctl table and all children. proc entries may not
1422 * actually be removed until they are no longer used by anyone.
1424 void unregister_sysctl_table(struct ctl_table_header
* header
)
1427 spin_lock(&sysctl_lock
);
1428 start_unregistering(header
);
1429 #ifdef CONFIG_PROC_SYSCTL
1430 unregister_proc_table(header
->ctl_table
, proc_sys_root
);
1432 spin_unlock(&sysctl_lock
);
1436 #else /* !CONFIG_SYSCTL */
1437 struct ctl_table_header
* register_sysctl_table(ctl_table
* table
,
1443 void unregister_sysctl_table(struct ctl_table_header
* table
)
1447 #endif /* CONFIG_SYSCTL */
1453 #ifdef CONFIG_PROC_SYSCTL
1455 /* Scan the sysctl entries in table and add them all into /proc */
1456 static void register_proc_table(ctl_table
* table
, struct proc_dir_entry
*root
, void *set
)
1458 struct proc_dir_entry
*de
;
1462 for (; table
->ctl_name
|| table
->procname
; table
++) {
1463 /* Can't do anything without a proc name. */
1464 if (!table
->procname
)
1466 /* Maybe we can't do anything with it... */
1467 if (!table
->proc_handler
&& !table
->child
) {
1468 printk(KERN_WARNING
"SYSCTL: Can't register %s\n",
1473 len
= strlen(table
->procname
);
1477 if (table
->proc_handler
)
1481 for (de
= root
->subdir
; de
; de
= de
->next
) {
1482 if (proc_match(len
, table
->procname
, de
))
1485 /* If the subdir exists already, de is non-NULL */
1489 de
= create_proc_entry(table
->procname
, mode
, root
);
1493 de
->data
= (void *) table
;
1494 if (table
->proc_handler
)
1495 de
->proc_fops
= &proc_sys_file_operations
;
1498 if (de
->mode
& S_IFDIR
)
1499 register_proc_table(table
->child
, de
, set
);
1504 * Unregister a /proc sysctl table and any subdirectories.
1506 static void unregister_proc_table(ctl_table
* table
, struct proc_dir_entry
*root
)
1508 struct proc_dir_entry
*de
;
1509 for (; table
->ctl_name
|| table
->procname
; table
++) {
1510 if (!(de
= table
->de
))
1512 if (de
->mode
& S_IFDIR
) {
1513 if (!table
->child
) {
1514 printk (KERN_ALERT
"Help - malformed sysctl tree on free\n");
1517 unregister_proc_table(table
->child
, de
);
1519 /* Don't unregister directories which still have entries.. */
1525 * In any case, mark the entry as goner; we'll keep it
1526 * around if it's busy, but we'll know to do nothing with
1527 * its fields. We are under sysctl_lock here.
1531 /* Don't unregister proc entries that are still being used.. */
1532 if (atomic_read(&de
->count
))
1536 remove_proc_entry(table
->procname
, root
);
1540 static ssize_t
do_rw_proc(int write
, struct file
* file
, char __user
* buf
,
1541 size_t count
, loff_t
*ppos
)
1544 struct proc_dir_entry
*de
= PDE(file
->f_path
.dentry
->d_inode
);
1545 struct ctl_table
*table
;
1547 ssize_t error
= -ENOTDIR
;
1549 spin_lock(&sysctl_lock
);
1550 if (de
&& de
->data
&& use_table(de
->set
)) {
1552 * at that point we know that sysctl was not unregistered
1553 * and won't be until we finish
1555 spin_unlock(&sysctl_lock
);
1556 table
= (struct ctl_table
*) de
->data
;
1557 if (!table
|| !table
->proc_handler
)
1560 op
= (write
? 002 : 004);
1561 if (ctl_perm(table
, op
))
1564 /* careful: calling conventions are nasty here */
1566 error
= (*table
->proc_handler
)(table
, write
, file
,
1571 spin_lock(&sysctl_lock
);
1572 unuse_table(de
->set
);
1574 spin_unlock(&sysctl_lock
);
1578 static int proc_opensys(struct inode
*inode
, struct file
*file
)
1580 if (file
->f_mode
& FMODE_WRITE
) {
1582 * sysctl entries that are not writable,
1583 * are _NOT_ writable, capabilities or not.
1585 if (!(inode
->i_mode
& S_IWUSR
))
1592 static ssize_t
proc_readsys(struct file
* file
, char __user
* buf
,
1593 size_t count
, loff_t
*ppos
)
1595 return do_rw_proc(0, file
, buf
, count
, ppos
);
1598 static ssize_t
proc_writesys(struct file
* file
, const char __user
* buf
,
1599 size_t count
, loff_t
*ppos
)
1601 return do_rw_proc(1, file
, (char __user
*) buf
, count
, ppos
);
1604 static int _proc_do_string(void* data
, int maxlen
, int write
,
1605 struct file
*filp
, void __user
*buffer
,
1606 size_t *lenp
, loff_t
*ppos
)
1612 if (!data
|| !maxlen
|| !*lenp
) {
1620 while (len
< *lenp
) {
1621 if (get_user(c
, p
++))
1623 if (c
== 0 || c
== '\n')
1629 if(copy_from_user(data
, buffer
, len
))
1631 ((char *) data
)[len
] = 0;
1649 if(copy_to_user(buffer
, data
, len
))
1652 if(put_user('\n', ((char __user
*) buffer
) + len
))
1663 * proc_dostring - read a string sysctl
1664 * @table: the sysctl table
1665 * @write: %TRUE if this is a write to the sysctl file
1666 * @filp: the file structure
1667 * @buffer: the user buffer
1668 * @lenp: the size of the user buffer
1669 * @ppos: file position
1671 * Reads/writes a string from/to the user buffer. If the kernel
1672 * buffer provided is not large enough to hold the string, the
1673 * string is truncated. The copied string is %NULL-terminated.
1674 * If the string is being read by the user process, it is copied
1675 * and a newline '\n' is added. It is truncated if the buffer is
1678 * Returns 0 on success.
1680 int proc_dostring(ctl_table
*table
, int write
, struct file
*filp
,
1681 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
)
1683 return _proc_do_string(table
->data
, table
->maxlen
, write
, filp
,
1684 buffer
, lenp
, ppos
);
1688 static int do_proc_dointvec_conv(int *negp
, unsigned long *lvalp
,
1690 int write
, void *data
)
1693 *valp
= *negp
? -*lvalp
: *lvalp
;
1698 *lvalp
= (unsigned long)-val
;
1701 *lvalp
= (unsigned long)val
;
1707 static int __do_proc_dointvec(void *tbl_data
, ctl_table
*table
,
1708 int write
, struct file
*filp
, void __user
*buffer
,
1709 size_t *lenp
, loff_t
*ppos
,
1710 int (*conv
)(int *negp
, unsigned long *lvalp
, int *valp
,
1711 int write
, void *data
),
1714 #define TMPBUFLEN 21
1715 int *i
, vleft
, first
=1, neg
, val
;
1719 char buf
[TMPBUFLEN
], *p
;
1720 char __user
*s
= buffer
;
1722 if (!tbl_data
|| !table
->maxlen
|| !*lenp
||
1723 (*ppos
&& !write
)) {
1728 i
= (int *) tbl_data
;
1729 vleft
= table
->maxlen
/ sizeof(*i
);
1733 conv
= do_proc_dointvec_conv
;
1735 for (; left
&& vleft
--; i
++, first
=0) {
1750 if (len
> sizeof(buf
) - 1)
1751 len
= sizeof(buf
) - 1;
1752 if (copy_from_user(buf
, s
, len
))
1756 if (*p
== '-' && left
> 1) {
1760 if (*p
< '0' || *p
> '9')
1763 lval
= simple_strtoul(p
, &p
, 0);
1766 if ((len
< left
) && *p
&& !isspace(*p
))
1773 if (conv(&neg
, &lval
, i
, 1, data
))
1780 if (conv(&neg
, &lval
, i
, 0, data
))
1783 sprintf(p
, "%s%lu", neg
? "-" : "", lval
);
1787 if(copy_to_user(s
, buf
, len
))
1794 if (!write
&& !first
&& left
) {
1795 if(put_user('\n', s
))
1802 if (get_user(c
, s
++))
1817 static int do_proc_dointvec(ctl_table
*table
, int write
, struct file
*filp
,
1818 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
,
1819 int (*conv
)(int *negp
, unsigned long *lvalp
, int *valp
,
1820 int write
, void *data
),
1823 return __do_proc_dointvec(table
->data
, table
, write
, filp
,
1824 buffer
, lenp
, ppos
, conv
, data
);
1828 * proc_dointvec - read a vector of integers
1829 * @table: the sysctl table
1830 * @write: %TRUE if this is a write to the sysctl file
1831 * @filp: the file structure
1832 * @buffer: the user buffer
1833 * @lenp: the size of the user buffer
1834 * @ppos: file position
1836 * Reads/writes up to table->maxlen/sizeof(unsigned int) integer
1837 * values from/to the user buffer, treated as an ASCII string.
1839 * Returns 0 on success.
1841 int proc_dointvec(ctl_table
*table
, int write
, struct file
*filp
,
1842 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
)
1844 return do_proc_dointvec(table
,write
,filp
,buffer
,lenp
,ppos
,
1852 static int do_proc_dointvec_bset_conv(int *negp
, unsigned long *lvalp
,
1854 int write
, void *data
)
1856 int op
= *(int *)data
;
1858 int val
= *negp
? -*lvalp
: *lvalp
;
1860 case OP_SET
: *valp
= val
; break;
1861 case OP_AND
: *valp
&= val
; break;
1862 case OP_OR
: *valp
|= val
; break;
1868 *lvalp
= (unsigned long)-val
;
1871 *lvalp
= (unsigned long)val
;
1878 * init may raise the set.
1881 int proc_dointvec_bset(ctl_table
*table
, int write
, struct file
*filp
,
1882 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
)
1886 if (write
&& !capable(CAP_SYS_MODULE
)) {
1890 op
= is_init(current
) ? OP_SET
: OP_AND
;
1891 return do_proc_dointvec(table
,write
,filp
,buffer
,lenp
,ppos
,
1892 do_proc_dointvec_bset_conv
,&op
);
1896 * Taint values can only be increased
1898 static int proc_dointvec_taint(ctl_table
*table
, int write
, struct file
*filp
,
1899 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
)
1903 if (!capable(CAP_SYS_ADMIN
))
1907 return do_proc_dointvec(table
,write
,filp
,buffer
,lenp
,ppos
,
1908 do_proc_dointvec_bset_conv
,&op
);
1911 struct do_proc_dointvec_minmax_conv_param
{
1916 static int do_proc_dointvec_minmax_conv(int *negp
, unsigned long *lvalp
,
1918 int write
, void *data
)
1920 struct do_proc_dointvec_minmax_conv_param
*param
= data
;
1922 int val
= *negp
? -*lvalp
: *lvalp
;
1923 if ((param
->min
&& *param
->min
> val
) ||
1924 (param
->max
&& *param
->max
< val
))
1931 *lvalp
= (unsigned long)-val
;
1934 *lvalp
= (unsigned long)val
;
1941 * proc_dointvec_minmax - read a vector of integers with min/max values
1942 * @table: the sysctl table
1943 * @write: %TRUE if this is a write to the sysctl file
1944 * @filp: the file structure
1945 * @buffer: the user buffer
1946 * @lenp: the size of the user buffer
1947 * @ppos: file position
1949 * Reads/writes up to table->maxlen/sizeof(unsigned int) integer
1950 * values from/to the user buffer, treated as an ASCII string.
1952 * This routine will ensure the values are within the range specified by
1953 * table->extra1 (min) and table->extra2 (max).
1955 * Returns 0 on success.
1957 int proc_dointvec_minmax(ctl_table
*table
, int write
, struct file
*filp
,
1958 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
)
1960 struct do_proc_dointvec_minmax_conv_param param
= {
1961 .min
= (int *) table
->extra1
,
1962 .max
= (int *) table
->extra2
,
1964 return do_proc_dointvec(table
, write
, filp
, buffer
, lenp
, ppos
,
1965 do_proc_dointvec_minmax_conv
, ¶m
);
1968 static int __do_proc_doulongvec_minmax(void *data
, ctl_table
*table
, int write
,
1970 void __user
*buffer
,
1971 size_t *lenp
, loff_t
*ppos
,
1972 unsigned long convmul
,
1973 unsigned long convdiv
)
1975 #define TMPBUFLEN 21
1976 unsigned long *i
, *min
, *max
, val
;
1977 int vleft
, first
=1, neg
;
1979 char buf
[TMPBUFLEN
], *p
;
1980 char __user
*s
= buffer
;
1982 if (!data
|| !table
->maxlen
|| !*lenp
||
1983 (*ppos
&& !write
)) {
1988 i
= (unsigned long *) data
;
1989 min
= (unsigned long *) table
->extra1
;
1990 max
= (unsigned long *) table
->extra2
;
1991 vleft
= table
->maxlen
/ sizeof(unsigned long);
1994 for (; left
&& vleft
--; i
++, min
++, max
++, first
=0) {
2009 if (len
> TMPBUFLEN
-1)
2011 if (copy_from_user(buf
, s
, len
))
2015 if (*p
== '-' && left
> 1) {
2019 if (*p
< '0' || *p
> '9')
2021 val
= simple_strtoul(p
, &p
, 0) * convmul
/ convdiv
;
2023 if ((len
< left
) && *p
&& !isspace(*p
))
2032 if ((min
&& val
< *min
) || (max
&& val
> *max
))
2039 sprintf(p
, "%lu", convdiv
* (*i
) / convmul
);
2043 if(copy_to_user(s
, buf
, len
))
2050 if (!write
&& !first
&& left
) {
2051 if(put_user('\n', s
))
2058 if (get_user(c
, s
++))
2073 static int do_proc_doulongvec_minmax(ctl_table
*table
, int write
,
2075 void __user
*buffer
,
2076 size_t *lenp
, loff_t
*ppos
,
2077 unsigned long convmul
,
2078 unsigned long convdiv
)
2080 return __do_proc_doulongvec_minmax(table
->data
, table
, write
,
2081 filp
, buffer
, lenp
, ppos
, convmul
, convdiv
);
2085 * proc_doulongvec_minmax - read a vector of long integers with min/max values
2086 * @table: the sysctl table
2087 * @write: %TRUE if this is a write to the sysctl file
2088 * @filp: the file structure
2089 * @buffer: the user buffer
2090 * @lenp: the size of the user buffer
2091 * @ppos: file position
2093 * Reads/writes up to table->maxlen/sizeof(unsigned long) unsigned long
2094 * values from/to the user buffer, treated as an ASCII string.
2096 * This routine will ensure the values are within the range specified by
2097 * table->extra1 (min) and table->extra2 (max).
2099 * Returns 0 on success.
2101 int proc_doulongvec_minmax(ctl_table
*table
, int write
, struct file
*filp
,
2102 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
)
2104 return do_proc_doulongvec_minmax(table
, write
, filp
, buffer
, lenp
, ppos
, 1l, 1l);
2108 * proc_doulongvec_ms_jiffies_minmax - read a vector of millisecond values with min/max values
2109 * @table: the sysctl table
2110 * @write: %TRUE if this is a write to the sysctl file
2111 * @filp: the file structure
2112 * @buffer: the user buffer
2113 * @lenp: the size of the user buffer
2114 * @ppos: file position
2116 * Reads/writes up to table->maxlen/sizeof(unsigned long) unsigned long
2117 * values from/to the user buffer, treated as an ASCII string. The values
2118 * are treated as milliseconds, and converted to jiffies when they are stored.
2120 * This routine will ensure the values are within the range specified by
2121 * table->extra1 (min) and table->extra2 (max).
2123 * Returns 0 on success.
2125 int proc_doulongvec_ms_jiffies_minmax(ctl_table
*table
, int write
,
2127 void __user
*buffer
,
2128 size_t *lenp
, loff_t
*ppos
)
2130 return do_proc_doulongvec_minmax(table
, write
, filp
, buffer
,
2131 lenp
, ppos
, HZ
, 1000l);
2135 static int do_proc_dointvec_jiffies_conv(int *negp
, unsigned long *lvalp
,
2137 int write
, void *data
)
2140 if (*lvalp
> LONG_MAX
/ HZ
)
2142 *valp
= *negp
? -(*lvalp
*HZ
) : (*lvalp
*HZ
);
2148 lval
= (unsigned long)-val
;
2151 lval
= (unsigned long)val
;
2158 static int do_proc_dointvec_userhz_jiffies_conv(int *negp
, unsigned long *lvalp
,
2160 int write
, void *data
)
2163 if (USER_HZ
< HZ
&& *lvalp
> (LONG_MAX
/ HZ
) * USER_HZ
)
2165 *valp
= clock_t_to_jiffies(*negp
? -*lvalp
: *lvalp
);
2171 lval
= (unsigned long)-val
;
2174 lval
= (unsigned long)val
;
2176 *lvalp
= jiffies_to_clock_t(lval
);
2181 static int do_proc_dointvec_ms_jiffies_conv(int *negp
, unsigned long *lvalp
,
2183 int write
, void *data
)
2186 *valp
= msecs_to_jiffies(*negp
? -*lvalp
: *lvalp
);
2192 lval
= (unsigned long)-val
;
2195 lval
= (unsigned long)val
;
2197 *lvalp
= jiffies_to_msecs(lval
);
2203 * proc_dointvec_jiffies - read a vector of integers as seconds
2204 * @table: the sysctl table
2205 * @write: %TRUE if this is a write to the sysctl file
2206 * @filp: the file structure
2207 * @buffer: the user buffer
2208 * @lenp: the size of the user buffer
2209 * @ppos: file position
2211 * Reads/writes up to table->maxlen/sizeof(unsigned int) integer
2212 * values from/to the user buffer, treated as an ASCII string.
2213 * The values read are assumed to be in seconds, and are converted into
2216 * Returns 0 on success.
2218 int proc_dointvec_jiffies(ctl_table
*table
, int write
, struct file
*filp
,
2219 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
)
2221 return do_proc_dointvec(table
,write
,filp
,buffer
,lenp
,ppos
,
2222 do_proc_dointvec_jiffies_conv
,NULL
);
2226 * proc_dointvec_userhz_jiffies - read a vector of integers as 1/USER_HZ seconds
2227 * @table: the sysctl table
2228 * @write: %TRUE if this is a write to the sysctl file
2229 * @filp: the file structure
2230 * @buffer: the user buffer
2231 * @lenp: the size of the user buffer
2232 * @ppos: pointer to the file position
2234 * Reads/writes up to table->maxlen/sizeof(unsigned int) integer
2235 * values from/to the user buffer, treated as an ASCII string.
2236 * The values read are assumed to be in 1/USER_HZ seconds, and
2237 * are converted into jiffies.
2239 * Returns 0 on success.
2241 int proc_dointvec_userhz_jiffies(ctl_table
*table
, int write
, struct file
*filp
,
2242 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
)
2244 return do_proc_dointvec(table
,write
,filp
,buffer
,lenp
,ppos
,
2245 do_proc_dointvec_userhz_jiffies_conv
,NULL
);
2249 * proc_dointvec_ms_jiffies - read a vector of integers as 1 milliseconds
2250 * @table: the sysctl table
2251 * @write: %TRUE if this is a write to the sysctl file
2252 * @filp: the file structure
2253 * @buffer: the user buffer
2254 * @lenp: the size of the user buffer
2255 * @ppos: file position
2256 * @ppos: the current position in the file
2258 * Reads/writes up to table->maxlen/sizeof(unsigned int) integer
2259 * values from/to the user buffer, treated as an ASCII string.
2260 * The values read are assumed to be in 1/1000 seconds, and
2261 * are converted into jiffies.
2263 * Returns 0 on success.
2265 int proc_dointvec_ms_jiffies(ctl_table
*table
, int write
, struct file
*filp
,
2266 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
)
2268 return do_proc_dointvec(table
, write
, filp
, buffer
, lenp
, ppos
,
2269 do_proc_dointvec_ms_jiffies_conv
, NULL
);
2272 #ifdef CONFIG_SYSVIPC
2273 static int proc_ipc_dointvec(ctl_table
*table
, int write
, struct file
*filp
,
2274 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
)
2277 which
= get_ipc(table
, write
);
2278 return __do_proc_dointvec(which
, table
, write
, filp
, buffer
,
2279 lenp
, ppos
, NULL
, NULL
);
2282 static int proc_ipc_doulongvec_minmax(ctl_table
*table
, int write
,
2283 struct file
*filp
, void __user
*buffer
, size_t *lenp
, loff_t
*ppos
)
2286 which
= get_ipc(table
, write
);
2287 return __do_proc_doulongvec_minmax(which
, table
, write
, filp
, buffer
,
2288 lenp
, ppos
, 1l, 1l);
2293 static int proc_do_cad_pid(ctl_table
*table
, int write
, struct file
*filp
,
2294 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
)
2296 struct pid
*new_pid
;
2300 tmp
= pid_nr(cad_pid
);
2302 r
= __do_proc_dointvec(&tmp
, table
, write
, filp
, buffer
,
2303 lenp
, ppos
, NULL
, NULL
);
2307 new_pid
= find_get_pid(tmp
);
2311 put_pid(xchg(&cad_pid
, new_pid
));
2315 #else /* CONFIG_PROC_FS */
2317 int proc_dostring(ctl_table
*table
, int write
, struct file
*filp
,
2318 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
)
2323 #ifdef CONFIG_SYSVIPC
2324 static int proc_do_ipc_string(ctl_table
*table
, int write
, struct file
*filp
,
2325 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
)
2329 static int proc_ipc_dointvec(ctl_table
*table
, int write
, struct file
*filp
,
2330 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
)
2334 static int proc_ipc_doulongvec_minmax(ctl_table
*table
, int write
,
2335 struct file
*filp
, void __user
*buffer
,
2336 size_t *lenp
, loff_t
*ppos
)
2342 int proc_dointvec(ctl_table
*table
, int write
, struct file
*filp
,
2343 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
)
2348 int proc_dointvec_bset(ctl_table
*table
, int write
, struct file
*filp
,
2349 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
)
2354 int proc_dointvec_minmax(ctl_table
*table
, int write
, struct file
*filp
,
2355 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
)
2360 int proc_dointvec_jiffies(ctl_table
*table
, int write
, struct file
*filp
,
2361 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
)
2366 int proc_dointvec_userhz_jiffies(ctl_table
*table
, int write
, struct file
*filp
,
2367 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
)
2372 int proc_dointvec_ms_jiffies(ctl_table
*table
, int write
, struct file
*filp
,
2373 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
)
2378 int proc_doulongvec_minmax(ctl_table
*table
, int write
, struct file
*filp
,
2379 void __user
*buffer
, size_t *lenp
, loff_t
*ppos
)
2384 int proc_doulongvec_ms_jiffies_minmax(ctl_table
*table
, int write
,
2386 void __user
*buffer
,
2387 size_t *lenp
, loff_t
*ppos
)
2393 #endif /* CONFIG_PROC_FS */
2396 #ifdef CONFIG_SYSCTL_SYSCALL
2398 * General sysctl support routines
2401 /* The generic string strategy routine: */
2402 int sysctl_string(ctl_table
*table
, int __user
*name
, int nlen
,
2403 void __user
*oldval
, size_t __user
*oldlenp
,
2404 void __user
*newval
, size_t newlen
)
2406 if (!table
->data
|| !table
->maxlen
)
2409 if (oldval
&& oldlenp
) {
2411 if (get_user(bufsize
, oldlenp
))
2414 size_t len
= strlen(table
->data
), copied
;
2416 /* This shouldn't trigger for a well-formed sysctl */
2417 if (len
> table
->maxlen
)
2418 len
= table
->maxlen
;
2420 /* Copy up to a max of bufsize-1 bytes of the string */
2421 copied
= (len
>= bufsize
) ? bufsize
- 1 : len
;
2423 if (copy_to_user(oldval
, table
->data
, copied
) ||
2424 put_user(0, (char __user
*)(oldval
+ copied
)))
2426 if (put_user(len
, oldlenp
))
2430 if (newval
&& newlen
) {
2431 size_t len
= newlen
;
2432 if (len
> table
->maxlen
)
2433 len
= table
->maxlen
;
2434 if(copy_from_user(table
->data
, newval
, len
))
2436 if (len
== table
->maxlen
)
2438 ((char *) table
->data
)[len
] = 0;
2444 * This function makes sure that all of the integers in the vector
2445 * are between the minimum and maximum values given in the arrays
2446 * table->extra1 and table->extra2, respectively.
2448 int sysctl_intvec(ctl_table
*table
, int __user
*name
, int nlen
,
2449 void __user
*oldval
, size_t __user
*oldlenp
,
2450 void __user
*newval
, size_t newlen
)
2453 if (newval
&& newlen
) {
2454 int __user
*vec
= (int __user
*) newval
;
2455 int *min
= (int *) table
->extra1
;
2456 int *max
= (int *) table
->extra2
;
2460 if (newlen
% sizeof(int) != 0)
2463 if (!table
->extra1
&& !table
->extra2
)
2466 if (newlen
> table
->maxlen
)
2467 newlen
= table
->maxlen
;
2468 length
= newlen
/ sizeof(int);
2470 for (i
= 0; i
< length
; i
++) {
2472 if (get_user(value
, vec
+ i
))
2474 if (min
&& value
< min
[i
])
2476 if (max
&& value
> max
[i
])
2483 /* Strategy function to convert jiffies to seconds */
2484 int sysctl_jiffies(ctl_table
*table
, int __user
*name
, int nlen
,
2485 void __user
*oldval
, size_t __user
*oldlenp
,
2486 void __user
*newval
, size_t newlen
)
2488 if (oldval
&& oldlenp
) {
2491 if (get_user(olen
, oldlenp
))
2496 if (olen
< sizeof(int))
2499 val
= *(int *)(table
->data
) / HZ
;
2500 if (put_user(val
, (int __user
*)oldval
))
2502 if (put_user(sizeof(int), oldlenp
))
2506 if (newval
&& newlen
) {
2508 if (newlen
!= sizeof(int))
2510 if (get_user(new, (int __user
*)newval
))
2512 *(int *)(table
->data
) = new*HZ
;
2517 /* Strategy function to convert jiffies to seconds */
2518 int sysctl_ms_jiffies(ctl_table
*table
, int __user
*name
, int nlen
,
2519 void __user
*oldval
, size_t __user
*oldlenp
,
2520 void __user
*newval
, size_t newlen
)
2522 if (oldval
&& oldlenp
) {
2525 if (get_user(olen
, oldlenp
))
2530 if (olen
< sizeof(int))
2533 val
= jiffies_to_msecs(*(int *)(table
->data
));
2534 if (put_user(val
, (int __user
*)oldval
))
2536 if (put_user(sizeof(int), oldlenp
))
2540 if (newval
&& newlen
) {
2542 if (newlen
!= sizeof(int))
2544 if (get_user(new, (int __user
*)newval
))
2546 *(int *)(table
->data
) = msecs_to_jiffies(new);
2553 #ifdef CONFIG_SYSVIPC
2554 /* The generic sysctl ipc data routine. */
2555 static int sysctl_ipc_data(ctl_table
*table
, int __user
*name
, int nlen
,
2556 void __user
*oldval
, size_t __user
*oldlenp
,
2557 void __user
*newval
, size_t newlen
)
2562 /* Get out of I don't have a variable */
2563 if (!table
->data
|| !table
->maxlen
)
2566 data
= get_ipc(table
, 1);
2570 if (oldval
&& oldlenp
) {
2571 if (get_user(len
, oldlenp
))
2574 if (len
> table
->maxlen
)
2575 len
= table
->maxlen
;
2576 if (copy_to_user(oldval
, data
, len
))
2578 if (put_user(len
, oldlenp
))
2583 if (newval
&& newlen
) {
2584 if (newlen
> table
->maxlen
)
2585 newlen
= table
->maxlen
;
2587 if (copy_from_user(data
, newval
, newlen
))
2594 #else /* CONFIG_SYSCTL_SYSCALL */
2597 asmlinkage
long sys_sysctl(struct __sysctl_args __user
*args
)
2599 static int msg_count
;
2600 struct __sysctl_args tmp
;
2601 int name
[CTL_MAXNAME
];
2604 /* Read in the sysctl name for better debug message logging */
2605 if (copy_from_user(&tmp
, args
, sizeof(tmp
)))
2607 if (tmp
.nlen
<= 0 || tmp
.nlen
>= CTL_MAXNAME
)
2609 for (i
= 0; i
< tmp
.nlen
; i
++)
2610 if (get_user(name
[i
], tmp
.name
+ i
))
2613 /* Ignore accesses to kernel.version */
2614 if ((tmp
.nlen
== 2) && (name
[0] == CTL_KERN
) && (name
[1] == KERN_VERSION
))
2617 if (msg_count
< 5) {
2620 "warning: process `%s' used the removed sysctl "
2621 "system call with ", current
->comm
);
2622 for (i
= 0; i
< tmp
.nlen
; i
++)
2623 printk("%d.", name
[i
]);
2630 int sysctl_string(ctl_table
*table
, int __user
*name
, int nlen
,
2631 void __user
*oldval
, size_t __user
*oldlenp
,
2632 void __user
*newval
, size_t newlen
)
2637 int sysctl_intvec(ctl_table
*table
, int __user
*name
, int nlen
,
2638 void __user
*oldval
, size_t __user
*oldlenp
,
2639 void __user
*newval
, size_t newlen
)
2644 int sysctl_jiffies(ctl_table
*table
, int __user
*name
, int nlen
,
2645 void __user
*oldval
, size_t __user
*oldlenp
,
2646 void __user
*newval
, size_t newlen
)
2651 int sysctl_ms_jiffies(ctl_table
*table
, int __user
*name
, int nlen
,
2652 void __user
*oldval
, size_t __user
*oldlenp
,
2653 void __user
*newval
, size_t newlen
)
2658 #ifdef CONFIG_SYSVIPC
2659 static int sysctl_ipc_data(ctl_table
*table
, int __user
*name
, int nlen
,
2660 void __user
*oldval
, size_t __user
*oldlenp
,
2661 void __user
*newval
, size_t newlen
)
2666 #endif /* CONFIG_SYSCTL_SYSCALL */
2669 * No sense putting this after each symbol definition, twice,
2670 * exception granted :-)
2672 EXPORT_SYMBOL(proc_dointvec
);
2673 EXPORT_SYMBOL(proc_dointvec_jiffies
);
2674 EXPORT_SYMBOL(proc_dointvec_minmax
);
2675 EXPORT_SYMBOL(proc_dointvec_userhz_jiffies
);
2676 EXPORT_SYMBOL(proc_dointvec_ms_jiffies
);
2677 EXPORT_SYMBOL(proc_dostring
);
2678 EXPORT_SYMBOL(proc_doulongvec_minmax
);
2679 EXPORT_SYMBOL(proc_doulongvec_ms_jiffies_minmax
);
2680 EXPORT_SYMBOL(register_sysctl_table
);
2681 EXPORT_SYMBOL(sysctl_intvec
);
2682 EXPORT_SYMBOL(sysctl_jiffies
);
2683 EXPORT_SYMBOL(sysctl_ms_jiffies
);
2684 EXPORT_SYMBOL(sysctl_string
);
2685 EXPORT_SYMBOL(unregister_sysctl_table
);