+35
−0
Loading
Add a KUnit test for strnlen() 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:Andy Shevchenko <andy@kernel.org> 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-3-jiangfeng@kylinos.cn Signed-off-by:
Paul Walmsley <pjw@kernel.org>