lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250622151229.4e56e8ae@jic23-huawei>
Date: Sun, 22 Jun 2025 15:12:29 +0100
From: Jonathan Cameron <jic23@...nel.org>
To: kernel test robot <lkp@...el.com>
Cc: Marcelo Schmitt <marcelo.schmitt@...log.com>, linux-iio@...r.kernel.org,
 devicetree@...r.kernel.org, linux-gpio@...r.kernel.org,
 linux-kernel@...r.kernel.org, oe-kbuild-all@...ts.linux.dev,
 lars@...afoo.de, Michael.Hennerich@...log.com, dlechner@...libre.com,
 nuno.sa@...log.com, andy@...nel.org, robh@...nel.org, krzk+dt@...nel.org,
 conor+dt@...nel.org, linus.walleij@...aro.org, brgl@...ev.pl,
 broonie@...nel.org, lgirdwood@...il.com, marcelo.schmitt1@...il.com
Subject: Re: [PATCH v6 06/12] iio: adc: ad4170: Add digital filter and
 sample frequency config support

On Fri, 20 Jun 2025 10:38:58 +0800
kernel test robot <lkp@...el.com> wrote:

> Hi Marcelo,
> 
> kernel test robot noticed the following build warnings:
> 
> [auto build test WARNING on 4c6073fec2fee4827fa0dd8a4ab4e6f7bbc05ee6]
> 
> url:    https://github.com/intel-lab-lkp/linux/commits/Marcelo-Schmitt/dt-bindings-iio-adc-Add-AD4170/20250619-014200
> base:   4c6073fec2fee4827fa0dd8a4ab4e6f7bbc05ee6
> patch link:    https://lore.kernel.org/r/bc0261373936511a6ae5b25082e36ac5f112f6db.1750258776.git.marcelo.schmitt%40analog.com
> patch subject: [PATCH v6 06/12] iio: adc: ad4170: Add digital filter and sample frequency config support
> config: microblaze-randconfig-r133-20250620 (https://download.01.org/0day-ci/archive/20250620/202506201000.WjqDvyXl-lkp@intel.com/config)
> compiler: microblaze-linux-gcc (GCC) 8.5.0
> reproduce: (https://download.01.org/0day-ci/archive/20250620/202506201000.WjqDvyXl-lkp@intel.com/reproduce)
> 
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@...el.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202506201000.WjqDvyXl-lkp@intel.com/
> 
> All warnings (new ones prefixed by >>):
> 
>    drivers/iio/adc/ad4170.c: In function 'ad4170_read_avail':
> >> drivers/iio/adc/ad4170.c:1237:18: warning: array subscript 4294967274 is above array bounds of 'int[3][18][2]' [-Warray-bounds]  
>       *vals = (int *)st->sps_tbl[f_type];
>                      ^~
> 
> 
> vim +1237 drivers/iio/adc/ad4170.c
> 
>   1219	
>   1220	static int ad4170_read_avail(struct iio_dev *indio_dev,
>   1221				     struct iio_chan_spec const *chan,
>   1222				     const int **vals, int *type, int *length,
>   1223				     long info)
>   1224	{
>   1225		struct ad4170_state *st = iio_priv(indio_dev);
>   1226		struct ad4170_chan_info *chan_info = &st->chan_infos[chan->address];
>   1227		enum ad4170_filter_type f_type;
>   1228	
>   1229		switch (info) {
>   1230		case IIO_CHAN_INFO_SCALE:
>   1231			*vals = (int *)chan_info->scale_tbl;
>   1232			*length = ARRAY_SIZE(chan_info->scale_tbl) * 2;
>   1233			*type = IIO_VAL_INT_PLUS_NANO;
>   1234			return IIO_AVAIL_LIST;
>   1235		case IIO_CHAN_INFO_SAMP_FREQ:
>   1236			f_type = ad4170_get_filter_type(indio_dev, chan);
> > 1237			*vals = (int *)st->sps_tbl[f_type];  

I think this needs an error check as the function can return -EINVAL ?

>   1238			*type = IIO_VAL_INT_PLUS_MICRO;
>   1239			switch (f_type) {
>   1240			case AD4170_SINC5_AVG:
>   1241			case AD4170_SINC3:
>   1242				*length = ARRAY_SIZE(ad4170_sinc3_filt_fs_tbl) * 2;
>   1243				return IIO_AVAIL_LIST;
>   1244			case AD4170_SINC5:
>   1245				*length = ARRAY_SIZE(ad4170_sinc5_filt_fs_tbl) * 2;
>   1246				return IIO_AVAIL_LIST;
>   1247			default:
>   1248				return -EINVAL;
>   1249			}
>   1250		default:
>   1251			return -EINVAL;
>   1252		}
>   1253	}
>   1254	
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ