kunit/fortify: Add memcpy() tests
authorKees Cook <keescook@chromium.org>
Mon, 29 Apr 2024 19:43:41 +0000 (12:43 -0700)
committerKees Cook <keescook@chromium.org>
Tue, 30 Apr 2024 17:34:30 +0000 (10:34 -0700)
commit26f812ba75890c48644a31e3cfe3dd9762138968
tree20dc3e07c3d14725fdc4f1e1f146e6d4978c08db
parent091f79e8de44736a1e677701d67334bba5b749e3
kunit/fortify: Add memcpy() tests

Add fortify tests for memcpy() and memmove(). This can use a similar
method to the fortify_panic() replacement, only we can do it for what
was the WARN_ONCE(), which can be redefined.

Since this is primarily testing the fortify behaviors of the memcpy()
and memmove() defenses, the tests for memcpy() and memmove() are
identical.

Link: https://lore.kernel.org/r/20240429194342.2421639-3-keescook@chromium.org
Signed-off-by: Kees Cook <keescook@chromium.org>
include/linux/fortify-string.h
lib/fortify_kunit.c