linux/drivers/misc/lkdtm
Catalin Marinas f4ea8e05f2 lkdtm/bugs: Do not confuse the clang/objtool with busy wait loop
Since commit eb972eab07 ("lkdtm/bugs: Add cases for BUG and PANIC
occurring in hardirq context"), building with clang for x86_64 results
in the following warnings:

vmlinux.o: warning: objtool: lkdtm_PANIC_IN_HARDIRQ(): unexpected end of section .text.lkdtm_PANIC_IN_HARDIRQ
vmlinux.o: warning: objtool: lkdtm_BUG_IN_HARDIRQ(): unexpected end of section .text.lkdtm_BUG_IN_HARDIRQ

caused by busy "while (wait_for_...);" loops. Add READ_ONCE() and
cpu_relax() to better indicate the intention and avoid any unwanted
compiler optimisations.

Fixes: eb972eab07 ("lkdtm/bugs: Add cases for BUG and PANIC occurring in hardirq context")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202512190111.jxFSqxUH-lkp@intel.com/
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2025-12-19 15:09:09 +00:00
..
bugs.c lkdtm/bugs: Do not confuse the clang/objtool with busy wait loop 2025-12-19 15:09:09 +00:00
cfi.c kcfi: Rename CONFIG_CFI_CLANG to CONFIG_CFI 2025-09-24 14:29:14 -07:00
core.c lkdtm: Make lkdtm_do_action() return to avoid tail call optimization 2024-02-01 09:44:07 -08:00
fortify.c lkdtm: fortify: Fix potential NULL dereference on kmalloc failure 2025-09-08 20:15:36 -07:00
heap.c lkdtm: use SLAB_NO_MERGE instead of an empty constructor 2025-04-28 10:32:43 -07:00
kstack_erase.c stackleak: Rename STACKLEAK to KSTACK_ERASE 2025-07-21 21:35:01 -07:00
lkdtm.h lkdtm: Move crashtype definitions into each category 2022-04-12 16:16:48 -07:00
Makefile stackleak: Rename STACKLEAK to KSTACK_ERASE 2025-07-21 21:35:01 -07:00
perms.c objtool: Validate kCFI calls 2025-08-18 14:23:09 +02:00
powerpc.c lkdtm: Move crashtype definitions into each category 2022-04-12 16:16:48 -07:00
refcount.c refcount: Report UAF for refcount_sub_and_test(0) when counter==0 2024-08-05 14:34:23 -07:00
rodata.c lkdtm: don't move ctors to .rodata 2020-12-09 15:51:14 +01:00
usercopy.c treewide: Drop function_nocfi 2022-09-26 10:13:14 -07:00