lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 22 Sep 2021 11:36:08 +0530
From:   Kumar Kartikeya Dwivedi <memxor@...il.com>
To:     Andrii Nakryiko <andrii.nakryiko@...il.com>
Cc:     bpf <bpf@...r.kernel.org>, Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        Andrii Nakryiko <andrii@...nel.org>,
        Martin KaFai Lau <kafai@...com>,
        Song Liu <songliubraving@...com>, Yonghong Song <yhs@...com>,
        Jesper Dangaard Brouer <brouer@...hat.com>,
        Toke Høiland-Jørgensen <toke@...hat.com>,
        Networking <netdev@...r.kernel.org>
Subject: Re: [PATCH bpf-next v4 11/11] bpf: selftests: Add selftests for
 module kfunc support

On Wed, Sep 22, 2021 at 05:33:26AM IST, Andrii Nakryiko wrote:
> > [...]
> > Hmm, good idea, I'd just need to fill in the BTF id dynamically at runtime,
> > but that should be possible.
> >
> > Though we still need to craft distinct calls (I am trying to test the limit
> > where insn->off is different for each case). Since we try to reuse index in both
> > gen_loader and libbpf, just generating same call 256 times would not be enough.
>
> You just need to generate one instruction with offset = 257 to test
> this. And separately one call with fd_array that has module BTF fd at
> fd_array[256] (to check that 256 is ok). Or am I missing something?
>

That won't be enough, if I just pass insn->imm = id, insn->off = 257, it becomes
first descriptor in kfunc_tab and kfunc_btf_tab. The total limit is 256, and
they are kept in sorted order by based on id and off for the first, off for the
second. So 256 different offs are needed (imm may be same actually), so that
both fill up.

--
Kartikeya

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ