Searched refs:bpf_strnstr (Results 1 – 4 of 4) sorted by relevance
| /linux/tools/testing/selftests/bpf/progs/ |
| H A D | string_kfuncs_success.c | 48 __test(0) int test_strnstr_found1(void *ctx) { return bpf_strnstr("", "", 0); } 49 __test(0) int test_strnstr_found2(void *ctx) { return bpf_strnstr(str, "hello", 5); } 50 __test(0) int test_strnstr_found3(void *ctx) { return bpf_strnstr(str, "hello", 6); } 51 __test(-ENOENT) int test_strnstr_notfound1(void *ctx) { return bpf_strnstr(str, "hi", 10); } 52 __test(-ENOENT) int test_strnstr_notfound2(void *ctx) { return bpf_strnstr(str, "hello", 4); } 53 __test(-ENOENT) int test_strnstr_notfound3(void *ctx) { return bpf_strnstr("", "a", 0); } 54 __test(0) int test_strnstr_empty(void *ctx) { return bpf_strnstr(str, "", 1); }
|
| H A D | string_kfuncs_failure1.c | 52 SEC("syscall") __retval(USER_PTR_ERR)int test_strnstr_null1(void *ctx) { return bpf_strnstr(NULL, "hello", 1); } in __retval() 53 SEC("syscall") __retval(USER_PTR_ERR)int test_strnstr_null2(void *ctx) { return bpf_strnstr("hello", NULL, 1); } in __retval() 78 SEC("syscall") __retval(USER_PTR_ERR) int test_strnstr_user_ptr1(void *ctx) { return bpf_strnstr(user_ptr, "hello", 1); } in test_strspn_pagefault1() 79 SEC("syscall") __retval(USER_PTR_ERR) int test_strnstr_user_ptr2(void *ctx) { return bpf_strnstr("hello", user_ptr, 1); } in test_strspn_pagefault2() 106 SEC("syscall") __retval(-EFAULT) int test_strnstr_pagefault1(void *ctx) { return bpf_strnstr(invalid_kern_ptr, "hello", 1); } 107 SEC("syscall") __retval(-EFAULT) int test_strnstr_pagefault2(void *ctx) { return bpf_strnstr("hello", invalid_kern_ptr, 1); }
|
| H A D | string_kfuncs_failure2.c | 24 SEC("syscall") int test_strnstr_too_long(void *ctx) { return bpf_strnstr(long_str, "hello", sizeof(long_str)); }
|
| /linux/kernel/bpf/ |
| H A D | helpers.c | 4072 __bpf_kfunc int bpf_strnstr(const char *s1__ign, const char *s2__ign, in bpf_strnstr() function 4855 BTF_ID_FLAGS(func, bpf_strnstr);
|