]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-client.git/commit
lib/string_kunit: add correctness test for strrchr()
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)
commit27b2810a4a3dcd1545ec8bafc82f967eda591c47
treee611926f9f1d0eda828bf65be70ac0c8b0e9cdce
parent263dca234e5cc12aa8b434592ceb655538bf4ea4
lib/string_kunit: add correctness test for strrchr()

Add a KUnit test for strrchr() 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-4-jiangfeng@kylinos.cn
Signed-off-by: Paul Walmsley <pjw@kernel.org>
lib/tests/string_kunit.c