From: Rong Tao <rtoax@foxmail.com>
To: vmalik@redhat.com, andrii.nakryiko@gmail.com, ast@kernel.org,
daniel@iogearbox.net
Cc: Rong Tao <rongtao@cestc.cn>, Andrii Nakryiko <andrii@kernel.org>,
Martin KaFai Lau <martin.lau@linux.dev>,
Eduard Zingerman <eddyz87@gmail.com>, Song Liu <song@kernel.org>,
Yonghong Song <yonghong.song@linux.dev>,
John Fastabend <john.fastabend@gmail.com>,
KP Singh <kpsingh@kernel.org>,
Stanislav Fomichev <sdf@fomichev.me>, Hao Luo <haoluo@google.com>,
Jiri Olsa <jolsa@kernel.org>, Mykola Lysenko <mykolal@fb.com>,
Shuah Khan <shuah@kernel.org>,
bpf@vger.kernel.org (open list:BPF [GENERAL] (Safe Dynamic
Programs and Tools)), linux-kernel@vger.kernel.org (open list),
linux-kselftest@vger.kernel.org (open list:KERNEL SELFTEST
FRAMEWORK)
Subject: [PATCH bpf-next v5 0/2] Fix bpf_strnstr len error
Date: Sat, 30 Aug 2025 00:30:16 +0800 [thread overview]
Message-ID: <tencent_E72A37AF03A3B18853066E421B5969976208@qq.com> (raw)
From: Rong Tao <rongtao@cestc.cn>
Fix bpf_strnstr() wrong 'len' parameter, bpf_strnstr("open", "open", 4)
should return 0 instead of -ENOENT. And fix a more general case when s2
is a suffix of the first len characters of s1.
Rong Tao (2):
bpf/helpers: bpf_strnstr: Exact match length
selftests/bpf: Add tests for bpf_strnstr
kernel/bpf/helpers.c | 9 ++++++++-
.../testing/selftests/bpf/progs/string_kfuncs_success.c | 8 ++++++--
2 files changed, 14 insertions(+), 3 deletions(-)
---
v5: Add more commit message and change the patch 0001's comment;
v4: Add comment and more selftests;
https://lore.kernel.org/all/tencent_CBD40091C14056E8298BE3725B65EE156405@qq.com/
v3: Fix selftests/bpf error in v2, sorry about that;
https://lore.kernel.org/lkml/tencent_69BD268FBA201219240B51661D5E96A8D80A@qq.com/
v2: Follow Andrii Nakryiko's advise, fix the 'wrong fix';
https://lore.kernel.org/lkml/tencent_DF4DA83EEBFB9246E5E3357BB40911CCA005@qq.com/
v1: https://lore.kernel.org/lkml/tencent_65E5988AD52BEC280D22964189505CD6ED06@qq.com/
--
2.51.0
next reply other threads:[~2025-08-29 16:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-29 16:30 Rong Tao [this message]
2025-08-29 19:00 ` patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tencent_E72A37AF03A3B18853066E421B5969976208@qq.com \
--to=rtoax@foxmail.com \
--cc=andrii.nakryiko@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=haoluo@google.com \
--cc=john.fastabend@gmail.com \
--cc=jolsa@kernel.org \
--cc=kpsingh@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=martin.lau@linux.dev \
--cc=mykolal@fb.com \
--cc=rongtao@cestc.cn \
--cc=sdf@fomichev.me \
--cc=shuah@kernel.org \
--cc=song@kernel.org \
--cc=vmalik@redhat.com \
--cc=yonghong.song@linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®