aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sysctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/sysctl.c')
-rw-r--r--kernel/sysctl.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 3c0998426b57..2082b1a88fb9 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -1981,7 +1981,15 @@ static int do_proc_dointvec_conv(bool *negp, unsigned long *lvalp,
1981 int write, void *data) 1981 int write, void *data)
1982{ 1982{
1983 if (write) { 1983 if (write) {
1984 *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 }
1985 } else { 1993 } else {
1986 int val = *valp; 1994 int val = *valp;
1987 if (val < 0) { 1995 if (val < 0) {