diff options
author | Lachlan McIlroy <lachlan@redback.melbourne.sgi.com> | 2008-02-17 21:51:42 -0500 |
---|---|---|
committer | Lachlan McIlroy <lachlan@redback.melbourne.sgi.com> | 2008-02-17 21:51:42 -0500 |
commit | c58310bf4933986513020fa90b4190c7492995ae (patch) | |
tree | 143f2c7578d02ebef5db8fc57ae69e951ae0e2ee /kernel/sysctl.c | |
parent | 269cdfaf769f5cd831284cc831790c7c5038040f (diff) | |
parent | 1309d4e68497184d2fd87e892ddf14076c2bda98 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 into for-linus
Diffstat (limited to 'kernel/sysctl.c')
-rw-r--r-- | kernel/sysctl.c | 131 |
1 files changed, 64 insertions, 67 deletions
diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 7cb1ac3e6fff..8b7e95411795 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c | |||
@@ -37,7 +37,6 @@ | |||
37 | #include <linux/highuid.h> | 37 | #include <linux/highuid.h> |
38 | #include <linux/writeback.h> | 38 | #include <linux/writeback.h> |
39 | #include <linux/hugetlb.h> | 39 | #include <linux/hugetlb.h> |
40 | #include <linux/security.h> | ||
41 | #include <linux/initrd.h> | 40 | #include <linux/initrd.h> |
42 | #include <linux/times.h> | 41 | #include <linux/times.h> |
43 | #include <linux/limits.h> | 42 | #include <linux/limits.h> |
@@ -67,14 +66,13 @@ extern int sysctl_overcommit_memory; | |||
67 | extern int sysctl_overcommit_ratio; | 66 | extern int sysctl_overcommit_ratio; |
68 | extern int sysctl_panic_on_oom; | 67 | extern int sysctl_panic_on_oom; |
69 | extern int sysctl_oom_kill_allocating_task; | 68 | extern int sysctl_oom_kill_allocating_task; |
69 | extern int sysctl_oom_dump_tasks; | ||
70 | extern int max_threads; | 70 | extern int max_threads; |
71 | extern int core_uses_pid; | 71 | extern int core_uses_pid; |
72 | extern int suid_dumpable; | 72 | extern int suid_dumpable; |
73 | extern char core_pattern[]; | 73 | extern char core_pattern[]; |
74 | extern int pid_max; | 74 | extern int pid_max; |
75 | extern int min_free_kbytes; | 75 | extern int min_free_kbytes; |
76 | extern int printk_ratelimit_jiffies; | ||
77 | extern int printk_ratelimit_burst; | ||
78 | extern int pid_max_min, pid_max_max; | 76 | extern int pid_max_min, pid_max_max; |
79 | extern int sysctl_drop_caches; | 77 | extern int sysctl_drop_caches; |
80 | extern int percpu_pagelist_fraction; | 78 | extern int percpu_pagelist_fraction; |
@@ -84,8 +82,11 @@ extern int sysctl_stat_interval; | |||
84 | extern int latencytop_enabled; | 82 | extern int latencytop_enabled; |
85 | 83 | ||
86 | /* Constants used for minimum and maximum */ | 84 | /* Constants used for minimum and maximum */ |
87 | #ifdef CONFIG_DETECT_SOFTLOCKUP | 85 | #if defined(CONFIG_DETECT_SOFTLOCKUP) || defined(CONFIG_HIGHMEM) |
88 | static int one = 1; | 86 | static int one = 1; |
87 | #endif | ||
88 | |||
89 | #ifdef CONFIG_DETECT_SOFTLOCKUP | ||
89 | static int sixty = 60; | 90 | static int sixty = 60; |
90 | #endif | 91 | #endif |
91 | 92 | ||
@@ -310,22 +311,6 @@ static struct ctl_table kern_table[] = { | |||
310 | .mode = 0644, | 311 | .mode = 0644, |
311 | .proc_handler = &proc_dointvec, | 312 | .proc_handler = &proc_dointvec, |
312 | }, | 313 | }, |
313 | { | ||
314 | .ctl_name = CTL_UNNUMBERED, | ||
315 | .procname = "sched_rt_period_ms", | ||
316 | .data = &sysctl_sched_rt_period, | ||
317 | .maxlen = sizeof(unsigned int), | ||
318 | .mode = 0644, | ||
319 | .proc_handler = &proc_dointvec, | ||
320 | }, | ||
321 | { | ||
322 | .ctl_name = CTL_UNNUMBERED, | ||
323 | .procname = "sched_rt_ratio", | ||
324 | .data = &sysctl_sched_rt_ratio, | ||
325 | .maxlen = sizeof(unsigned int), | ||
326 | .mode = 0644, | ||
327 | .proc_handler = &proc_dointvec, | ||
328 | }, | ||
329 | #if defined(CONFIG_FAIR_GROUP_SCHED) && defined(CONFIG_SMP) | 314 | #if defined(CONFIG_FAIR_GROUP_SCHED) && defined(CONFIG_SMP) |
330 | { | 315 | { |
331 | .ctl_name = CTL_UNNUMBERED, | 316 | .ctl_name = CTL_UNNUMBERED, |
@@ -347,6 +332,22 @@ static struct ctl_table kern_table[] = { | |||
347 | #endif | 332 | #endif |
348 | { | 333 | { |
349 | .ctl_name = CTL_UNNUMBERED, | 334 | .ctl_name = CTL_UNNUMBERED, |
335 | .procname = "sched_rt_period_us", | ||
336 | .data = &sysctl_sched_rt_period, | ||
337 | .maxlen = sizeof(unsigned int), | ||
338 | .mode = 0644, | ||
339 | .proc_handler = &proc_dointvec, | ||
340 | }, | ||
341 | { | ||
342 | .ctl_name = CTL_UNNUMBERED, | ||
343 | .procname = "sched_rt_runtime_us", | ||
344 | .data = &sysctl_sched_rt_runtime, | ||
345 | .maxlen = sizeof(int), | ||
346 | .mode = 0644, | ||
347 | .proc_handler = &proc_dointvec, | ||
348 | }, | ||
349 | { | ||
350 | .ctl_name = CTL_UNNUMBERED, | ||
350 | .procname = "sched_compat_yield", | 351 | .procname = "sched_compat_yield", |
351 | .data = &sysctl_sched_compat_yield, | 352 | .data = &sysctl_sched_compat_yield, |
352 | .maxlen = sizeof(unsigned int), | 353 | .maxlen = sizeof(unsigned int), |
@@ -416,15 +417,6 @@ static struct ctl_table kern_table[] = { | |||
416 | .proc_handler = &proc_dointvec, | 417 | .proc_handler = &proc_dointvec, |
417 | }, | 418 | }, |
418 | #endif | 419 | #endif |
419 | #ifdef CONFIG_SECURITY_CAPABILITIES | ||
420 | { | ||
421 | .procname = "cap-bound", | ||
422 | .data = &cap_bset, | ||
423 | .maxlen = sizeof(kernel_cap_t), | ||
424 | .mode = 0600, | ||
425 | .proc_handler = &proc_dointvec_bset, | ||
426 | }, | ||
427 | #endif /* def CONFIG_SECURITY_CAPABILITIES */ | ||
428 | #ifdef CONFIG_BLK_DEV_INITRD | 420 | #ifdef CONFIG_BLK_DEV_INITRD |
429 | { | 421 | { |
430 | .ctl_name = KERN_REALROOTDEV, | 422 | .ctl_name = KERN_REALROOTDEV, |
@@ -496,14 +488,6 @@ static struct ctl_table kern_table[] = { | |||
496 | .mode = 0644, | 488 | .mode = 0644, |
497 | .proc_handler = &proc_dointvec, | 489 | .proc_handler = &proc_dointvec, |
498 | }, | 490 | }, |
499 | { | ||
500 | .ctl_name = KERN_PRINTK, | ||
501 | .procname = "printk", | ||
502 | .data = &console_loglevel, | ||
503 | .maxlen = 4*sizeof(int), | ||
504 | .mode = 0644, | ||
505 | .proc_handler = &proc_dointvec, | ||
506 | }, | ||
507 | #ifdef CONFIG_KMOD | 491 | #ifdef CONFIG_KMOD |
508 | { | 492 | { |
509 | .ctl_name = KERN_MODPROBE, | 493 | .ctl_name = KERN_MODPROBE, |
@@ -650,6 +634,15 @@ static struct ctl_table kern_table[] = { | |||
650 | .mode = 0644, | 634 | .mode = 0644, |
651 | .proc_handler = &proc_dointvec, | 635 | .proc_handler = &proc_dointvec, |
652 | }, | 636 | }, |
637 | #if defined CONFIG_PRINTK | ||
638 | { | ||
639 | .ctl_name = KERN_PRINTK, | ||
640 | .procname = "printk", | ||
641 | .data = &console_loglevel, | ||
642 | .maxlen = 4*sizeof(int), | ||
643 | .mode = 0644, | ||
644 | .proc_handler = &proc_dointvec, | ||
645 | }, | ||
653 | { | 646 | { |
654 | .ctl_name = KERN_PRINTK_RATELIMIT, | 647 | .ctl_name = KERN_PRINTK_RATELIMIT, |
655 | .procname = "printk_ratelimit", | 648 | .procname = "printk_ratelimit", |
@@ -667,6 +660,7 @@ static struct ctl_table kern_table[] = { | |||
667 | .mode = 0644, | 660 | .mode = 0644, |
668 | .proc_handler = &proc_dointvec, | 661 | .proc_handler = &proc_dointvec, |
669 | }, | 662 | }, |
663 | #endif | ||
670 | { | 664 | { |
671 | .ctl_name = KERN_NGROUPS_MAX, | 665 | .ctl_name = KERN_NGROUPS_MAX, |
672 | .procname = "ngroups_max", | 666 | .procname = "ngroups_max", |
@@ -877,6 +871,14 @@ static struct ctl_table vm_table[] = { | |||
877 | .proc_handler = &proc_dointvec, | 871 | .proc_handler = &proc_dointvec, |
878 | }, | 872 | }, |
879 | { | 873 | { |
874 | .ctl_name = CTL_UNNUMBERED, | ||
875 | .procname = "oom_dump_tasks", | ||
876 | .data = &sysctl_oom_dump_tasks, | ||
877 | .maxlen = sizeof(sysctl_oom_dump_tasks), | ||
878 | .mode = 0644, | ||
879 | .proc_handler = &proc_dointvec, | ||
880 | }, | ||
881 | { | ||
880 | .ctl_name = VM_OVERCOMMIT_RATIO, | 882 | .ctl_name = VM_OVERCOMMIT_RATIO, |
881 | .procname = "overcommit_ratio", | 883 | .procname = "overcommit_ratio", |
882 | .data = &sysctl_overcommit_ratio, | 884 | .data = &sysctl_overcommit_ratio, |
@@ -976,10 +978,10 @@ static struct ctl_table vm_table[] = { | |||
976 | { | 978 | { |
977 | .ctl_name = CTL_UNNUMBERED, | 979 | .ctl_name = CTL_UNNUMBERED, |
978 | .procname = "nr_overcommit_hugepages", | 980 | .procname = "nr_overcommit_hugepages", |
979 | .data = &nr_overcommit_huge_pages, | 981 | .data = &sysctl_overcommit_huge_pages, |
980 | .maxlen = sizeof(nr_overcommit_huge_pages), | 982 | .maxlen = sizeof(sysctl_overcommit_huge_pages), |
981 | .mode = 0644, | 983 | .mode = 0644, |
982 | .proc_handler = &proc_doulongvec_minmax, | 984 | .proc_handler = &hugetlb_overcommit_handler, |
983 | }, | 985 | }, |
984 | #endif | 986 | #endif |
985 | { | 987 | { |
@@ -1150,6 +1152,19 @@ static struct ctl_table vm_table[] = { | |||
1150 | .extra1 = &zero, | 1152 | .extra1 = &zero, |
1151 | }, | 1153 | }, |
1152 | #endif | 1154 | #endif |
1155 | #ifdef CONFIG_HIGHMEM | ||
1156 | { | ||
1157 | .ctl_name = CTL_UNNUMBERED, | ||
1158 | .procname = "highmem_is_dirtyable", | ||
1159 | .data = &vm_highmem_is_dirtyable, | ||
1160 | .maxlen = sizeof(vm_highmem_is_dirtyable), | ||
1161 | .mode = 0644, | ||
1162 | .proc_handler = &proc_dointvec_minmax, | ||
1163 | .strategy = &sysctl_intvec, | ||
1164 | .extra1 = &zero, | ||
1165 | .extra2 = &one, | ||
1166 | }, | ||
1167 | #endif | ||
1153 | /* | 1168 | /* |
1154 | * NOTE: do not add new entries to this table unless you have read | 1169 | * NOTE: do not add new entries to this table unless you have read |
1155 | * Documentation/sysctl/ctl_unnumbered.txt | 1170 | * Documentation/sysctl/ctl_unnumbered.txt |
@@ -1196,6 +1211,14 @@ static struct ctl_table fs_table[] = { | |||
1196 | .proc_handler = &proc_dointvec, | 1211 | .proc_handler = &proc_dointvec, |
1197 | }, | 1212 | }, |
1198 | { | 1213 | { |
1214 | .ctl_name = CTL_UNNUMBERED, | ||
1215 | .procname = "nr_open", | ||
1216 | .data = &sysctl_nr_open, | ||
1217 | .maxlen = sizeof(int), | ||
1218 | .mode = 0644, | ||
1219 | .proc_handler = &proc_dointvec, | ||
1220 | }, | ||
1221 | { | ||
1199 | .ctl_name = FS_DENTRY, | 1222 | .ctl_name = FS_DENTRY, |
1200 | .procname = "dentry-state", | 1223 | .procname = "dentry-state", |
1201 | .data = &dentry_stat, | 1224 | .data = &dentry_stat, |
@@ -2080,26 +2103,6 @@ static int do_proc_dointvec_bset_conv(int *negp, unsigned long *lvalp, | |||
2080 | return 0; | 2103 | return 0; |
2081 | } | 2104 | } |
2082 | 2105 | ||
2083 | #ifdef CONFIG_SECURITY_CAPABILITIES | ||
2084 | /* | ||
2085 | * init may raise the set. | ||
2086 | */ | ||
2087 | |||
2088 | int proc_dointvec_bset(struct ctl_table *table, int write, struct file *filp, | ||
2089 | void __user *buffer, size_t *lenp, loff_t *ppos) | ||
2090 | { | ||
2091 | int op; | ||
2092 | |||
2093 | if (write && !capable(CAP_SYS_MODULE)) { | ||
2094 | return -EPERM; | ||
2095 | } | ||
2096 | |||
2097 | op = is_global_init(current) ? OP_SET : OP_AND; | ||
2098 | return do_proc_dointvec(table,write,filp,buffer,lenp,ppos, | ||
2099 | do_proc_dointvec_bset_conv,&op); | ||
2100 | } | ||
2101 | #endif /* def CONFIG_SECURITY_CAPABILITIES */ | ||
2102 | |||
2103 | /* | 2106 | /* |
2104 | * Taint values can only be increased | 2107 | * Taint values can only be increased |
2105 | */ | 2108 | */ |
@@ -2484,7 +2487,7 @@ static int proc_do_cad_pid(struct ctl_table *table, int write, struct file *filp | |||
2484 | pid_t tmp; | 2487 | pid_t tmp; |
2485 | int r; | 2488 | int r; |
2486 | 2489 | ||
2487 | tmp = pid_nr_ns(cad_pid, current->nsproxy->pid_ns); | 2490 | tmp = pid_vnr(cad_pid); |
2488 | 2491 | ||
2489 | r = __do_proc_dointvec(&tmp, table, write, filp, buffer, | 2492 | r = __do_proc_dointvec(&tmp, table, write, filp, buffer, |
2490 | lenp, ppos, NULL, NULL); | 2493 | lenp, ppos, NULL, NULL); |
@@ -2513,12 +2516,6 @@ int proc_dointvec(struct ctl_table *table, int write, struct file *filp, | |||
2513 | return -ENOSYS; | 2516 | return -ENOSYS; |
2514 | } | 2517 | } |
2515 | 2518 | ||
2516 | int proc_dointvec_bset(struct ctl_table *table, int write, struct file *filp, | ||
2517 | void __user *buffer, size_t *lenp, loff_t *ppos) | ||
2518 | { | ||
2519 | return -ENOSYS; | ||
2520 | } | ||
2521 | |||
2522 | int proc_dointvec_minmax(struct ctl_table *table, int write, struct file *filp, | 2519 | int proc_dointvec_minmax(struct ctl_table *table, int write, struct file *filp, |
2523 | void __user *buffer, size_t *lenp, loff_t *ppos) | 2520 | void __user *buffer, size_t *lenp, loff_t *ppos) |
2524 | { | 2521 | { |