Re: [PATCH 1/1] Revert "lib: fix _parse_integer_limit() to handle overflow"

From: Alexey Dobriyan

Date: Fri Jul 03 2026 - 06:21:24 EST


On Fri, Jul 03, 2026 at 09:52:34AM +0300, Dmitry Antipov wrote:
> On 7/3/26 9:05 AM, Andy Shevchenko wrote:
>
> > +1. We need test cases, since there were none what is the real life example of
> > the breakage?
>
> I've (qemu-)tried:
>
> CONFIG_PRINTF_KUNIT_TEST=y
> CONFIG_SCANF_KUNIT_TEST=y
> CONFIG_CMDLINE_KUNIT_TEST=y
>
> on x86_64, arm, and riscv - without seeing anything suspicious...

This code was written in such a way to have common code between old
scanf/strtoul code (which parsed incorrectly) and new kstrt*() code.
scanf/strtoul instances were left alone to rot.

You can not do "res = ULLONG_MAX;"