All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: kasan: add KUnit tests for __counted_by and __counted_by_ptr
@ 2026-09-30 20:13 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-09-30 20:13 UTC (permalink / raw)
  Cc: oe-kbuild-all

Hi Bill,

kernel test robot noticed the following build warnings:



url:    https://github.com/intel-lab-lkp/linux/commits/Bill-Wendling/kasan-add-KUnit-tests-for-__counted_by-and-__counted_by_ptr/20260928-231737
base:   
patch link:    https://lore.kernel.org/r/202609302227.ZAhd0ZIv-lkp%40intel.com
config: x86_64-randconfig-2300-20260930 (https://download.01.org/0day-ci/archive/20260930/202609302227.ZAhd0ZIv-lkp@intel.com/config)
compiler: clang version 22.1.8 (https://github.com/llvm/llvm-project ca7933e47d3a3451d81e72ac174dcb5aa28b59d1)
sparse: v0.6.5-rc1
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260930/202609302227.ZAhd0ZIv-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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202609302227.ZAhd0ZIv-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
   mm/kasan/kasan_test_c.c:1598:27: sparse: sparse: Variable length array is used.
   mm/kasan/kasan_test_c.c:1613:27: sparse: sparse: Variable length array is used.
   mm/kasan/kasan_test_c.c:2237:9: sparse: sparse: undefined identifier '__builtin_dynamic_object_size'
   mm/kasan/kasan_test_c.c:2237:9: sparse: sparse: undefined identifier '__builtin_dynamic_object_size'
>> mm/kasan/kasan_test_c.c:2237:9: sparse: sparse: incompatible types for operation (==):
   mm/kasan/kasan_test_c.c:2237:9: sparse:    unsigned long const __left
   mm/kasan/kasan_test_c.c:2237:9: sparse:    bad type const __right
   mm/kasan/kasan_test_c.c:2284:9: sparse: sparse: undefined identifier '__builtin_dynamic_object_size'
   mm/kasan/kasan_test_c.c:2284:9: sparse: sparse: undefined identifier '__builtin_dynamic_object_size'
   mm/kasan/kasan_test_c.c:2284:9: sparse: sparse: incompatible types for operation (==):
   mm/kasan/kasan_test_c.c:2284:9: sparse:    unsigned long const __left
   mm/kasan/kasan_test_c.c:2284:9: sparse:    bad type const __right

vim +2237 mm/kasan/kasan_test_c.c

  2226	
  2227	static void counted_by_flex_oob_access(struct kunit *test)
  2228	{
  2229		size_t size = 128;
  2230		struct counted_by_flex_struct *s;
  2231	
  2232		s = alloc_counted_by_flex_struct(test, size);
  2233	
  2234		OPTIMIZER_HIDE_VAR(s);
  2235	
  2236		/* __builtin_dynamic_object_size() should return the correct length. */
> 2237		KUNIT_EXPECT_EQ(test, size * sizeof(s->array[0]),
  2238				__builtin_dynamic_object_size(s->array, 0));
  2239	
  2240		/* Out-of-bounds assignment. */
  2241		KUNIT_EXPECT_KASAN_FAIL(test, s->array[size + 1] = 42);
  2242	
  2243		/* Out-of-bounds read. */
  2244		KUNIT_EXPECT_KASAN_FAIL_READ(test, s->array[0] = s->array[size + 13]);
  2245	
  2246		kfree(s);
  2247	}
  2248	

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-09-30 20:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-30 20:13 kasan: add KUnit tests for __counted_by and __counted_by_ptr kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.