Re: [PATCH] iio: core: fix signed integer overflow in

From: Rodrigo Alencar

Date: Thu Oct 22 2026 - 06:21:00 EST


On 22/10/26 13:54, Arnav Kapoor wrote:
> (Resending with the list Cc'd, sorry for the duplicate, Andy.)
>
> On Thu, Oct 22, 2026 at 10:08:10AM +0300, Andy Shevchenko wrote:
> > This needs a Fixes tag, otherwise it probably won't needed as Rodrigo working
> > towards tons of improvements in this area.
>
> Will add:
>
> Fixes: 6807d7211327 ("iio: Factor out fixed point number parsing into its own function")
>
> > OTOH, Rodrigo's test cases might be good as part of this fix as well.
>
> As far as I can see, Rodrigo's tests in the E notation RFC exercise
> kstrtodec64() in lib/test-kstrtox.c, so they won't cover the current
> parser. I'd rather keep the fix small for backporting and send KUnit
> cases for iio_str_to_fixpoint() as a separate patch, if that's OK.

The current parser is being dropped in the E notation series, so that
overflow concerns are handled differently. iio_str_to_fixpoint() is being
tested there indirectly with tests on iio_write_channel_info(), maybe not
is thorough as it should, but it tries to focus on different format types
and coverage. Dedicated parsing tests with different inputs are handled
in lib/test-kstrtox.c. With that, not sure you need a KUnit test for the
current parser. Only small fix meant for backporting would make sense to me.

--
Kind regards,

Rodrigo Alencar