]> git.ipfire.org Git - thirdparty/linux.git/commit
lib/string_kunit: add correctness test for strlen()
authorFeng Jiang <jiangfeng@kylinos.cn>
Sat, 4 Apr 2026 01:28:47 +0000 (19:28 -0600)
committerPaul Walmsley <pjw@kernel.org>
Sun, 5 Apr 2026 00:42:44 +0000 (18:42 -0600)
commitae45f896a40a07449d9b45d0395fb7245fdd75fc
tree87bdbd2000e54e683ac519e805f88480dc7b6623
parentd7df0505478a3e479e914f0554b6b774a07a1b88
lib/string_kunit: add correctness test for strlen()

Add a KUnit test for strlen() to verify correctness across
different string lengths and memory alignments. Use vmalloc()
to place the NUL character at the page boundary to ensure
over-reads are detected.

Suggested-by: Kees Cook <kees@kernel.org>
Signed-off-by: Feng Jiang <jiangfeng@kylinos.cn>
Reviewed-by: Kees Cook <kees@kernel.org>
Link: https://patch.msgid.link/20260130025018.172925-2-jiangfeng@kylinos.cn
Signed-off-by: Paul Walmsley <pjw@kernel.org>
lib/tests/string_kunit.c