linux/mm/kasan
Jann Horn 475356fe28 kasan/test: fix protection against compiler elision
The kunit test is using assignments to
"static volatile void *kasan_ptr_result" to prevent elision of memory
loads, but that's not working:
In this variable definition, the "volatile" applies to the "void", not to
the pointer.
To make "volatile" apply to the pointer as intended, it must follow
after the "*".

This makes the kasan_memchr test pass again on my system.  The
kasan_strings test is still failing because all the definitions of
load_unaligned_zeropad() are lacking explicit instrumentation hooks and
ASAN does not instrument asm() memory operands.

Link: https://lkml.kernel.org/r/20250728-kasan-kunit-fix-volatile-v1-1-e7157c9af82d@google.com
Fixes: 5f1c8108e7 ("mm:kasan: fix sparse warnings: Should it be static?")
Signed-off-by: Jann Horn <jannh@google.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Andrey Konovalov <andreyknvl@gmail.com>
Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
Cc: Dmitriy Vyukov <dvyukov@google.com>
Cc: Jann Horn <jannh@google.com>
Cc: Nihar Chaithanya <niharchaithanya@gmail.com>
Cc: Vincenzo Frascino <vincenzo.frascino@arm.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2025-08-05 13:28:46 -07:00
..
common.c kasan: skip quarantine if object is still accessible under RCU 2025-08-02 12:06:08 -07:00
generic.c kasan: make kasan_record_aux_stack_noalloc() the default behaviour 2025-01-13 22:40:36 -08:00
hw_tags.c kasan: hw_tags: Use str_on_off() helper in kasan_init_hw_tags() 2025-01-25 20:22:44 -08:00
init.c mm: define general function pXd_init() 2024-11-11 17:22:27 -08:00
kasan.h kasan: use correct kernel-doc format 2025-01-25 20:22:41 -08:00
kasan_test_c.c kasan/test: fix protection against compiler elision 2025-08-05 13:28:46 -07:00
kasan_test_rust.rs rust: treewide: switch to the kernel Vec type 2024-10-15 23:10:32 +02:00
Makefile kbuild: Switch from -Wvla to -Wvla-larger-than=1 2025-05-08 09:42:06 -07:00
quarantine.c kasan: revert eviction of stack traces in generic mode 2024-02-23 17:27:12 -08:00
report.c kasan: use vmalloc_dump_obj() for vmalloc error reports 2025-07-19 19:26:17 -07:00
report_generic.c kasan: stop leaking stack trace handles 2024-01-05 10:17:45 -08:00
report_hw_tags.c
report_sw_tags.c
report_tags.c kasan: simplify kasan_complete_mode_report_info for tag-based modes 2023-12-29 11:58:47 -08:00
shadow.c kasan: avoid sleepable page allocation from atomic context 2025-05-20 22:49:40 -07:00
sw_tags.c kasan: sw_tags: use str_on_off() helper in kasan_init_sw_tags() 2025-01-25 20:22:46 -08:00
tags.c kasan: simplify saving extra info into tracks 2023-12-29 11:58:46 -08:00