[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aY3Yp89R1cl-sacD@smile.fi.intel.com>
Date: Thu, 12 Feb 2026 15:41:59 +0200
From: Andy Shevchenko <andriy.shevchenko@...el.com>
To: Dmitry Antipov <dmantipov@...dex.ru>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
David Laight <david.laight.linux@...il.com>,
Kees Cook <kees@...nel.org>, "Darrick J . Wong" <djwong@...nel.org>,
linux-hardening@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v7 1/5] lib: fix _parse_integer_limit() to handle overflow
On Thu, Feb 12, 2026 at 03:56:24PM +0300, Dmitry Antipov wrote:
> In '_parse_integer_limit()', adjust native integer arithmetic
> with near-to-overflow branch where 'check_mul_overflow()' and
> 'check_add_overflow()' are used to check whether an intermediate
> result goes out of range, and denote such a case with ULLONG_MAX,
> thus making the function more similar to standard C library's
> 'strtoull()'. Adjust comment to kernel-doc style as well.
...
> + for (rv = 0; max_chars--; rv++, s++) {
Hmm... is max_chars being used inside for-loop body? I would rather use regular
pattern here:
for (rv = 0; rv < max_chars; rv++, s++) {
(just check that any integer / sign promotion doesn't change the logic).
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists