X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=kernel%2Fsysctl.c;h=8c8714fcb53c35a390becf14f2fa8e1bfc20142c;hb=639a93a521c759ddb32cc875f3ea1965072b2cbc;hp=bb260ceb3718477fe1cce3c5690c42be4c30087e;hpb=c1aac62f36c1e37ee81c9e09ee9ee733eef05dcb;p=karo-tx-linux.git diff --git a/kernel/sysctl.c b/kernel/sysctl.c index bb260ceb3718..8c8714fcb53c 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -63,6 +63,7 @@ #include #include #include +#include #include #include #include @@ -2132,9 +2133,12 @@ static int do_proc_douintvec_conv(bool *negp, unsigned long *lvalp, if (write) { if (*negp) return -EINVAL; + if (*lvalp > UINT_MAX) + return -EINVAL; *valp = *lvalp; } else { unsigned int val = *valp; + *negp = false; *lvalp = (unsigned long)val; } return 0;