linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [bpf-next v2 0/2] bpf/helpers: Fix bpf_strnstr len error
@ 2025-08-28  2:52 Rong Tao
  0 siblings, 0 replies; only message in thread
From: Rong Tao @ 2025-08-28  2:52 UTC (permalink / raw)
  To: andrii.nakryiko, ast, daniel
  Cc: rtoax, Rong Tao, Andrii Nakryiko, Martin KaFai Lau,
	Eduard Zingerman, Song Liu, Yonghong Song, John Fastabend,
	KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa, Mykola Lysenko,
	Shuah Khan, Viktor Malik,
	open list:BPF [GENERAL] (Safe Dynamic Programs and Tools),
	open list, open list:KERNEL SELFTEST FRAMEWORK

From: Rong Tao <rongtao@cestc.cn>

Fix bpf_strnstr() wrong 'len' parameter, bpf_strnstr("open", "open", 4)
should return 0 instead of -ENOENT.

Rong Tao (2):
  bpf/helpers: bpf_strnstr: Exact match length
  selftests/bpf: Add tests for bpf_strnstr

 kernel/bpf/helpers.c                                      | 4 +++-
 tools/testing/selftests/bpf/progs/string_kfuncs_success.c | 2 ++
 2 files changed, 5 insertions(+), 1 deletion(-)

---
v2: Follow Andrii Nakryiko's advise, fix the 'wrong fix';
v1: https://lore.kernel.org/lkml/tencent_65E5988AD52BEC280D22964189505CD6ED06@qq.com/
-- 
2.51.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-08-28  2:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-28  2:52 [bpf-next v2 0/2] bpf/helpers: Fix bpf_strnstr len error Rong Tao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).