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: <27c5b7e0a0a2492191d5f3716cd9b473@AcuMS.aculab.com>
Date: Thu, 28 Nov 2024 15:52:53 +0000
From: David Laight <David.Laight@...LAB.COM>
To: 'kernel test robot' <lkp@...el.com>, Linus Torvalds
	<torvalds@...ux-foundation.org>
CC: "llvm@...ts.linux.dev" <llvm@...ts.linux.dev>,
	"oe-kbuild-all@...ts.linux.dev" <oe-kbuild-all@...ts.linux.dev>, LKML
	<linux-kernel@...r.kernel.org>, 'Arnd Bergmann' <arnd@...nel.org>, "'Jens
 Axboe'" <axboe@...nel.dk>, 'Matthew Wilcox' <willy@...radead.org>,
	"'Christoph Hellwig'" <hch@...radead.org>, 'Andrew Morton'
	<akpm@...ux-foundation.org>, Linux Memory Management List
	<linux-mm@...ck.org>, 'Andy Shevchenko' <andriy.shevchenko@...ux.intel.com>,
	'Dan Carpenter' <dan.carpenter@...aro.org>, "'Jason A . Donenfeld'"
	<Jason@...c4.com>, "'pedro.falcato@...il.com'" <pedro.falcato@...il.com>,
	'Mateusz Guzik' <mjguzik@...il.com>, 'Lorenzo Stoakes'
	<lorenzo.stoakes@...cle.com>
Subject: RE: [PATCH next 6/7] minmax.h: Simplify the variants of clamp()

From: kernel test robot
> Sent: 28 November 2024 15:05
> 
> Hi David,
> 
> kernel test robot noticed the following build warnings:
> 
> [auto build test WARNING on next-20241121]
> 
> url:    https://github.com/intel-lab-lkp/linux/commits/David-Laight/minmax-h-Add-whitespace-around-
> operators-and-after-commas/20241121-152617
> base:   next-20241121
> patch link:    https://lore.kernel.org/r/8f69f4deac014f558bab186444bac2e8%40AcuMS.aculab.com
> patch subject: [PATCH next 6/7] minmax.h: Simplify the variants of clamp()
> config: s390-allmodconfig (https://download.01.org/0day-ci/archive/20241128/202411282222.oF0B4110-
> lkp@...el.com/config)
> compiler: clang version 20.0.0git (https://github.com/llvm/llvm-project
> 592c0fe55f6d9a811028b5f3507be91458ab2713)
> reproduce (this is a W=1 build): (https://download.01.org/0day-
> ci/archive/20241128/202411282222.oF0B4110-lkp@...el.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/202411282222.oF0B4110-lkp@intel.com/
...
> vim +414 drivers/iio/magnetometer/yamaha-yas530.c
...
> 65f79b50103067 Jakob Hauser  2022-08-13  407  	if (yas5xx->version == YAS537_VERSION_1) {
> 65f79b50103067 Jakob Hauser  2022-08-13  408  		for (i = 0; i < 3; i++)
> 65f79b50103067 Jakob Hauser  2022-08-13  409  			s[i] = xy1y2[i] - BIT(13);
> 65f79b50103067 Jakob Hauser  2022-08-13  410  		h[0] = (c->k *   (128 * s[0] + c->a2 * s[1] + c-> >a3 * s[2])) / BIT(13);
> 65f79b50103067 Jakob Hauser  2022-08-13  411  		h[1] = (c->k * (c->a4 * s[0] + c->a5 * s[1] + c-> >a6 * s[2])) / BIT(13);
> 65f79b50103067 Jakob Hauser  2022-08-13  412  		h[2] = (c->k * (c->a7 * s[0] + c->a8 * s[1] + c-> >a9 * s[2])) / BIT(13);
> 65f79b50103067 Jakob Hauser  2022-08-13  413  		for (i = 0; i < 3; i++) {
> 65f79b50103067 Jakob Hauser  2022-08-13 @414  			clamp_val(h[i], -BIT(13), BIT(13) - 1);
> 65f79b50103067 Jakob Hauser  2022-08-13  415  			xy1y2[i] = h[i] + BIT(13);
> 65f79b50103067 Jakob Hauser  2022-08-13  416  		}
> 65f79b50103067 Jakob Hauser  2022-08-13  417  	}

Duplicate, very buggy code...
It very much needs BIT(13) to be signed.
And it shouldn't ignore the result of clamp()

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ