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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 29 Jul 2021 23:30:42 +0200
From:   Johan Almbladh <johan.almbladh@...finetworks.com>
To:     Yonghong Song <yhs@...com>
Cc:     Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        Andrii Nakryiko <andrii@...nel.org>,
        Martin KaFai Lau <kafai@...com>,
        Song Liu <songliubraving@...com>,
        John Fastabend <john.fastabend@...il.com>,
        KP Singh <kpsingh@...nel.org>,
        Tony Ambardar <Tony.Ambardar@...il.com>,
        Networking <netdev@...r.kernel.org>, bpf <bpf@...r.kernel.org>
Subject: Re: [PATCH 01/14] bpf/tests: Add BPF_JMP32 test cases

On Thu, Jul 29, 2021 at 12:31 AM Yonghong Song <yhs@...com> wrote:
> > +     /* BPF_JMP32 | BPF_JGT | BPF_X */
> > +     {
> > +             "JMP32_JGT_X",
> > +             .u.insns_int = {
> > +                     BPF_ALU32_IMM(BPF_MOV, R0, 0xfffffffe),
> > +                     BPF_ALU32_IMM(BPF_MOV, R1, 0xffffffff),
> > +                     BPF_JMP32_REG(BPF_JGT, R0, R1, 1),
>
> Maybe change the offset from 1 to 2? Otherwise, this may jump to
>    BPF_JMP32_REG(BPF_JGT, R0, R1, 1)
> which will just do the same comparison and jump to BTT_EXIT_INSN()
> which will also have R0 = 0xfffffffe at the end.

You are right. All BPF_X versions should have the first jump offset
incremented by one to account for the extra MOV that is not present in
the BPF_K version of the test. I'll correct it.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ