linux/mm/kmsan
Alexander Potapenko d340292553 kmsan: another take at fixing memcpy tests
commit 5478afc55a ("kmsan: fix memcpy tests") uses OPTIMIZER_HIDE_VAR()
to hide the uninitialized var from the compiler optimizations.

However OPTIMIZER_HIDE_VAR(uninit) enforces an immediate check of @uninit,
so memcpy tests did not actually check the behavior of memcpy(), because
they always contained a KMSAN report.

Replace OPTIMIZER_HIDE_VAR() with a file-local macro that just clobbers
the memory with a barrier(), and add a test case for memcpy() that does
not expect an error report.

Also reflow kmsan_test.c with clang-format.

Link: https://lkml.kernel.org/r/20230303141433.3422671-2-glider@google.com
Signed-off-by: Alexander Potapenko <glider@google.com>
Reviewed-by: Marco Elver <elver@google.com>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Helge Deller <deller@gmx.de>
Cc: Kees Cook <keescook@chromium.org>
Cc: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2023-03-28 16:20:11 -07:00
..
core.c lib/stacktrace, kasan, kmsan: rework extra_bits interface 2023-02-16 20:43:51 -08:00
hooks.c kmsan: export kmsan_handle_urb 2022-12-21 14:31:52 -08:00
init.c init: kmsan: call KMSAN initialization routines 2022-10-03 14:03:21 -07:00
instrumentation.c kmsan: silence -Wmissing-prototypes warnings 2023-02-02 22:33:05 -08:00
kmsan.h kmsan: core: kmsan_in_runtime() should return true in NMI context 2022-11-08 15:57:24 -08:00
kmsan_test.c kmsan: another take at fixing memcpy tests 2023-03-28 16:20:11 -07:00
Makefile kmsan: disable ftrace in kmsan core code 2023-02-20 12:46:16 -08:00
report.c
shadow.c mm: kmsan: export kmsan_copy_page_meta() 2022-10-28 13:37:22 -07:00