Re: [PATCH bpf] selftests/bpf: Use -4095 as the bad address for bits iterator

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

 



On Tue, Nov 5, 2024 at 12:18 PM Ilya Leoshkevich <iii@xxxxxxxxxxxxx> wrote:
>
> On Tue, 2024-11-05 at 12:30 +0800, Hou Tao wrote:
> > From: Hou Tao <houtao1@xxxxxxxxxx>
> >
> > As reported by Byeonguk, the bad_words test in verifier_bits_iter.c
> > occasionally fails on s390 host. Quoting Ilya's explanation:
> >
> >   s390 kernel runs in a completely separate address space, there is
> > no
> >   user/kernel split at TASK_SIZE. The same address may be valid in
> > both
> >   the kernel and the user address spaces, there is no way to tell by
> >   looking at it. The config option related to this property is
> >   ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE.
> >
> >   Also, unfortunately, 0 is a valid address in the s390 kernel
> > address
> >   space.
> >
> > Fix the issue by using -4096 as the bad address for bits iterator, as
> > suggested by Ilya. Verify that bpf_iter_bits_new() returns -EINVAL
> > for
> > NULL address and -EFAULT for bad address.
>
> The code uses -4095, which I think is better, since it's the current
> value of MAX_ERRNO, therefore, IS_ERR_VALUE() sees it as an error. It's
> also not aligned, which may be an additional reason it may not be
> dereferenceable on some CPUs.
>
> Other than this discrepancy in the commit message:
>
> Acked-by: Ilya Leoshkevich <iii@xxxxxxxxxxxxx>

Fixed it up while applying.





[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