@@ -45,8 +45,12 @@ SEC("syscall") __retval(USER_PTR_ERR)int test_strcspn_null1(void *ctx) { return
4545SEC ("syscall" ) __retval (USER_PTR_ERR )int test_strcspn_null2 (void * ctx ) { return bpf_strcspn ("hello" , NULL ); }
4646SEC ("syscall" ) __retval (USER_PTR_ERR )int test_strstr_null1 (void * ctx ) { return bpf_strstr (NULL , "hello" ); }
4747SEC ("syscall" ) __retval (USER_PTR_ERR )int test_strstr_null2 (void * ctx ) { return bpf_strstr ("hello" , NULL ); }
48+ SEC ("syscall" ) __retval (USER_PTR_ERR )int test_strcasestr_null1 (void * ctx ) { return bpf_strcasestr (NULL , "hello" ); }
49+ SEC ("syscall" ) __retval (USER_PTR_ERR )int test_strcasestr_null2 (void * ctx ) { return bpf_strcasestr ("hello" , NULL ); }
4850SEC ("syscall" ) __retval (USER_PTR_ERR )int test_strnstr_null1 (void * ctx ) { return bpf_strnstr (NULL , "hello" , 1 ); }
4951SEC ("syscall" ) __retval (USER_PTR_ERR )int test_strnstr_null2 (void * ctx ) { return bpf_strnstr ("hello" , NULL , 1 ); }
52+ SEC ("syscall" ) __retval (USER_PTR_ERR )int test_strncasestr_null1 (void * ctx ) { return bpf_strncasestr (NULL , "hello" , 1 ); }
53+ SEC ("syscall" ) __retval (USER_PTR_ERR )int test_strncasestr_null2 (void * ctx ) { return bpf_strncasestr ("hello" , NULL , 1 ); }
5054
5155/* Passing userspace ptr to string kfuncs */
5256SEC ("syscall" ) __retval (USER_PTR_ERR ) int test_strcmp_user_ptr1 (void * ctx ) { return bpf_strcmp (user_ptr , "hello" ); }
@@ -65,8 +69,12 @@ SEC("syscall") __retval(USER_PTR_ERR) int test_strcspn_user_ptr1(void *ctx) { re
6569SEC ("syscall" ) __retval (USER_PTR_ERR ) int test_strcspn_user_ptr2 (void * ctx ) { return bpf_strcspn ("hello" , user_ptr ); }
6670SEC ("syscall" ) __retval (USER_PTR_ERR ) int test_strstr_user_ptr1 (void * ctx ) { return bpf_strstr (user_ptr , "hello" ); }
6771SEC ("syscall" ) __retval (USER_PTR_ERR ) int test_strstr_user_ptr2 (void * ctx ) { return bpf_strstr ("hello" , user_ptr ); }
72+ SEC ("syscall" ) __retval (USER_PTR_ERR ) int test_strcasestr_user_ptr1 (void * ctx ) { return bpf_strcasestr (user_ptr , "hello" ); }
73+ SEC ("syscall" ) __retval (USER_PTR_ERR ) int test_strcasestr_user_ptr2 (void * ctx ) { return bpf_strcasestr ("hello" , user_ptr ); }
6874SEC ("syscall" ) __retval (USER_PTR_ERR ) int test_strnstr_user_ptr1 (void * ctx ) { return bpf_strnstr (user_ptr , "hello" , 1 ); }
6975SEC ("syscall" ) __retval (USER_PTR_ERR ) int test_strnstr_user_ptr2 (void * ctx ) { return bpf_strnstr ("hello" , user_ptr , 1 ); }
76+ SEC ("syscall" ) __retval (USER_PTR_ERR ) int test_strncasestr_user_ptr1 (void * ctx ) { return bpf_strncasestr (user_ptr , "hello" , 1 ); }
77+ SEC ("syscall" ) __retval (USER_PTR_ERR ) int test_strncasestr_user_ptr2 (void * ctx ) { return bpf_strncasestr ("hello" , user_ptr , 1 ); }
7078
7179#endif /* __TARGET_ARCH_s390 */
7280
@@ -87,7 +95,11 @@ SEC("syscall") __retval(-EFAULT) int test_strcspn_pagefault1(void *ctx) { return
8795SEC ("syscall" ) __retval (- EFAULT ) int test_strcspn_pagefault2 (void * ctx ) { return bpf_strcspn ("hello" , invalid_kern_ptr ); }
8896SEC ("syscall" ) __retval (- EFAULT ) int test_strstr_pagefault1 (void * ctx ) { return bpf_strstr (invalid_kern_ptr , "hello" ); }
8997SEC ("syscall" ) __retval (- EFAULT ) int test_strstr_pagefault2 (void * ctx ) { return bpf_strstr ("hello" , invalid_kern_ptr ); }
98+ SEC ("syscall" ) __retval (- EFAULT ) int test_strcasestr_pagefault1 (void * ctx ) { return bpf_strcasestr (invalid_kern_ptr , "hello" ); }
99+ SEC ("syscall" ) __retval (- EFAULT ) int test_strcasestr_pagefault2 (void * ctx ) { return bpf_strcasestr ("hello" , invalid_kern_ptr ); }
90100SEC ("syscall" ) __retval (- EFAULT ) int test_strnstr_pagefault1 (void * ctx ) { return bpf_strnstr (invalid_kern_ptr , "hello" , 1 ); }
91101SEC ("syscall" ) __retval (- EFAULT ) int test_strnstr_pagefault2 (void * ctx ) { return bpf_strnstr ("hello" , invalid_kern_ptr , 1 ); }
102+ SEC ("syscall" ) __retval (- EFAULT ) int test_strncasestr_pagefault1 (void * ctx ) { return bpf_strncasestr (invalid_kern_ptr , "hello" , 1 ); }
103+ SEC ("syscall" ) __retval (- EFAULT ) int test_strncasestr_pagefault2 (void * ctx ) { return bpf_strncasestr ("hello" , invalid_kern_ptr , 1 ); }
92104
93105char _license [] SEC ("license" ) = "GPL" ;
0 commit comments