Re: s390 test_bpf: #284 BPF_MAXINSNS: Maximum possible literals failure

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

 



On Tue, 2020-08-04 at 20:40 +0300, Yauheni Kaliuta wrote:
> Hi!
> 
> I have a failure (crash) of selftests/bpf/test_kmod.sh on s390.
> 
> The problem comes with loading with
> 
> sysctl -w net.core.bpf_jit_harden=2
> 
> In that case the program (lib/test_bpf.c):
> 
> static int bpf_fill_maxinsns1(struct bpf_test *self)
> {
>     unsigned int len = BPF_MAXINSNS;
>     struct sock_filter *insn;
>     __u32 k = ~0;
>     int i;
> 
>     insn = kmalloc_array(len, sizeof(*insn), GFP_KERNEL);
>     if (!insn)
>         return -ENOMEM;
> 
>     for (i = 0; i < len; i++, k--)
>         insn[i] = __BPF_STMT(BPF_RET | BPF_K, k);
> 
>     self->u.ptr.insns = insn;
>     self->u.ptr.len = len;
> 
>     return 0;
> }
> 
> after blinding and jiting is 98362 bytes for me and it does not fit
> 16bit offset for BRC 15,.. command where BPF_EXIT | BPF_JMP is
> translated.
> 
> What is the easiest way to use BRCL for large offset here?
> 
> Thanks!

Hi Yauheni!

Did you try bpf-next, specifically with commit 5fa6974471c5 ("s390/bpf:
Use brcl for jumping to exit_ip if necessary")? This was supposed to
fix this problem.

Best regards,
Ilya




[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