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]
Date:   Thu, 15 Jun 2023 14:22:45 +0300
From:   Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To:     kernel test robot <lkp@...el.com>
Cc:     Alexander Lobakin <alexandr.lobakin@...el.com>,
        llvm@...ts.linux.dev, oe-kbuild-all@...ts.linux.dev,
        linux-kernel@...r.kernel.org, Yury Norov <yury.norov@...il.com>
Subject: Re: lib/test_bitmap.c:920:2: error: call to
 '__compiletime_assert_239' declared with 'error' attribute: BUILD_BUG_ON
 failed: !__builtin_constant_p(res)

On Thu, Jun 15, 2023 at 02:32:02PM +0800, kernel test robot wrote:
> Hi Alexander,
> 
> FYI, the error/warning still remains.
> 
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head:   b6dad5178ceaf23f369c3711062ce1f2afc33644
> commit: dc34d5036692c614eef23c1130ee42a201c316bf lib: test_bitmap: add compile-time optimization/evaluations assertions
> date:   12 months ago
> config: arm64-randconfig-r025-20230615 (https://download.01.org/0day-ci/archive/20230615/202306151433.QKcn7ZNn-lkp@intel.com/config)
> compiler: clang version 16.0.4 (https://github.com/llvm/llvm-project.git ae42196bc493ffe877a7e3dff8be32035dea4d07)
> reproduce (this is a W=1 build):
>         mkdir -p ~/bin
>         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         # install arm64 cross compiling tool for clang build
>         # apt-get install binutils-aarch64-linux-gnu
>         # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=dc34d5036692c614eef23c1130ee42a201c316bf
>         git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
>         git fetch --no-tags linus master
>         git checkout dc34d5036692c614eef23c1130ee42a201c316bf
>         # save the config file
>         mkdir build_dir && cp config build_dir/.config
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang ~/bin/make.cross W=1 O=build_dir ARCH=arm64 olddefconfig
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang ~/bin/make.cross W=1 O=build_dir ARCH=arm64 SHELL=/bin/bash lib/
> 
> 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/202306151433.QKcn7ZNn-lkp@intel.com/
> 
> All errors (new ones prefixed by >>):

>    888		/*
>    889		 * Equals to `unsigned long bitmap[1] = { GENMASK(6, 5), }`.
>    890		 * Clang on s390 optimizes bitops at compile-time as intended, but at
>    891		 * the same time stops treating @bitmap and @bitopvar as compile-time
>    892		 * constants after regular test_bit() is executed, thus triggering the
>    893		 * build bugs below. So, call const_test_bit() there directly until
>    894		 * the compiler is fixed.
>    895		 */
>    896		bitmap_clear(bitmap, 0, BITS_PER_LONG);
>    897	#if defined(__s390__) && defined(__clang__)
>    898		if (!const_test_bit(7, bitmap))
>    899	#else
>    900		if (!test_bit(7, bitmap))
>    901	#endif

Hmm... Reveals the bug in clang/arm64?

>    919		res = !test_bit(18, &bitopvar);
>  > 920		BUILD_BUG_ON(!__builtin_constant_p(res));
>    921		BUILD_BUG_ON(!res);


-- 
With Best Regards,
Andy Shevchenko


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ