Re: [PATCH 2/2] kunit: string: add strnlen SIZE_MAX test coverage
<[email protected]> Thu, 23 Jul 2026 17:37:53 +0800 (CST)
| Newsgroups | org.kernel.vger.linux-hardening,org.infradead.lists.linux-riscv,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
>> Extend string_test_strnlen to validate strnlen behavior with >> SIZE_MAX input: >> ... >> + /* Test Count overflow fallback */ >> + KUNIT_EXPECT_EQ(test, strnlen(s, SSIZE_MAX), len); On 2026/7/22 15:10, Feng Jiang wrote: > A similar patch has already been submitted: > https://lore.kernel.org/all/[email protected]/Thanks for the pointer. I checked the patch, but it does not actually cover the **Count overflow** case. so my patch adds an explicit case for `strnlen(s, SIZE_MAX)`. -- Best regards, Gao Rui