diff options
Diffstat (limited to 'kernel/sysctl.c')
-rw-r--r-- | kernel/sysctl.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 42b7fc2860c1..2082b1a88fb9 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c | |||
@@ -93,11 +93,9 @@ | |||
93 | #include <linux/nmi.h> | 93 | #include <linux/nmi.h> |
94 | #endif | 94 | #endif |
95 | 95 | ||
96 | |||
97 | #if defined(CONFIG_SYSCTL) | 96 | #if defined(CONFIG_SYSCTL) |
98 | 97 | ||
99 | /* External variables not in a header file. */ | 98 | /* External variables not in a header file. */ |
100 | extern int max_threads; | ||
101 | extern int suid_dumpable; | 99 | extern int suid_dumpable; |
102 | #ifdef CONFIG_COREDUMP | 100 | #ifdef CONFIG_COREDUMP |
103 | extern int core_uses_pid; | 101 | extern int core_uses_pid; |
@@ -710,10 +708,10 @@ static struct ctl_table kern_table[] = { | |||
710 | #endif | 708 | #endif |
711 | { | 709 | { |
712 | .procname = "threads-max", | 710 | .procname = "threads-max", |
713 | .data = &max_threads, | 711 | .data = NULL, |
714 | .maxlen = sizeof(int), | 712 | .maxlen = sizeof(int), |
715 | .mode = 0644, | 713 | .mode = 0644, |
716 | .proc_handler = proc_dointvec, | 714 | .proc_handler = sysctl_max_threads, |
717 | }, | 715 | }, |
718 | { | 716 | { |
719 | .procname = "random", | 717 | .procname = "random", |
@@ -1983,7 +1981,15 @@ static int do_proc_dointvec_conv(bool *negp, unsigned long *lvalp, | |||
1983 | int write, void *data) | 1981 | int write, void *data) |
1984 | { | 1982 | { |
1985 | if (write) { | 1983 | if (write) { |
1986 | *valp = *negp ? -*lvalp : *lvalp; | 1984 | if (*negp) { |
1985 | if (*lvalp > (unsigned long) INT_MAX + 1) | ||
1986 | return -EINVAL; | ||
1987 | *valp = -*lvalp; | ||
1988 | } else { | ||
1989 | if (*lvalp > (unsigned long) INT_MAX) | ||
1990 | return -EINVAL; | ||
1991 | *valp = *lvalp; | ||
1992 | } | ||
1987 | } else { | 1993 | } else { |
1988 | int val = *valp; | 1994 | int val = *valp; |
1989 | if (val < 0) { | 1995 | if (val < 0) { |