mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* drivers/misc/lkdtm/bugs.c:492:31: warning: unsequenced accesses to volatile qualified 'element_count'
@ 2026-11-14  3:47 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-11-14  3:47 UTC (permalink / raw)
  To: Kees Cook; +Cc: llvm, oe-kbuild-all, linux-kernel

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   97d73c8251226cf27cc6656b4c542869bb8c69fa
commit: a120a832e3ebca48474d7183ddeadf4138472535 lkdtm/bugs: Add __counted_by_ptr() test PTR_BOUNDS
date:   10 months ago
config: mips-randconfig-2000-20261114 (https://download.01.org/0day-ci/archive/20261114/202611140405.wMowxoPE-lkp@intel.com/config)
compiler: clang version 24.0.0git (https://github.com/llvm/llvm-project 8621950157210c1fa68f20f0614cb51310ec9dff)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261114/202611140405.wMowxoPE-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
| Fixes: a120a832e3eb ("lkdtm/bugs: Add __counted_by_ptr() test PTR_BOUNDS")
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202611140405.wMowxoPE-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/misc/lkdtm/bugs.c:492:31: warning: unsequenced accesses to volatile qualified 'element_count' [-Wunsequenced]
     492 |         inst->array[element_count] = element_count;
         |                     ~~~~~~~~~~~~~    ^
   1 warning generated.


vim +/element_count +492 drivers/misc/lkdtm/bugs.c

   475	
   476	static void lkdtm_FAM_BOUNDS(void)
   477	{
   478		struct lkdtm_cb_fam *inst;
   479	
   480		inst = kzalloc(struct_size(inst, array, element_count + 1), GFP_KERNEL);
   481		if (!inst) {
   482			pr_err("FAIL: could not allocate test struct!\n");
   483			return;
   484		}
   485	
   486		inst->count = element_count;
   487		pr_info("Array access within bounds ...\n");
   488		inst->array[1] = element_count;
   489		ignored = inst->array[1];
   490	
   491		pr_info("Array access beyond bounds ...\n");
 > 492		inst->array[element_count] = element_count;
   493		ignored = inst->array[element_count];
   494	
   495		kfree(inst);
   496	
   497		pr_err("FAIL: survived access of invalid flexible array member index!\n");
   498	
   499		if (!IS_ENABLED(CONFIG_CC_HAS_COUNTED_BY))
   500			pr_warn("This is expected since this %s was built with a compiler that does not support __counted_by\n",
   501				lkdtm_kernel_info);
   502		else if (IS_ENABLED(CONFIG_UBSAN_BOUNDS))
   503			pr_expected_config(CONFIG_UBSAN_TRAP);
   504		else
   505			pr_expected_config(CONFIG_UBSAN_BOUNDS);
   506	}
   507	

-- 
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-11-14  3:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-14  3:47 drivers/misc/lkdtm/bugs.c:492:31: warning: unsequenced accesses to volatile qualified 'element_count' kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®