Re: [PATCH] kstrtox: delete saturation in case of overflow

From: Andrew Morton

Date: Thu Sep 17 2026 - 20:04:21 EST


On Thu, 17 Sep 2026 19:17:07 +0300 Alexey Dobriyan <adobriyan@xxxxxxxxx> wrote:

> >From 161367fd1e8b41e938274923bbb3d26de69f7a7e Mon Sep 17 00:00:00 2001
> From: Alexey Dobriyan <adobriyan@xxxxxxxxx>
> Date: Thu, 17 Sep 2026 18:49:18 +0300
> Subject: [PATCH 1/1] kstrtox: delete saturation in case of overflow
>
> Partially revert
>
> commit 6e30111dbb4075e3c26c230417b32bc4a1c66831
> lib: fix _parse_integer_limit() to handle overflow
>
> Originally, kstrto* was written in a way to keep simple_strto*()
> functions as is, so that they continue to return incorrect result
> if integer overflow occurs.
>
> Saturation doesn't do anything useful, it just creates second incorrect
> value and potentially breaks simple_strto*() users.
>
> Caller can decide to saturate itself anyway.
>
> Move saturation to memparse() from where the idea came from.

I don't know what this patch does :(

Can we define/explain "saturation"?

Should we be updating lib/tests/cmdline_kunit.c when altering memparse?