diff options
Diffstat (limited to 'kernel/sysctl.c')
-rw-r--r-- | kernel/sysctl.c | 53 |
1 files changed, 17 insertions, 36 deletions
diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 7cb1ac3e6fff..5e2ad5bf88e2 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c | |||
@@ -84,8 +84,11 @@ extern int sysctl_stat_interval; | |||
84 | extern int latencytop_enabled; | 84 | extern int latencytop_enabled; |
85 | 85 | ||
86 | /* Constants used for minimum and maximum */ | 86 | /* Constants used for minimum and maximum */ |
87 | #ifdef CONFIG_DETECT_SOFTLOCKUP | 87 | #if defined(CONFIG_DETECT_SOFTLOCKUP) || defined(CONFIG_HIGHMEM) |
88 | static int one = 1; | 88 | static int one = 1; |
89 | #endif | ||
90 | |||
91 | #ifdef CONFIG_DETECT_SOFTLOCKUP | ||
89 | static int sixty = 60; | 92 | static int sixty = 60; |
90 | #endif | 93 | #endif |
91 | 94 | ||
@@ -416,15 +419,6 @@ static struct ctl_table kern_table[] = { | |||
416 | .proc_handler = &proc_dointvec, | 419 | .proc_handler = &proc_dointvec, |
417 | }, | 420 | }, |
418 | #endif | 421 | #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 | 422 | #ifdef CONFIG_BLK_DEV_INITRD |
429 | { | 423 | { |
430 | .ctl_name = KERN_REALROOTDEV, | 424 | .ctl_name = KERN_REALROOTDEV, |
@@ -1150,6 +1144,19 @@ static struct ctl_table vm_table[] = { | |||
1150 | .extra1 = &zero, | 1144 | .extra1 = &zero, |
1151 | }, | 1145 | }, |
1152 | #endif | 1146 | #endif |
1147 | #ifdef CONFIG_HIGHMEM | ||
1148 | { | ||
1149 | .ctl_name = CTL_UNNUMBERED, | ||
1150 | .procname = "highmem_is_dirtyable", | ||
1151 | .data = &vm_highmem_is_dirtyable, | ||
1152 | .maxlen = sizeof(vm_highmem_is_dirtyable), | ||
1153 | .mode = 0644, | ||
1154 | .proc_handler = &proc_dointvec_minmax, | ||
1155 | .strategy = &sysctl_intvec, | ||
1156 | .extra1 = &zero, | ||
1157 | .extra2 = &one, | ||
1158 | }, | ||
1159 | #endif | ||
1153 | /* | 1160 | /* |
1154 | * NOTE: do not add new entries to this table unless you have read | 1161 | * NOTE: do not add new entries to this table unless you have read |
1155 | * Documentation/sysctl/ctl_unnumbered.txt | 1162 | * Documentation/sysctl/ctl_unnumbered.txt |
@@ -2080,26 +2087,6 @@ static int do_proc_dointvec_bset_conv(int *negp, unsigned long *lvalp, | |||
2080 | return 0; | 2087 | return 0; |
2081 | } | 2088 | } |
2082 | 2089 | ||
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 | /* | 2090 | /* |
2104 | * Taint values can only be increased | 2091 | * Taint values can only be increased |
2105 | */ | 2092 | */ |
@@ -2513,12 +2500,6 @@ int proc_dointvec(struct ctl_table *table, int write, struct file *filp, | |||
2513 | return -ENOSYS; | 2500 | return -ENOSYS; |
2514 | } | 2501 | } |
2515 | 2502 | ||
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, | 2503 | int proc_dointvec_minmax(struct ctl_table *table, int write, struct file *filp, |
2523 | void __user *buffer, size_t *lenp, loff_t *ppos) | 2504 | void __user *buffer, size_t *lenp, loff_t *ppos) |
2524 | { | 2505 | { |