diff options
Diffstat (limited to 'kernel/sysctl.c')
| -rw-r--r-- | kernel/sysctl.c | 75 |
1 files changed, 68 insertions, 7 deletions
diff --git a/kernel/sysctl.c b/kernel/sysctl.c index b2970d56fb76..62e4ff9968b5 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c | |||
| @@ -27,6 +27,7 @@ | |||
| 27 | #include <linux/security.h> | 27 | #include <linux/security.h> |
| 28 | #include <linux/ctype.h> | 28 | #include <linux/ctype.h> |
| 29 | #include <linux/utsname.h> | 29 | #include <linux/utsname.h> |
| 30 | #include <linux/kmemcheck.h> | ||
| 30 | #include <linux/smp_lock.h> | 31 | #include <linux/smp_lock.h> |
| 31 | #include <linux/fs.h> | 32 | #include <linux/fs.h> |
| 32 | #include <linux/init.h> | 33 | #include <linux/init.h> |
| @@ -49,6 +50,7 @@ | |||
| 49 | #include <linux/reboot.h> | 50 | #include <linux/reboot.h> |
| 50 | #include <linux/ftrace.h> | 51 | #include <linux/ftrace.h> |
| 51 | #include <linux/slow-work.h> | 52 | #include <linux/slow-work.h> |
| 53 | #include <linux/perf_counter.h> | ||
| 52 | 54 | ||
| 53 | #include <asm/uaccess.h> | 55 | #include <asm/uaccess.h> |
| 54 | #include <asm/processor.h> | 56 | #include <asm/processor.h> |
| @@ -114,6 +116,7 @@ static int ngroups_max = NGROUPS_MAX; | |||
| 114 | 116 | ||
| 115 | #ifdef CONFIG_MODULES | 117 | #ifdef CONFIG_MODULES |
| 116 | extern char modprobe_path[]; | 118 | extern char modprobe_path[]; |
| 119 | extern int modules_disabled; | ||
| 117 | #endif | 120 | #endif |
| 118 | #ifdef CONFIG_CHR_DEV_SG | 121 | #ifdef CONFIG_CHR_DEV_SG |
| 119 | extern int sg_big_buff; | 122 | extern int sg_big_buff; |
| @@ -326,6 +329,14 @@ static struct ctl_table kern_table[] = { | |||
| 326 | .mode = 0644, | 329 | .mode = 0644, |
| 327 | .proc_handler = &proc_dointvec, | 330 | .proc_handler = &proc_dointvec, |
| 328 | }, | 331 | }, |
| 332 | { | ||
| 333 | .ctl_name = CTL_UNNUMBERED, | ||
| 334 | .procname = "timer_migration", | ||
| 335 | .data = &sysctl_timer_migration, | ||
| 336 | .maxlen = sizeof(unsigned int), | ||
| 337 | .mode = 0644, | ||
| 338 | .proc_handler = &proc_dointvec, | ||
| 339 | }, | ||
| 329 | #endif | 340 | #endif |
| 330 | { | 341 | { |
| 331 | .ctl_name = CTL_UNNUMBERED, | 342 | .ctl_name = CTL_UNNUMBERED, |
| @@ -534,6 +545,17 @@ static struct ctl_table kern_table[] = { | |||
| 534 | .proc_handler = &proc_dostring, | 545 | .proc_handler = &proc_dostring, |
| 535 | .strategy = &sysctl_string, | 546 | .strategy = &sysctl_string, |
| 536 | }, | 547 | }, |
| 548 | { | ||
| 549 | .ctl_name = CTL_UNNUMBERED, | ||
| 550 | .procname = "modules_disabled", | ||
| 551 | .data = &modules_disabled, | ||
| 552 | .maxlen = sizeof(int), | ||
| 553 | .mode = 0644, | ||
| 554 | /* only handle a transition from default "0" to "1" */ | ||
| 555 | .proc_handler = &proc_dointvec_minmax, | ||
| 556 | .extra1 = &one, | ||
| 557 | .extra2 = &one, | ||
| 558 | }, | ||
| 537 | #endif | 559 | #endif |
| 538 | #if defined(CONFIG_HOTPLUG) && defined(CONFIG_NET) | 560 | #if defined(CONFIG_HOTPLUG) && defined(CONFIG_NET) |
| 539 | { | 561 | { |
| @@ -731,6 +753,14 @@ static struct ctl_table kern_table[] = { | |||
| 731 | }, | 753 | }, |
| 732 | { | 754 | { |
| 733 | .ctl_name = CTL_UNNUMBERED, | 755 | .ctl_name = CTL_UNNUMBERED, |
| 756 | .procname = "bootloader_version", | ||
| 757 | .data = &bootloader_version, | ||
| 758 | .maxlen = sizeof (int), | ||
| 759 | .mode = 0444, | ||
| 760 | .proc_handler = &proc_dointvec, | ||
| 761 | }, | ||
| 762 | { | ||
| 763 | .ctl_name = CTL_UNNUMBERED, | ||
| 734 | .procname = "kstack_depth_to_print", | 764 | .procname = "kstack_depth_to_print", |
| 735 | .data = &kstack_depth_to_print, | 765 | .data = &kstack_depth_to_print, |
| 736 | .maxlen = sizeof(int), | 766 | .maxlen = sizeof(int), |
| @@ -912,6 +942,43 @@ static struct ctl_table kern_table[] = { | |||
| 912 | .child = slow_work_sysctls, | 942 | .child = slow_work_sysctls, |
| 913 | }, | 943 | }, |
| 914 | #endif | 944 | #endif |
| 945 | #ifdef CONFIG_PERF_COUNTERS | ||
| 946 | { | ||
| 947 | .ctl_name = CTL_UNNUMBERED, | ||
| 948 | .procname = "perf_counter_paranoid", | ||
| 949 | .data = &sysctl_perf_counter_paranoid, | ||
| 950 | .maxlen = sizeof(sysctl_perf_counter_paranoid), | ||
| 951 | .mode = 0644, | ||
| 952 | .proc_handler = &proc_dointvec, | ||
| 953 | }, | ||
| 954 | { | ||
| 955 | .ctl_name = CTL_UNNUMBERED, | ||
| 956 | .procname = "perf_counter_mlock_kb", | ||
| 957 | .data = &sysctl_perf_counter_mlock, | ||
| 958 | .maxlen = sizeof(sysctl_perf_counter_mlock), | ||
| 959 | .mode = 0644, | ||
| 960 | .proc_handler = &proc_dointvec, | ||
| 961 | }, | ||
| 962 | { | ||
| 963 | .ctl_name = CTL_UNNUMBERED, | ||
| 964 | .procname = "perf_counter_max_sample_rate", | ||
| 965 | .data = &sysctl_perf_counter_sample_rate, | ||
| 966 | .maxlen = sizeof(sysctl_perf_counter_sample_rate), | ||
| 967 | .mode = 0644, | ||
| 968 | .proc_handler = &proc_dointvec, | ||
| 969 | }, | ||
| 970 | #endif | ||
| 971 | #ifdef CONFIG_KMEMCHECK | ||
| 972 | { | ||
| 973 | .ctl_name = CTL_UNNUMBERED, | ||
| 974 | .procname = "kmemcheck", | ||
| 975 | .data = &kmemcheck_enabled, | ||
| 976 | .maxlen = sizeof(int), | ||
| 977 | .mode = 0644, | ||
| 978 | .proc_handler = &proc_dointvec, | ||
| 979 | }, | ||
| 980 | #endif | ||
| 981 | |||
| 915 | /* | 982 | /* |
| 916 | * NOTE: do not add new entries to this table unless you have read | 983 | * NOTE: do not add new entries to this table unless you have read |
| 917 | * Documentation/sysctl/ctl_unnumbered.txt | 984 | * Documentation/sysctl/ctl_unnumbered.txt |
| @@ -1225,7 +1292,6 @@ static struct ctl_table vm_table[] = { | |||
| 1225 | .strategy = &sysctl_jiffies, | 1292 | .strategy = &sysctl_jiffies, |
| 1226 | }, | 1293 | }, |
| 1227 | #endif | 1294 | #endif |
| 1228 | #ifdef CONFIG_SECURITY | ||
| 1229 | { | 1295 | { |
| 1230 | .ctl_name = CTL_UNNUMBERED, | 1296 | .ctl_name = CTL_UNNUMBERED, |
| 1231 | .procname = "mmap_min_addr", | 1297 | .procname = "mmap_min_addr", |
| @@ -1234,7 +1300,6 @@ static struct ctl_table vm_table[] = { | |||
| 1234 | .mode = 0644, | 1300 | .mode = 0644, |
| 1235 | .proc_handler = &proc_doulongvec_minmax, | 1301 | .proc_handler = &proc_doulongvec_minmax, |
| 1236 | }, | 1302 | }, |
| 1237 | #endif | ||
| 1238 | #ifdef CONFIG_NUMA | 1303 | #ifdef CONFIG_NUMA |
| 1239 | { | 1304 | { |
| 1240 | .ctl_name = CTL_UNNUMBERED, | 1305 | .ctl_name = CTL_UNNUMBERED, |
| @@ -1272,7 +1337,6 @@ static struct ctl_table vm_table[] = { | |||
| 1272 | .extra2 = &one, | 1337 | .extra2 = &one, |
| 1273 | }, | 1338 | }, |
| 1274 | #endif | 1339 | #endif |
| 1275 | #ifdef CONFIG_UNEVICTABLE_LRU | ||
| 1276 | { | 1340 | { |
| 1277 | .ctl_name = CTL_UNNUMBERED, | 1341 | .ctl_name = CTL_UNNUMBERED, |
| 1278 | .procname = "scan_unevictable_pages", | 1342 | .procname = "scan_unevictable_pages", |
| @@ -1281,7 +1345,6 @@ static struct ctl_table vm_table[] = { | |||
| 1281 | .mode = 0644, | 1345 | .mode = 0644, |
| 1282 | .proc_handler = &scan_unevictable_handler, | 1346 | .proc_handler = &scan_unevictable_handler, |
| 1283 | }, | 1347 | }, |
| 1284 | #endif | ||
| 1285 | /* | 1348 | /* |
| 1286 | * NOTE: do not add new entries to this table unless you have read | 1349 | * NOTE: do not add new entries to this table unless you have read |
| 1287 | * Documentation/sysctl/ctl_unnumbered.txt | 1350 | * Documentation/sysctl/ctl_unnumbered.txt |
| @@ -2220,7 +2283,7 @@ static int __do_proc_dointvec(void *tbl_data, struct ctl_table *table, | |||
| 2220 | void *data) | 2283 | void *data) |
| 2221 | { | 2284 | { |
| 2222 | #define TMPBUFLEN 21 | 2285 | #define TMPBUFLEN 21 |
| 2223 | int *i, vleft, first=1, neg, val; | 2286 | int *i, vleft, first = 1, neg; |
| 2224 | unsigned long lval; | 2287 | unsigned long lval; |
| 2225 | size_t left, len; | 2288 | size_t left, len; |
| 2226 | 2289 | ||
| @@ -2273,8 +2336,6 @@ static int __do_proc_dointvec(void *tbl_data, struct ctl_table *table, | |||
| 2273 | len = p-buf; | 2336 | len = p-buf; |
| 2274 | if ((len < left) && *p && !isspace(*p)) | 2337 | if ((len < left) && *p && !isspace(*p)) |
| 2275 | break; | 2338 | break; |
| 2276 | if (neg) | ||
| 2277 | val = -val; | ||
| 2278 | s += len; | 2339 | s += len; |
| 2279 | left -= len; | 2340 | left -= len; |
| 2280 | 2341 | ||
