diff options
author | Alexander Potapenko <glider@google.com> | 2023-03-03 17:14:31 +0300 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2023-03-29 02:20:11 +0300 |
commit | d340292553ab48d32d3e768bbb1d11fb942fe02e (patch) | |
tree | 08e9bdb7d3ac0c7554d062808ccf1ffe84cf4774 /mm/mm_slot.h | |
parent | 6dc4bd4e2fe395f8c9d5d0892e45ff7fed5c66f3 (diff) | |
download | linux-d340292553ab48d32d3e768bbb1d11fb942fe02e.tar.xz |
kmsan: another take at fixing memcpy tests
commit 5478afc55a21 ("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>
Diffstat (limited to 'mm/mm_slot.h')
0 files changed, 0 insertions, 0 deletions