X-Git-Url: http://git.monstr.eu/?a=blobdiff_plain;f=kernel%2Fucount.c;h=06ea04d4468522aac6526a986d14429490c9bbef;hb=0b0894ff78cc47bc72d53ec340e4898782189868;hp=65b597431c861aa4a949e4914f073118aa7b0567;hpb=85d24ad38bc4658ce9a16b85b9c8dc0577d66c71;p=linux-2.6-microblaze.git diff --git a/kernel/ucount.c b/kernel/ucount.c index 65b597431c86..06ea04d44685 100644 --- a/kernel/ucount.c +++ b/kernel/ucount.c @@ -350,7 +350,8 @@ bool is_ucounts_overlimit(struct ucounts *ucounts, enum ucount_type type, unsign if (rlimit > LONG_MAX) max = LONG_MAX; for (iter = ucounts; iter; iter = iter->ns->ucounts) { - if (get_ucounts_value(iter, type) > max) + long val = get_ucounts_value(iter, type); + if (val < 0 || val > max) return true; max = READ_ONCE(iter->ns->ucount_max[type]); }