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:   Thu, 20 May 2021 13:19:11 -0700
From:   Song Liu <song@...nel.org>
To:     Simon Horman <simon.horman@...ronome.com>
Cc:     Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        Andrii Nakryiko <andrii@...nel.org>,
        Networking <netdev@...r.kernel.org>, bpf <bpf@...r.kernel.org>,
        oss-drivers@...ronome.com, Yinjun Zhang <yinjun.zhang@...igine.com>
Subject: Re: [PATCH bpf] bpf: offload: reorder offload callback 'prepare' in verifier

On Thu, May 20, 2021 at 2:01 AM Simon Horman <simon.horman@...ronome.com> wrote:
>
> From: Yinjun Zhang <yinjun.zhang@...igine.com>
>
> Commit 4976b718c355 ("bpf: Introduce pseudo_btf_id") switched the
> order of resolve_pseudo_ldimm(), in which some pseudo instructions
> are rewritten. Thus those rewritten instructions cannot be passed
> to driver via 'prepare' offload callback.
>
> Reorder the 'prepare' offload callback to fix it.
>
> Fixes: 4976b718c355 ("bpf: Introduce pseudo_btf_id")
> Signed-off-by: Yinjun Zhang <yinjun.zhang@...igine.com>
> Signed-off-by: Simon Horman <simon.horman@...ronome.com>

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

> ---
>  kernel/bpf/verifier.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
> index c58598ef4b5b..09849e43f035 100644
> --- a/kernel/bpf/verifier.c
> +++ b/kernel/bpf/verifier.c
> @@ -13368,12 +13368,6 @@ int bpf_check(struct bpf_prog **prog, union bpf_attr *attr,
>         if (is_priv)
>                 env->test_state_freq = attr->prog_flags & BPF_F_TEST_STATE_FREQ;
>
> -       if (bpf_prog_is_dev_bound(env->prog->aux)) {
> -               ret = bpf_prog_offload_verifier_prep(env->prog);
> -               if (ret)
> -                       goto skip_full_check;
> -       }
> -
>         env->explored_states = kvcalloc(state_htab_size(env),
>                                        sizeof(struct bpf_verifier_state_list *),
>                                        GFP_USER);
> @@ -13401,6 +13395,12 @@ int bpf_check(struct bpf_prog **prog, union bpf_attr *attr,
>         if (ret < 0)
>                 goto skip_full_check;
>
> +       if (bpf_prog_is_dev_bound(env->prog->aux)) {
> +               ret = bpf_prog_offload_verifier_prep(env->prog);
> +               if (ret)
> +                       goto skip_full_check;
> +       }
> +
>         ret = check_cfg(env);
>         if (ret < 0)
>                 goto skip_full_check;
> --
> 2.20.1
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ