diff options
Diffstat (limited to 'kernel/sysctl.c')
| -rw-r--r-- | kernel/sysctl.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 87174ef59161..26f65eaa01f9 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c | |||
| @@ -97,10 +97,12 @@ | |||
| 97 | extern int sysctl_overcommit_memory; | 97 | extern int sysctl_overcommit_memory; |
| 98 | extern int sysctl_overcommit_ratio; | 98 | extern int sysctl_overcommit_ratio; |
| 99 | extern int max_threads; | 99 | extern int max_threads; |
| 100 | extern int core_uses_pid; | ||
| 101 | extern int suid_dumpable; | 100 | extern int suid_dumpable; |
| 101 | #ifdef CONFIG_COREDUMP | ||
| 102 | extern int core_uses_pid; | ||
| 102 | extern char core_pattern[]; | 103 | extern char core_pattern[]; |
| 103 | extern unsigned int core_pipe_limit; | 104 | extern unsigned int core_pipe_limit; |
| 105 | #endif | ||
| 104 | extern int pid_max; | 106 | extern int pid_max; |
| 105 | extern int min_free_kbytes; | 107 | extern int min_free_kbytes; |
| 106 | extern int pid_max_min, pid_max_max; | 108 | extern int pid_max_min, pid_max_max; |
| @@ -177,8 +179,10 @@ static int proc_dointvec_minmax_sysadmin(struct ctl_table *table, int write, | |||
| 177 | 179 | ||
| 178 | static int proc_dointvec_minmax_coredump(struct ctl_table *table, int write, | 180 | static int proc_dointvec_minmax_coredump(struct ctl_table *table, int write, |
| 179 | void __user *buffer, size_t *lenp, loff_t *ppos); | 181 | void __user *buffer, size_t *lenp, loff_t *ppos); |
| 182 | #ifdef CONFIG_COREDUMP | ||
| 180 | static int proc_dostring_coredump(struct ctl_table *table, int write, | 183 | static int proc_dostring_coredump(struct ctl_table *table, int write, |
| 181 | void __user *buffer, size_t *lenp, loff_t *ppos); | 184 | void __user *buffer, size_t *lenp, loff_t *ppos); |
| 185 | #endif | ||
| 182 | 186 | ||
| 183 | #ifdef CONFIG_MAGIC_SYSRQ | 187 | #ifdef CONFIG_MAGIC_SYSRQ |
| 184 | /* Note: sysrq code uses it's own private copy */ | 188 | /* Note: sysrq code uses it's own private copy */ |
| @@ -307,7 +311,7 @@ static struct ctl_table kern_table[] = { | |||
| 307 | .extra2 = &max_sched_tunable_scaling, | 311 | .extra2 = &max_sched_tunable_scaling, |
| 308 | }, | 312 | }, |
| 309 | { | 313 | { |
| 310 | .procname = "sched_migration_cost", | 314 | .procname = "sched_migration_cost_ns", |
| 311 | .data = &sysctl_sched_migration_cost, | 315 | .data = &sysctl_sched_migration_cost, |
| 312 | .maxlen = sizeof(unsigned int), | 316 | .maxlen = sizeof(unsigned int), |
| 313 | .mode = 0644, | 317 | .mode = 0644, |
| @@ -321,14 +325,14 @@ static struct ctl_table kern_table[] = { | |||
| 321 | .proc_handler = proc_dointvec, | 325 | .proc_handler = proc_dointvec, |
| 322 | }, | 326 | }, |
| 323 | { | 327 | { |
| 324 | .procname = "sched_time_avg", | 328 | .procname = "sched_time_avg_ms", |
| 325 | .data = &sysctl_sched_time_avg, | 329 | .data = &sysctl_sched_time_avg, |
| 326 | .maxlen = sizeof(unsigned int), | 330 | .maxlen = sizeof(unsigned int), |
| 327 | .mode = 0644, | 331 | .mode = 0644, |
| 328 | .proc_handler = proc_dointvec, | 332 | .proc_handler = proc_dointvec, |
| 329 | }, | 333 | }, |
| 330 | { | 334 | { |
| 331 | .procname = "sched_shares_window", | 335 | .procname = "sched_shares_window_ns", |
| 332 | .data = &sysctl_sched_shares_window, | 336 | .data = &sysctl_sched_shares_window, |
| 333 | .maxlen = sizeof(unsigned int), | 337 | .maxlen = sizeof(unsigned int), |
| 334 | .mode = 0644, | 338 | .mode = 0644, |
| @@ -404,6 +408,7 @@ static struct ctl_table kern_table[] = { | |||
| 404 | .mode = 0644, | 408 | .mode = 0644, |
| 405 | .proc_handler = proc_dointvec, | 409 | .proc_handler = proc_dointvec, |
| 406 | }, | 410 | }, |
| 411 | #ifdef CONFIG_COREDUMP | ||
| 407 | { | 412 | { |
| 408 | .procname = "core_uses_pid", | 413 | .procname = "core_uses_pid", |
| 409 | .data = &core_uses_pid, | 414 | .data = &core_uses_pid, |
| @@ -425,6 +430,7 @@ static struct ctl_table kern_table[] = { | |||
| 425 | .mode = 0644, | 430 | .mode = 0644, |
| 426 | .proc_handler = proc_dointvec, | 431 | .proc_handler = proc_dointvec, |
| 427 | }, | 432 | }, |
| 433 | #endif | ||
| 428 | #ifdef CONFIG_PROC_SYSCTL | 434 | #ifdef CONFIG_PROC_SYSCTL |
| 429 | { | 435 | { |
| 430 | .procname = "tainted", | 436 | .procname = "tainted", |
| @@ -1543,8 +1549,7 @@ static struct ctl_table fs_table[] = { | |||
| 1543 | }; | 1549 | }; |
| 1544 | 1550 | ||
| 1545 | static struct ctl_table debug_table[] = { | 1551 | static struct ctl_table debug_table[] = { |
| 1546 | #if defined(CONFIG_X86) || defined(CONFIG_PPC) || defined(CONFIG_SPARC) || \ | 1552 | #ifdef CONFIG_SYSCTL_EXCEPTION_TRACE |
| 1547 | defined(CONFIG_S390) || defined(CONFIG_TILE) | ||
| 1548 | { | 1553 | { |
| 1549 | .procname = "exception-trace", | 1554 | .procname = "exception-trace", |
| 1550 | .data = &show_unhandled_signals, | 1555 | .data = &show_unhandled_signals, |
| @@ -2036,12 +2041,14 @@ int proc_dointvec_minmax(struct ctl_table *table, int write, | |||
| 2036 | 2041 | ||
| 2037 | static void validate_coredump_safety(void) | 2042 | static void validate_coredump_safety(void) |
| 2038 | { | 2043 | { |
| 2044 | #ifdef CONFIG_COREDUMP | ||
| 2039 | if (suid_dumpable == SUID_DUMPABLE_SAFE && | 2045 | if (suid_dumpable == SUID_DUMPABLE_SAFE && |
| 2040 | core_pattern[0] != '/' && core_pattern[0] != '|') { | 2046 | core_pattern[0] != '/' && core_pattern[0] != '|') { |
| 2041 | printk(KERN_WARNING "Unsafe core_pattern used with "\ | 2047 | printk(KERN_WARNING "Unsafe core_pattern used with "\ |
| 2042 | "suid_dumpable=2. Pipe handler or fully qualified "\ | 2048 | "suid_dumpable=2. Pipe handler or fully qualified "\ |
| 2043 | "core dump path required.\n"); | 2049 | "core dump path required.\n"); |
| 2044 | } | 2050 | } |
| 2051 | #endif | ||
| 2045 | } | 2052 | } |
| 2046 | 2053 | ||
| 2047 | static int proc_dointvec_minmax_coredump(struct ctl_table *table, int write, | 2054 | static int proc_dointvec_minmax_coredump(struct ctl_table *table, int write, |
| @@ -2053,6 +2060,7 @@ static int proc_dointvec_minmax_coredump(struct ctl_table *table, int write, | |||
| 2053 | return error; | 2060 | return error; |
| 2054 | } | 2061 | } |
| 2055 | 2062 | ||
| 2063 | #ifdef CONFIG_COREDUMP | ||
| 2056 | static int proc_dostring_coredump(struct ctl_table *table, int write, | 2064 | static int proc_dostring_coredump(struct ctl_table *table, int write, |
| 2057 | void __user *buffer, size_t *lenp, loff_t *ppos) | 2065 | void __user *buffer, size_t *lenp, loff_t *ppos) |
| 2058 | { | 2066 | { |
| @@ -2061,6 +2069,7 @@ static int proc_dostring_coredump(struct ctl_table *table, int write, | |||
| 2061 | validate_coredump_safety(); | 2069 | validate_coredump_safety(); |
| 2062 | return error; | 2070 | return error; |
| 2063 | } | 2071 | } |
| 2072 | #endif | ||
| 2064 | 2073 | ||
| 2065 | static int __do_proc_doulongvec_minmax(void *data, struct ctl_table *table, int write, | 2074 | static int __do_proc_doulongvec_minmax(void *data, struct ctl_table *table, int write, |
| 2066 | void __user *buffer, | 2075 | void __user *buffer, |
