Re: [PATCH 2/3] iio: light: veml6075: add bounds check to veml6075_it_ms index
From: Jonathan Cameron
Date: Sun May 17 2026 - 07:46:54 EST
On Sun, 17 May 2026 11:01:31 +0300
Andy Shevchenko <andriy.shevchenko@xxxxxxxxx> wrote:
> On Fri, May 15, 2026 at 03:33:07PM +0100, Jonathan Cameron wrote:
> > On Fri, 15 May 2026 08:17:18 +1300
> > "Javier Carrasco" <javier.carrasco.cruz@xxxxxxxxx> wrote:
> > > On Fri May 15, 2026 at 5:23 AM +13, Greg Kroah-Hartman wrote:
>
> > > > veml6075_it_ms has 5 elements but VEML6075_CONF_IT can yield
> > > > values 0-7. If it returns a value >= 5, this causes an
> > > > out-of-bounds array access. Add a bounds check and return
> > > > -EINVAL if the index is out of range.
> >
> > I'd prefer it if this sort of change called out that we don't expect
> > to ever see those values except when we have bus corruption or
> > a broken device. Good to protect against but that info might help
> > folk decide whether to backport or not.
> >
> > I'll add a note whilst applying. Applied to the fixes-togreg
> > branch of iio.git. I also rewrapped the description as 60 chars
> > is rather short.
>
> Can you also clean up the commit messages from Cc list?
>
I did. Forgot to say. Those have little value once it's merged.
(and can go below the --- to make my life easier ;)
J