<feed xmlns='http://www.w3.org/2005/Atom'>
<title>lwn.git/tools/testing/selftests/bpf/prog_tests/string_kfuncs.c, branch master</title>
<subtitle>Linux kernel documentation tree maintained by Jonathan Corbet</subtitle>
<id>http://mirrors.hust.edu.cn/git/lwn.git/atom?h=master</id>
<link rel='self' href='http://mirrors.hust.edu.cn/git/lwn.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/'/>
<updated>2026-01-21T17:42:53+00:00</updated>
<entry>
<title>selftests/bpf: Test kfunc bpf_strncasecmp</title>
<updated>2026-01-21T17:42:53+00:00</updated>
<author>
<name>Yuzuki Ishiyama</name>
<email>ishiyama@hpc.is.uec.ac.jp</email>
</author>
<published>2026-01-21T03:33:28+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=f4924ad0b13fd4ca4f0c7117dc143bf372224aec'/>
<id>urn:sha1:f4924ad0b13fd4ca4f0c7117dc143bf372224aec</id>
<content type='text'>
Add testsuites for kfunc bpf_strncasecmp.

Signed-off-by: Yuzuki Ishiyama &lt;ishiyama@hpc.is.uec.ac.jp&gt;
Acked-by: Viktor Malik &lt;vmalik@redhat.com&gt;
Link: https://lore.kernel.org/r/20260121033328.1850010-3-ishiyama@hpc.is.uec.ac.jp
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests/bpf: Test bpf_strcasestr,bpf_strncasestr kfuncs</title>
<updated>2025-10-10T17:05:32+00:00</updated>
<author>
<name>Rong Tao</name>
<email>rongtao@cestc.cn</email>
</author>
<published>2025-10-09T01:23:32+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=eca0b643efc96f1b095ae9ff5d190a513590f838'/>
<id>urn:sha1:eca0b643efc96f1b095ae9ff5d190a513590f838</id>
<content type='text'>
Add tests for new kfuncs bpf_strcasestr() and bpf_strncasestr().

Signed-off-by: Rong Tao &lt;rongtao@cestc.cn&gt;
Link: https://lore.kernel.org/r/tencent_4F1A340A8966155C52AA9CBDB68FD221FE0A@qq.com
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests/bpf: Test kfunc bpf_strcasecmp</title>
<updated>2025-09-04T16:00:57+00:00</updated>
<author>
<name>Rong Tao</name>
<email>rongtao@cestc.cn</email>
</author>
<published>2025-09-02T23:48:36+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=abc8a952d4aa1cdb72e90df280d1fe6fc50ed631'/>
<id>urn:sha1:abc8a952d4aa1cdb72e90df280d1fe6fc50ed631</id>
<content type='text'>
Add testsuites for kfunc bpf_strcasecmp.

Signed-off-by: Rong Tao &lt;rongtao@cestc.cn&gt;
Link: https://lore.kernel.org/r/tencent_81A1A0ACC04B68158C57C4D151C46A832B07@qq.com
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
<entry>
<title>selftests/bpf: Add tests for string kfuncs</title>
<updated>2025-06-26T16:44:46+00:00</updated>
<author>
<name>Viktor Malik</name>
<email>vmalik@redhat.com</email>
</author>
<published>2025-06-26T06:08:31+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=e8763fb66a386843f091925dab757c4f55633d0b'/>
<id>urn:sha1:e8763fb66a386843f091925dab757c4f55633d0b</id>
<content type='text'>
Add both positive and negative tests cases using string kfuncs added in
the previous patches.

Positive tests check that the functions work as expected.

Negative tests pass various incorrect strings to the kfuncs and check
for the expected error codes:
  -E2BIG  when passing too long strings
  -EFAULT when trying to read inaccessible kernel memory
  -ERANGE when passing userspace pointers on arches with non-overlapping
          address spaces

A majority of the tests use the RUN_TESTS helper which executes BPF
programs with BPF_PROG_TEST_RUN and check for the expected return value.
An exception to this are tests for long strings as we need to memset the
long string from userspace (at least I haven't found an ergonomic way to
memset it from a BPF program), which cannot be done using the RUN_TESTS
infrastructure.

Suggested-by: Eduard Zingerman &lt;eddyz87@gmail.com&gt;
Signed-off-by: Viktor Malik &lt;vmalik@redhat.com&gt;
Link: https://lore.kernel.org/r/090451a2e60c9ae1dceb4d1bfafa3479db5c7481.1750917800.git.vmalik@redhat.com
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
</content>
</entry>
</feed>
