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]
Message-ID: <CAPhsuW7qesH-NwNgeOM4A04BggD=AzJoQrQ-fB1gdG-3xAcxGQ@mail.gmail.com>
Date:   Wed, 29 Jul 2020 14:35:56 -0700
From:   Song Liu <song@...nel.org>
To:     John Fastabend <john.fastabend@...il.com>
Cc:     Martin KaFai Lau <kafai@...com>,
        Daniel Borkmann <daniel@...earbox.net>,
        Alexei Starovoitov <ast@...nel.org>,
        Networking <netdev@...r.kernel.org>, bpf <bpf@...r.kernel.org>
Subject: Re: [bpf PATCH v2 3/5] bpf, selftests: Add tests for ctx access in
 sock_ops with single register

On Wed, Jul 29, 2020 at 9:24 AM John Fastabend <john.fastabend@...il.com> wrote:
>
[...]

>
> Signed-off-by: John Fastabend <john.fastabend@...il.com>

Acked-by: Song Liu <songliubraving@...com>

> ---
>  .../testing/selftests/bpf/progs/test_tcpbpf_kern.c |   13 +++++++++++++
>  1 file changed, 13 insertions(+)
>
> diff --git a/tools/testing/selftests/bpf/progs/test_tcpbpf_kern.c b/tools/testing/selftests/bpf/progs/test_tcpbpf_kern.c
> index 1f1966e..f8b13682 100644
> --- a/tools/testing/selftests/bpf/progs/test_tcpbpf_kern.c
> +++ b/tools/testing/selftests/bpf/progs/test_tcpbpf_kern.c
> @@ -54,6 +54,7 @@ SEC("sockops")
>  int bpf_testcb(struct bpf_sock_ops *skops)
>  {
>         char header[sizeof(struct ipv6hdr) + sizeof(struct tcphdr)];
> +       struct bpf_sock_ops *reuse = skops;
>         struct tcphdr *thdr;
>         int good_call_rv = 0;
>         int bad_call_rv = 0;
> @@ -62,6 +63,18 @@ int bpf_testcb(struct bpf_sock_ops *skops)
>         int v = 0;
>         int op;
>
> +       /* Test reading fields in bpf_sock_ops using single register */
> +       asm volatile (
> +               "%[reuse] = *(u32 *)(%[reuse] +96)"
> +               : [reuse] "+r"(reuse)
> +               :);
> +
> +       asm volatile (
> +               "%[op] = *(u32 *)(%[skops] +96)"
> +               : [op] "+r"(op)
> +               : [skops] "r"(skops)
> +               :);
> +

Shall we add a separate test for this? It does seem to fix in bpf_testcb().

>         op = (int) skops->op;
>
>         update_event_map(op);
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ