mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dmitry Antipov <dmantipov@yandex.ru>
To: Rodrigo Alencar <455.rodrigo.alencar@gmail.com>,
	Andy Shevchenko <andriy.shevchenko@intel.com>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: David Laight <david.laight.linux@gmail.com>,
	Kees Cook <kees@kernel.org>,
	 "Darrick J . Wong"	 <djwong@kernel.org>,
	linux-hardening@vger.kernel.org, 	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v8 2/5] lib: fix memparse() to handle overflow
Date: Wed, 25 Feb 2026 09:58:32 +0300	[thread overview]
Message-ID: <61b376fd2acf6e8cf8a90ee4eb7d58397f2acfa1.camel@yandex.ru> (raw)
In-Reply-To: <pwycaqzyfpan3eglq6hwx4esyfm2w2buvvaqtcqw3aco5y3trq@2ft2ajxaqobu>

On Tue, 2026-02-24 at 14:15 +0000, Rodrigo Alencar wrote:

> > I am interested on having _parse_integer_limit() overflow check
> > exposed to kernel modules.

Hm... _parse_integer_limit() may be EXPORT_SYMBOL()ed of course.
But are you sure that current API is not enough for your task?

> > ...
> 
> I could propose the exposure of simple_strntoull() which is private
> to lib/vsprintf.c, slightly changing its prototype:
> 
> * from:
> unsigned long long simple_strntoull(const char *startp,
> 				    char **endp,
> 				    unsigned int base,
> 				    size_t max_chars)
> * to:
> int simple_strntoull(const char *startp,
> 		     char **endp,
> 		     unsigned long long *result,
> 		     unsigned int base,
> 		     size_t max_chars)
> 
> That would allow to tackle the FIXME tag. I suppose it is there
> because the overflow flag is being ignored, so the returned integer
> can be set to -ERANGE or -EOVERFLOW when overflow happens.

Well, removal of KSTRTOX_OVERFLOW quirk may be a subject for the next series.

Dmitry

  reply	other threads:[~2026-02-25  6:58 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-12 16:44 [PATCH v8 0/5] lib and lib/cmdline enhancements Dmitry Antipov
2026-02-12 16:44 ` [PATCH v8 1/5] lib: fix _parse_integer_limit() to handle overflow Dmitry Antipov
2026-02-12 16:44 ` [PATCH v8 2/5] lib: fix memparse() " Dmitry Antipov
2026-02-24 12:32   ` Rodrigo Alencar
2026-02-24 14:15     ` Rodrigo Alencar
2026-02-25  6:58       ` Dmitry Antipov [this message]
2026-02-12 16:44 ` [PATCH v8 3/5] lib: add more string to 64-bit integer conversion overflow tests Dmitry Antipov
2026-02-12 16:44 ` [PATCH v8 4/5] lib/cmdline_kunit: add test case for memparse() Dmitry Antipov
2026-02-12 16:44 ` [PATCH v8 5/5] lib/cmdline: adjust a few comments to fix kernel-doc -Wreturn warnings Dmitry Antipov
2026-02-18 13:40 ` [PATCH v8 0/5] lib and lib/cmdline enhancements Dmitry Antipov
2026-02-18 13:48   ` Andy Shevchenko
2026-04-02  6:56     ` Dmitry Antipov
2026-04-02  8:30       ` Andy Shevchenko
2026-04-02 16:00         ` Andrew Morton
2026-04-02 16:09           ` Andy Shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=61b376fd2acf6e8cf8a90ee4eb7d58397f2acfa1.camel@yandex.ru \
    --to=dmantipov@yandex.ru \
    --cc=455.rodrigo.alencar@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=andriy.shevchenko@intel.com \
    --cc=david.laight.linux@gmail.com \
    --cc=djwong@kernel.org \
    --cc=kees@kernel.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®