]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
kmsan: introduce test_unpoison_memory()
authorBrian Johannesmeyer <bjohannesmeyer@gmail.com>
Tue, 28 May 2024 10:48:07 +0000 (12:48 +0200)
committerAndrew Morton <akpm@linux-foundation.org>
Thu, 4 Jul 2024 02:30:02 +0000 (19:30 -0700)
commit7005e7ec28855f3aa8355c39a7786d859ec92888
treef4adf2173d247a1205296031c978c8d047408e03
parentf56810c94ca828ab5c223a3528cc44c823cace16
kmsan: introduce test_unpoison_memory()

Add a regression test to ensure that kmsan_unpoison_memory() works the
same as an unpoisoning operation added by the instrumentation.

The test has two subtests: one that checks the instrumentation, and one
that checks kmsan_unpoison_memory().  Each subtest initializes the first
byte of a 4-byte buffer, then checks that the other 3 bytes are
uninitialized.

[glider@google.com: change description, remove comment about failing test case]
Link: https://lkml.kernel.org/r/20240528104807.738758-2-glider@google.com
Signed-off-by: Brian Johannesmeyer <bjohannesmeyer@gmail.com>
Link: https://lore.kernel.org/lkml/20240524232804.1984355-1-bjohannesmeyer@gmail.com/T/
Signed-off-by: Alexander Potapenko <glider@google.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Marco Elver <elver@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/kmsan/kmsan_test.c