All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexei Starovoitov <alexei.starovoitov@gmail.com>
To: Yonghong Song <yhs@fb.com>
Cc: bpf <bpf@vger.kernel.org>, Alexei Starovoitov <ast@kernel.org>,
	Andrii Nakryiko <andrii@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Kernel Team <kernel-team@fb.com>,
	Martin KaFai Lau <martin.lau@kernel.org>,
	David Vernet <void@manifault.com>
Subject: Re: [PATCH bpf-next v10 3/4] bpf: Add kfunc bpf_rcu_read_lock/unlock()
Date: Thu, 24 Nov 2022 12:56:34 -0800	[thread overview]
Message-ID: <CAADnVQKm0V8_M6bV9_cQuooNtfRpBW=-=T8Vi5+vmR2BW=BN5w@mail.gmail.com> (raw)
In-Reply-To: <CAADnVQKVm1W0JpSD4YbH+teMVg8EHtR-+DXM-eR--EDHXxYz9Q@mail.gmail.com>

On Thu, Nov 24, 2022 at 12:34 PM Alexei Starovoitov
<alexei.starovoitov@gmail.com> wrote:
>
> On Wed, Nov 23, 2022 at 9:32 PM Yonghong Song <yhs@fb.com> wrote:
> >
> > @@ -16580,6 +16682,8 @@ int bpf_check(struct bpf_prog **prog, union bpf_attr *attr, bpfptr_t uattr)
> >         env->bypass_spec_v1 = bpf_bypass_spec_v1();
> >         env->bypass_spec_v4 = bpf_bypass_spec_v4();
> >         env->bpf_capable = bpf_capable();
> > +       env->rcu_tag_supported =
> > +               btf_find_by_name_kind(btf_vmlinux, "rcu", BTF_KIND_TYPE_TAG) > 0;
>
> It needs btf_vmlinux != NULL check as well,
> since we error earlier only on IS_ERR(btf_vmlinux).
> btf_vmlinux can be NULL at this point when CONFIG_DEBUG_INFO_BTF is not set.
>
> In the previous discussion I thought we agreed to
> fix convert_ctx_accesses() vs incorrect application of
> BPF_PROBE_MEM for PTR_TRUSTED pointers.
> But I didn't find it in this patch.
> So I'm fixing both issues and planning to apply after testing.

Turned out the initial PTR_TRUSTED patch was buggy.
prog_type_args_trusted() is incorrect.
It marks fentry/fexit pointers as trusted and our own selftest
is crashing.
I'll send a separate fix.

So going to apply rcu set with just btf_vmlinux fix.

  reply	other threads:[~2022-11-24 20:56 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-24  5:32 [PATCH bpf-next v10 0/4] bpf: Add bpf_rcu_read_lock() support Yonghong Song
2022-11-24  5:32 ` [PATCH bpf-next v10 1/4] compiler_types: Define __rcu as __attribute__((btf_type_tag("rcu"))) Yonghong Song
2022-11-24  5:32 ` [PATCH bpf-next v10 2/4] bpf: Introduce might_sleep field in bpf_func_proto Yonghong Song
2022-11-24  5:32 ` [PATCH bpf-next v10 3/4] bpf: Add kfunc bpf_rcu_read_lock/unlock() Yonghong Song
2022-11-24 20:34   ` Alexei Starovoitov
2022-11-24 20:56     ` Alexei Starovoitov [this message]
2022-11-24 23:44     ` Yonghong Song
2022-11-25 17:53       ` Alexei Starovoitov
2022-11-24  5:32 ` [PATCH bpf-next v10 4/4] selftests/bpf: Add tests for bpf_rcu_read_lock() Yonghong Song
2022-11-24 21:10 ` [PATCH bpf-next v10 0/4] bpf: Add bpf_rcu_read_lock() support patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAADnVQKm0V8_M6bV9_cQuooNtfRpBW=-=T8Vi5+vmR2BW=BN5w@mail.gmail.com' \
    --to=alexei.starovoitov@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=kernel-team@fb.com \
    --cc=martin.lau@kernel.org \
    --cc=void@manifault.com \
    --cc=yhs@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.