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:   Mon, 29 Jun 2020 20:06:53 -0700
From:   Alexei Starovoitov <alexei.starovoitov@...il.com>
To:     Andrii Nakryiko <andrii.nakryiko@...il.com>
Cc:     "David S. Miller" <davem@...emloft.net>,
        Daniel Borkmann <daniel@...earbox.net>,
        "Paul E . McKenney" <paulmck@...nel.org>,
        Networking <netdev@...r.kernel.org>, bpf <bpf@...r.kernel.org>,
        Kernel Team <kernel-team@...com>
Subject: Re: [PATCH v4 bpf-next 5/5] selftests/bpf: Add sleepable tests

On Mon, Jun 29, 2020 at 06:25:38PM -0700, Andrii Nakryiko wrote:
> 
> > +
> > +SEC("fentry.s/__x64_sys_setdomainname")
> > +int BPF_PROG(test_sys_setdomainname, struct pt_regs *regs)
> > +{
> > +       int buf = 0;
> > +       long ret;
> > +
> > +       ret = bpf_copy_from_user(&buf, sizeof(buf), (void *)regs->di);
> > +       if (regs->si == -2 && ret == 0 && buf == 1234)
> > +               copy_test++;
> > +       if (regs->si == -3 && ret == -EFAULT)
> > +               copy_test++;
> > +       if (regs->si == -4 && ret == -EFAULT)
> > +               copy_test++;
> 
> regs->si and regs->di won't compile on non-x86 arches, better to use
> PT_REGS_PARM1() and PT_REGS_PARM2() from bpf_tracing.h.

the test is x86 only due to:
+SEC("fentry.s/__x64_sys_setdomainname")

I guess we can move samples/bpf/trace_common.h into libbpf as well
to clean the whole thing up. Something for later patches.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ