diff options
Diffstat (limited to 'kernel/sysctl.c')
-rw-r--r-- | kernel/sysctl.c | 33 |
1 files changed, 13 insertions, 20 deletions
diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 706309f9ed84..8c8714fcb53c 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c | |||
@@ -63,11 +63,12 @@ | |||
63 | #include <linux/capability.h> | 63 | #include <linux/capability.h> |
64 | #include <linux/binfmts.h> | 64 | #include <linux/binfmts.h> |
65 | #include <linux/sched/sysctl.h> | 65 | #include <linux/sched/sysctl.h> |
66 | #include <linux/sched/coredump.h> | ||
66 | #include <linux/kexec.h> | 67 | #include <linux/kexec.h> |
67 | #include <linux/bpf.h> | 68 | #include <linux/bpf.h> |
68 | #include <linux/mount.h> | 69 | #include <linux/mount.h> |
69 | 70 | ||
70 | #include <asm/uaccess.h> | 71 | #include <linux/uaccess.h> |
71 | #include <asm/processor.h> | 72 | #include <asm/processor.h> |
72 | 73 | ||
73 | #ifdef CONFIG_X86 | 74 | #ifdef CONFIG_X86 |
@@ -347,13 +348,6 @@ static struct ctl_table kern_table[] = { | |||
347 | .mode = 0644, | 348 | .mode = 0644, |
348 | .proc_handler = proc_dointvec, | 349 | .proc_handler = proc_dointvec, |
349 | }, | 350 | }, |
350 | { | ||
351 | .procname = "sched_shares_window_ns", | ||
352 | .data = &sysctl_sched_shares_window, | ||
353 | .maxlen = sizeof(unsigned int), | ||
354 | .mode = 0644, | ||
355 | .proc_handler = proc_dointvec, | ||
356 | }, | ||
357 | #ifdef CONFIG_SCHEDSTATS | 351 | #ifdef CONFIG_SCHEDSTATS |
358 | { | 352 | { |
359 | .procname = "sched_schedstats", | 353 | .procname = "sched_schedstats", |
@@ -423,7 +417,7 @@ static struct ctl_table kern_table[] = { | |||
423 | }, | 417 | }, |
424 | { | 418 | { |
425 | .procname = "sched_rr_timeslice_ms", | 419 | .procname = "sched_rr_timeslice_ms", |
426 | .data = &sched_rr_timeslice, | 420 | .data = &sysctl_sched_rr_timeslice, |
427 | .maxlen = sizeof(int), | 421 | .maxlen = sizeof(int), |
428 | .mode = 0644, | 422 | .mode = 0644, |
429 | .proc_handler = sched_rr_handler, | 423 | .proc_handler = sched_rr_handler, |
@@ -634,7 +628,7 @@ static struct ctl_table kern_table[] = { | |||
634 | .data = &tracepoint_printk, | 628 | .data = &tracepoint_printk, |
635 | .maxlen = sizeof(tracepoint_printk), | 629 | .maxlen = sizeof(tracepoint_printk), |
636 | .mode = 0644, | 630 | .mode = 0644, |
637 | .proc_handler = proc_dointvec, | 631 | .proc_handler = tracepoint_printk_sysctl, |
638 | }, | 632 | }, |
639 | #endif | 633 | #endif |
640 | #ifdef CONFIG_KEXEC_CORE | 634 | #ifdef CONFIG_KEXEC_CORE |
@@ -990,13 +984,6 @@ static struct ctl_table kern_table[] = { | |||
990 | .proc_handler = proc_dointvec, | 984 | .proc_handler = proc_dointvec, |
991 | }, | 985 | }, |
992 | { | 986 | { |
993 | .procname = "kstack_depth_to_print", | ||
994 | .data = &kstack_depth_to_print, | ||
995 | .maxlen = sizeof(int), | ||
996 | .mode = 0644, | ||
997 | .proc_handler = proc_dointvec, | ||
998 | }, | ||
999 | { | ||
1000 | .procname = "io_delay_type", | 987 | .procname = "io_delay_type", |
1001 | .data = &io_delay_type, | 988 | .data = &io_delay_type, |
1002 | .maxlen = sizeof(int), | 989 | .maxlen = sizeof(int), |
@@ -2146,9 +2133,12 @@ static int do_proc_douintvec_conv(bool *negp, unsigned long *lvalp, | |||
2146 | if (write) { | 2133 | if (write) { |
2147 | if (*negp) | 2134 | if (*negp) |
2148 | return -EINVAL; | 2135 | return -EINVAL; |
2136 | if (*lvalp > UINT_MAX) | ||
2137 | return -EINVAL; | ||
2149 | *valp = *lvalp; | 2138 | *valp = *lvalp; |
2150 | } else { | 2139 | } else { |
2151 | unsigned int val = *valp; | 2140 | unsigned int val = *valp; |
2141 | *negp = false; | ||
2152 | *lvalp = (unsigned long)val; | 2142 | *lvalp = (unsigned long)val; |
2153 | } | 2143 | } |
2154 | return 0; | 2144 | return 0; |
@@ -2403,9 +2393,11 @@ static void validate_coredump_safety(void) | |||
2403 | #ifdef CONFIG_COREDUMP | 2393 | #ifdef CONFIG_COREDUMP |
2404 | if (suid_dumpable == SUID_DUMP_ROOT && | 2394 | if (suid_dumpable == SUID_DUMP_ROOT && |
2405 | core_pattern[0] != '/' && core_pattern[0] != '|') { | 2395 | core_pattern[0] != '/' && core_pattern[0] != '|') { |
2406 | printk(KERN_WARNING "Unsafe core_pattern used with "\ | 2396 | printk(KERN_WARNING |
2407 | "suid_dumpable=2. Pipe handler or fully qualified "\ | 2397 | "Unsafe core_pattern used with fs.suid_dumpable=2.\n" |
2408 | "core dump path required.\n"); | 2398 | "Pipe handler or fully qualified core dump path required.\n" |
2399 | "Set kernel.core_pattern before fs.suid_dumpable.\n" | ||
2400 | ); | ||
2409 | } | 2401 | } |
2410 | #endif | 2402 | #endif |
2411 | } | 2403 | } |
@@ -2487,6 +2479,7 @@ static int __do_proc_doulongvec_minmax(void *data, struct ctl_table *table, int | |||
2487 | break; | 2479 | break; |
2488 | if (neg) | 2480 | if (neg) |
2489 | continue; | 2481 | continue; |
2482 | val = convmul * val / convdiv; | ||
2490 | if ((min && val < *min) || (max && val > *max)) | 2483 | if ((min && val < *min) || (max && val > *max)) |
2491 | continue; | 2484 | continue; |
2492 | *i = val; | 2485 | *i = val; |