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

From: Richard Weinberger
Date: Thu Jun 08 2023 - 12:14:40 EST


----- Ursprüngliche Mail -----
> Von: "Andy Shevchenko" <andriy.shevchenko@xxxxxxxxxxxxxxx>
>> 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?

Thanks,
//richard