diff options
Diffstat (limited to 'kernel/sysctl.c')
-rw-r--r-- | kernel/sysctl.c | 70 |
1 files changed, 34 insertions, 36 deletions
diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 7cb1ac3e6fff..8c98d8147d88 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c | |||
@@ -67,6 +67,7 @@ extern int sysctl_overcommit_memory; | |||
67 | extern int sysctl_overcommit_ratio; | 67 | extern int sysctl_overcommit_ratio; |
68 | extern int sysctl_panic_on_oom; | 68 | extern int sysctl_panic_on_oom; |
69 | extern int sysctl_oom_kill_allocating_task; | 69 | extern int sysctl_oom_kill_allocating_task; |
70 | extern int sysctl_oom_dump_tasks; | ||
70 | extern int max_threads; | 71 | extern int max_threads; |
71 | extern int core_uses_pid; | 72 | extern int core_uses_pid; |
72 | extern int suid_dumpable; | 73 | extern int suid_dumpable; |
@@ -84,8 +85,11 @@ extern int sysctl_stat_interval; | |||
84 | extern int latencytop_enabled; | 85 | extern int latencytop_enabled; |
85 | 86 | ||
86 | /* Constants used for minimum and maximum */ | 87 | /* Constants used for minimum and maximum */ |
87 | #ifdef CONFIG_DETECT_SOFTLOCKUP | 88 | #if defined(CONFIG_DETECT_SOFTLOCKUP) || defined(CONFIG_HIGHMEM) |
88 | static int one = 1; | 89 | static int one = 1; |
90 | #endif | ||
91 | |||
92 | #ifdef CONFIG_DETECT_SOFTLOCKUP | ||
89 | static int sixty = 60; | 93 | static int sixty = 60; |
90 | #endif | 94 | #endif |
91 | 95 | ||
@@ -416,15 +420,6 @@ static struct ctl_table kern_table[] = { | |||
416 | .proc_handler = &proc_dointvec, | 420 | .proc_handler = &proc_dointvec, |
417 | }, | 421 | }, |
418 | #endif | 422 | #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 | 423 | #ifdef CONFIG_BLK_DEV_INITRD |
429 | { | 424 | { |
430 | .ctl_name = KERN_REALROOTDEV, | 425 | .ctl_name = KERN_REALROOTDEV, |
@@ -877,6 +872,14 @@ static struct ctl_table vm_table[] = { | |||
877 | .proc_handler = &proc_dointvec, | 872 | .proc_handler = &proc_dointvec, |
878 | }, | 873 | }, |
879 | { | 874 | { |
875 | .ctl_name = CTL_UNNUMBERED, | ||
876 | .procname = "oom_dump_tasks", | ||
877 | .data = &sysctl_oom_dump_tasks, | ||
878 | .maxlen = sizeof(sysctl_oom_dump_tasks), | ||
879 | .mode = 0644, | ||
880 | .proc_handler = &proc_dointvec, | ||
881 | }, | ||
882 | { | ||
880 | .ctl_name = VM_OVERCOMMIT_RATIO, | 883 | .ctl_name = VM_OVERCOMMIT_RATIO, |
881 | .procname = "overcommit_ratio", | 884 | .procname = "overcommit_ratio", |
882 | .data = &sysctl_overcommit_ratio, | 885 | .data = &sysctl_overcommit_ratio, |
@@ -1150,6 +1153,19 @@ static struct ctl_table vm_table[] = { | |||
1150 | .extra1 = &zero, | 1153 | .extra1 = &zero, |
1151 | }, | 1154 | }, |
1152 | #endif | 1155 | #endif |
1156 | #ifdef CONFIG_HIGHMEM | ||
1157 | { | ||
1158 | .ctl_name = CTL_UNNUMBERED, | ||
1159 | .procname = "highmem_is_dirtyable", | ||
1160 | .data = &vm_highmem_is_dirtyable, | ||
1161 | .maxlen = sizeof(vm_highmem_is_dirtyable), | ||
1162 | .mode = 0644, | ||
1163 | .proc_handler = &proc_dointvec_minmax, | ||
1164 | .strategy = &sysctl_intvec, | ||
1165 | .extra1 = &zero, | ||
1166 | .extra2 = &one, | ||
1167 | }, | ||
1168 | #endif | ||
1153 | /* | 1169 | /* |
1154 | * NOTE: do not add new entries to this table unless you have read | 1170 | * NOTE: do not add new entries to this table unless you have read |
1155 | * Documentation/sysctl/ctl_unnumbered.txt | 1171 | * Documentation/sysctl/ctl_unnumbered.txt |
@@ -1196,6 +1212,14 @@ static struct ctl_table fs_table[] = { | |||
1196 | .proc_handler = &proc_dointvec, | 1212 | .proc_handler = &proc_dointvec, |
1197 | }, | 1213 | }, |
1198 | { | 1214 | { |
1215 | .ctl_name = CTL_UNNUMBERED, | ||
1216 | .procname = "nr_open", | ||
1217 | .data = &sysctl_nr_open, | ||
1218 | .maxlen = sizeof(int), | ||
1219 | .mode = 0644, | ||
1220 | .proc_handler = &proc_dointvec, | ||
1221 | }, | ||
1222 | { | ||
1199 | .ctl_name = FS_DENTRY, | 1223 | .ctl_name = FS_DENTRY, |
1200 | .procname = "dentry-state", | 1224 | .procname = "dentry-state", |
1201 | .data = &dentry_stat, | 1225 | .data = &dentry_stat, |
@@ -2080,26 +2104,6 @@ static int do_proc_dointvec_bset_conv(int *negp, unsigned long *lvalp, | |||
2080 | return 0; | 2104 | return 0; |
2081 | } | 2105 | } |
2082 | 2106 | ||
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 | /* | 2107 | /* |
2104 | * Taint values can only be increased | 2108 | * Taint values can only be increased |
2105 | */ | 2109 | */ |
@@ -2513,12 +2517,6 @@ int proc_dointvec(struct ctl_table *table, int write, struct file *filp, | |||
2513 | return -ENOSYS; | 2517 | return -ENOSYS; |
2514 | } | 2518 | } |
2515 | 2519 | ||
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, | 2520 | int proc_dointvec_minmax(struct ctl_table *table, int write, struct file *filp, |
2523 | void __user *buffer, size_t *lenp, loff_t *ppos) | 2521 | void __user *buffer, size_t *lenp, loff_t *ppos) |
2524 | { | 2522 | { |