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] [day] [month] [year] [list]
Message-ID: <20250309204211.GA960576@ax162>
Date: Sun, 9 Mar 2025 21:42:11 +0100
From: Nathan Chancellor <nathan@...nel.org>
To: kernel test robot <lkp@...el.com>, wangweidong.a@...nic.com
Cc: lgirdwood@...il.com, broonie@...nel.org, robh@...nel.org,
	krzk+dt@...nel.org, conor+dt@...nel.org, perex@...ex.cz,
	tiwai@...e.com, ivprusov@...utedevices.com, jack.yu@...ltek.com,
	zhoubinbin@...ngson.cn, luca.ceresoli@...tlin.com,
	quic_pkumpatl@...cinc.com, paulha@...nsource.cirrus.com,
	rf@...nsource.cirrus.com, nuno.sa@...log.com,
	linux-sound@...r.kernel.org, devicetree@...r.kernel.org,
	linux-kernel@...r.kernel.org, llvm@...ts.linux.dev,
	oe-kbuild-all@...ts.linux.dev, yijiangtao@...nic.com
Subject: Re: [PATCH V2 2/2] ASoC: codecs: Add aw88166 amplifier driver

On Sat, Mar 08, 2025 at 02:20:22PM +0800, kernel test robot wrote:
> Hi,
> 
> kernel test robot noticed the following build warnings:
> 
> [auto build test WARNING on 1e15510b71c99c6e49134d756df91069f7d18141]
> 
> url:    https://github.com/intel-lab-lkp/linux/commits/wangweidong-a-awinic-com/ASoC-dt-bindings-Add-schema-for-awinic-aw88166/20250228-115709
> base:   1e15510b71c99c6e49134d756df91069f7d18141
> patch link:    https://lore.kernel.org/r/20250228034958.181934-3-wangweidong.a%40awinic.com
> patch subject: [PATCH V2 2/2] ASoC: codecs: Add aw88166 amplifier driver
> config: x86_64-buildonly-randconfig-004-20250308 (https://download.01.org/0day-ci/archive/20250308/202503081433.xufVVq8t-lkp@intel.com/config)
> compiler: clang version 19.1.7 (https://github.com/llvm/llvm-project cd708029e0b2869e80abe31ddb175f7c35361f90)
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250308/202503081433.xufVVq8t-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/202503081433.xufVVq8t-lkp@intel.com/
> 
> All warnings (new ones prefixed by >>):
> 
> >> sound/soc/codecs/snd-soc-aw88166.o: warning: objtool: .text.aw_dev_dsp_update_cfg: unexpected end of section

Neat, it looks like LTO allows clang to figure out that through inlining
that...

  | static int aw_dev_dsp_read(struct aw_device *aw_dev,
  |         unsigned short dsp_addr, unsigned int *dsp_data, unsigned char data_type)
  | {
  |     ...
  |     case AW88166_DSP_32_DATA:
  |         ret = aw_dev_dsp_read_32bit(aw_dev, dsp_addr, dsp_data);
  |         if (ret)
  |             dev_err(aw_dev->dev, "read dsp_addr[0x%x] 32r-bit dsp_data[0x%x] failed",
  |                     (u32)dsp_addr, *dsp_data);

                                       ^ This is an uninitialized read...

  | static int aw_dev_dsp_read_32bit(struct aw_device *aw_dev,
  |         unsigned short dsp_addr, unsigned int *dsp_data)
  | {
  |     unsigned int temp_data;
  |     int ret;
  |
  |     ret = regmap_write(aw_dev->regmap, AW88166_DSPMADD_REG, dsp_addr);
  |     if (ret) {
  |         dev_err(aw_dev->dev, "%s write error, ret=%d", __func__, ret);
  |         return ret;
  |     }
  |
  |     ret = regmap_read(aw_dev->regmap, AW88166_DSPMDAT_REG, &temp_data);
  |     if (ret) {
  |         dev_err(aw_dev->dev, "%s read error, ret=%d", __func__, ret);
  |         return ret;
  |     }
  |     *dsp_data = temp_data;

when either of the two error statements occur before this assignment...

  | static int aw_dev_get_ra(struct aw_cali_desc *cali_desc)
  | {
  |     struct aw_device *aw_dev =
  |         container_of(cali_desc, struct aw_device, cali_desc);
  |     u32 dsp_ra;
  |     int ret;
  |
  |     ret = aw_dev_dsp_read(aw_dev, AW88166_DSP_REG_CFG_ADPZ_RA,
  |                 &dsp_ra, AW88166_DSP_32_DATA);

                    ^ because it was not initialized prior to this point.

Initializng dsp_ra to 0 in aw_dev_get_ra() resolves the issue but that
may or may not be correct, it just shows where the issue lies.

Cheers,
Nathan

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ