[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZIHlZsPMZ2dI5/yG@smile.fi.intel.com>
Date: Thu, 8 Jun 2023 17:27:50 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Richard Weinberger <richard@....at>
Cc: linux-hardening@...r.kernel.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, keescook@...omium.org,
Petr Mladek <pmladek@...e.com>,
Steven Rostedt <rostedt@...dmis.org>,
Sergey Senozhatsky <senozhatsky@...omium.org>,
Rasmus Villemoes <linux@...musvillemoes.dk>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <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 12:37:55AM +0200, Richard Weinberger wrote:
> The scanf function family has no way to indicate overflows
> while scanning. As consequence users of these function have to make
> sure their input cannot cause an overflow.
> Since this is not always the case add WARN_ON_ONCE() guards to
> trigger a warning upon an overflow.
...
> 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.
> /* FIXME */
...and that's why this one is here.
> cp += (rv & ~KSTRTOX_OVERFLOW);
> } else {
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists