Subject: Re: [RFC PATCH 1/1] vsprintf: Warn on integer scanning overflows

From: Andy Shevchenko <[email-masked]>
Date: Thu, 8 Jun 2023 19:23:58 +0300

On Thu, Jun 08, 2023 at 06:14:33PM +0200, Richard Weinberger wrote:
> ----- Ursprüngliche Mail -----
> > Von: "Andy Shevchenko" <[email-masked]>
> >>  	if (prefix_chars < max_chars) {
> >>  		rv = _parse_integer_limit(cp, base, &result, max_chars - prefix_chars);
> >> +		WARN_ON_ONCE(rv & KSTRTOX_OVERFLOW);
> > 
> > This seems incorrect. simple_strto*() are okay to overflow. It's by design.
> 
> Is this design decision also known to all users of scanf functions in the kernel?

We have test_scanf.c. Does it miss any test cases? Please add them!

-- 
With Best Regards,
Andy Shevchenko