Re: [PATCH bpf-next v6 4/4] selftests/bpf: Add tests for string kfuncs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 6/20/25 20:06, Alexei Starovoitov wrote:
> On Fri, Jun 20, 2025 at 5:33 AM Viktor Malik <vmalik@xxxxxxxxxx> wrote:
>>
>>> +SEC("syscall") __retval(USER_PTR_ERR) int test_strnstr_user_ptr2(void *ctx) { return bpf_strnstr("hello", user_ptr, 1); }
>>
>> For some reason, these tests are failing on s390x. I'll investigate.
> 
> I suspect this is the reason for failures:
> 
> +char *user_ptr = (char *)1;
> +char *invalid_kern_ptr = (char *)-1;

Actually, the kernel address works fine, it's the userspace addresses
causing the problem (user_ptr and NULL). On s390, __get_kernel_nofault
always returns 0 for these addresses instead of going to the exception
table.

> Ilya,
> 
> Please suggest user/kern addresses to use for these tests.

FWIW, I've also tried a couple other random userspace addresses, for all
of them __get_kernel_nofault returned 0.

In string kfuncs, 0 is treated as the end of the string (not an error),
so, unless some s390 expert has a better solution, the best I can think
of here is to disable the userspace addresses tests on s390.

Viktor





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux