[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZIIAnhriitHDR2Vq@smile.fi.intel.com>
Date: Thu, 8 Jun 2023 19:23:58 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Richard Weinberger <richard@....at>
Cc: linux-hardening <linux-hardening@...r.kernel.org>,
netdev <netdev@...r.kernel.org>,
linux-kernel <linux-kernel@...r.kernel.org>,
Kees Cook <keescook@...omium.org>,
Petr Mladek <pmladek@...e.com>,
Steven Rostedt <rostedt@...dmis.org>,
senozhatsky <senozhatsky@...omium.org>,
Rasmus Villemoes <linux@...musvillemoes.dk>,
davem <davem@...emloft.net>, edumazet <edumazet@...gle.com>,
kuba <kuba@...nel.org>, pabeni <pabeni@...hat.com>,
Miguel Ojeda <ojeda@...nel.org>,
Alex Gaynor <alex.gaynor@...il.com>,
Wedson Almeida Filho <wedsonaf@...il.com>,
Boqun Feng <boqun.feng@...il.com>, Gary Guo <gary@...yguo.net>,
Björn Roy Baron <bjorn3_gh@...tonmail.com>,
Benno Lossin <benno.lossin@...ton.me>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Jesper Dangaard Brouer <hawk@...nel.org>,
John Fastabend <john.fastabend@...il.com>
Subject: Re: [RFC PATCH 1/1] vsprintf: Warn on integer scanning overflows
On Thu, Jun 08, 2023 at 06:14:33PM +0200, Richard Weinberger wrote:
> ----- Ursprüngliche Mail -----
> > Von: "Andy Shevchenko" <andriy.shevchenko@...ux.intel.com>
> >> 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
Powered by blists - more mailing lists