From: Rong Tao <rong...@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_cbd40091c14056e8298be3725b65ee156...@qq.com/
v3: Fix selftests/bpf error in v2, sorry about that;
    
https://lore.kernel.org/lkml/tencent_69bd268fba201219240b51661d5e96a8d...@qq.com/
v2: Follow Andrii Nakryiko's advise, fix the 'wrong fix';
    
https://lore.kernel.org/lkml/tencent_df4da83eebfb9246e5e3357bb40911cca...@qq.com/
v1: 
https://lore.kernel.org/lkml/tencent_65e5988ad52bec280d22964189505cd6e...@qq.com/
-- 
2.51.0


Reply via email to