s390 test_bpf: #284 BPF_MAXINSNS: Maximum possible literals failure

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

 



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!

-- 
WBR, Yauheni




[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