All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
Cc: oe-kbuild-all@lists.linux.dev
Subject: Re: kasan: add KUnit tests for __counted_by and __counted_by_ptr
Date: Wed, 30 Sep 2026 22:13:11 +0200	[thread overview]
Message-ID: <202609302227.ZAhd0ZIv-lkp@intel.com> (raw)
In-Reply-To: <202609302227.ZAhd0ZIv-lkp@intel.com>

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

           reply	other threads:[~2026-09-30 20:13 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <202609302227.ZAhd0ZIv-lkp@intel.com>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202609302227.ZAhd0ZIv-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.