[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202211182203.OuFpAevN-lkp@intel.com>
Date: Fri, 18 Nov 2022 22:09:53 +0800
From: kernel test robot <lkp@...el.com>
To: Kees Cook <keescook@...omium.org>
Cc: oe-kbuild-all@...ts.linux.dev, linux-kernel@...r.kernel.org,
David Gow <davidgow@...gle.com>
Subject: lib/fortify_kunit.c:28:9: sparse: sparse: incompatible types for
operation (==):
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 84368d882b9688bfac77ce48d33b1e20a4e4a787
commit: 875bfd5276f31d09e811d31fca638b9f4d1205e8 fortify: Add KUnit test for FORTIFY_SOURCE internals
date: 2 months ago
config: arm64-randconfig-s053-20221118
compiler: aarch64-linux-gcc (GCC) 12.1.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.4-39-gce1a6720-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=875bfd5276f31d09e811d31fca638b9f4d1205e8
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 875bfd5276f31d09e811d31fca638b9f4d1205e8
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=arm64 SHELL=/bin/bash
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>
sparse warnings: (new ones prefixed by >>)
lib/fortify_kunit.c:28:9: sparse: sparse: undefined identifier '__compiletime_strlen'
lib/fortify_kunit.c:28:9: sparse: sparse: undefined identifier '__compiletime_strlen'
>> lib/fortify_kunit.c:28:9: sparse: sparse: incompatible types for operation (==):
>> lib/fortify_kunit.c:28:9: sparse: bad type const __left
>> lib/fortify_kunit.c:28:9: sparse: int const __right
lib/fortify_kunit.c:29:9: sparse: sparse: undefined identifier '__compiletime_strlen'
lib/fortify_kunit.c:29:9: sparse: sparse: undefined identifier '__compiletime_strlen'
lib/fortify_kunit.c:29:9: sparse: sparse: incompatible types for operation (==):
lib/fortify_kunit.c:29:9: sparse: bad type const __left
lib/fortify_kunit.c:29:9: sparse: int const __right
lib/fortify_kunit.c:30:9: sparse: sparse: undefined identifier '__compiletime_strlen'
lib/fortify_kunit.c:30:9: sparse: sparse: undefined identifier '__compiletime_strlen'
lib/fortify_kunit.c:30:9: sparse: sparse: incompatible types for operation (==):
lib/fortify_kunit.c:30:9: sparse: bad type const __left
lib/fortify_kunit.c:30:9: sparse: int const __right
lib/fortify_kunit.c:32:9: sparse: sparse: undefined identifier '__compiletime_strlen'
lib/fortify_kunit.c:32:9: sparse: sparse: undefined identifier '__compiletime_strlen'
lib/fortify_kunit.c:32:9: sparse: sparse: incompatible types for operation (==):
lib/fortify_kunit.c:32:9: sparse: bad type const __left
>> lib/fortify_kunit.c:32:9: sparse: unsigned long const __right
lib/fortify_kunit.c:34:9: sparse: sparse: undefined identifier '__compiletime_strlen'
lib/fortify_kunit.c:34:9: sparse: sparse: undefined identifier '__compiletime_strlen'
lib/fortify_kunit.c:34:9: sparse: sparse: incompatible types for operation (==):
lib/fortify_kunit.c:34:9: sparse: bad type const __left
lib/fortify_kunit.c:34:9: sparse: unsigned long const __right
lib/fortify_kunit.c:56:16: sparse: sparse: undefined identifier '__compiletime_strlen'
vim +28 lib/fortify_kunit.c
25
26 static void known_sizes_test(struct kunit *test)
27 {
> 28 KUNIT_EXPECT_EQ(test, __compiletime_strlen("88888888"), 8);
29 KUNIT_EXPECT_EQ(test, __compiletime_strlen(array_of_10), 10);
30 KUNIT_EXPECT_EQ(test, __compiletime_strlen(ptr_of_11), 11);
31
> 32 KUNIT_EXPECT_EQ(test, __compiletime_strlen(array_unknown), SIZE_MAX);
33 /* Externally defined and dynamically sized string pointer: */
34 KUNIT_EXPECT_EQ(test, __compiletime_strlen(saved_command_line), SIZE_MAX);
35 }
36
--
0-DAY CI Kernel Test Service
https://01.org/lkp
View attachment "config" of type "text/plain" (152320 bytes)
Powered by blists - more mailing lists