* drivers/misc/lkdtm/bugs.c:492:31: warning: unsequenced accesses to volatile qualified 'element_count'
@ 2026-11-14 3:47 kernel test robot
2026-11-15 5:01 ` Nathan Chancellor
0 siblings, 1 reply; 2+ messages 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] 2+ messages in thread
* Re: drivers/misc/lkdtm/bugs.c:492:31: warning: unsequenced accesses to volatile qualified 'element_count'
2026-11-14 3:47 drivers/misc/lkdtm/bugs.c:492:31: warning: unsequenced accesses to volatile qualified 'element_count' kernel test robot
@ 2026-11-15 5:01 ` Nathan Chancellor
0 siblings, 0 replies; 2+ messages in thread
From: Nathan Chancellor @ 2026-11-15 5:01 UTC (permalink / raw)
To: kernel test robot; +Cc: Kees Cook, llvm, oe-kbuild-all, linux-kernel
On Sat, Nov 14, 2026 at 04:47:52AM +0100, kernel test robot wrote:
> 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.
https://lore.kernel.org/20261114-lkdtm-bugs-wunsequenced-v1-1-b24f15ce1328@kernel.org/
--
Cheers,
Nathan
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-15 5:01 UTC | newest]
Thread overview: 2+ messages (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
2026-11-15 5:01 ` Nathan Chancellor
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.