All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yonghong Song <yonghong.song@linux.dev>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: Kumar Kartikeya Dwivedi <memxor@gmail.com>,
	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>
Subject: Re: [PATCH bpf-next v3 1/2] bpf: Warn with bpf_unreachable() kfunc maybe due to uninitialized variable
Date: Tue, 20 May 2025 12:50:56 -0700	[thread overview]
Message-ID: <9a9d68fc-38c4-4c52-b62a-c0c4a522684d@linux.dev> (raw)
In-Reply-To: <CAADnVQL7mrgvPbDCnsFAG5vhzmkEfxP9Z9nxRHR15gdtBHDsBg@mail.gmail.com>



On 5/20/25 2:46 AM, Alexei Starovoitov wrote:
> On Tue, May 20, 2025 at 11:39 AM Alexei Starovoitov
> <alexei.starovoitov@gmail.com> wrote:
>> So another idea...
>>
>> maybe we should remove special_kfunc_set instead?
>>
>> I recall we argued with Kumar years ago about it.
>> I don't remember why we kept it
>> and what purpose it serves now.
>>
>> What will break if we do:
>>
>> -               if (meta.btf == btf_vmlinux &&
>> btf_id_set_contains(&special_kfunc_set, meta.func_id)) {
>> +               if (meta.btf == btf_vmlinux) {
>>                          if (meta.func_id ==
>> special_kfunc_list[KF_bpf_obj_new_impl] ||
>>                              meta.func_id ==
>> special_kfunc_list[KF_bpf_percpu_obj_new_impl]) {
>>                                  struct btf_struct_meta *struct_meta;
>> @@ -13838,10 +13838,6 @@ static int check_kfunc_call(struct
>> bpf_verifier_env *env, struct bpf_insn *insn,
>>                                   * because packet slices are not refcounted (see
>>                                   * dynptr_type_refcounted)
>>                                   */
>> -                       } else {
>> -                               verbose(env, "kernel function %s
>> unhandled dynamic return type\n",
>> -                                       meta.func_name);
>> -                               return -EFAULT;
>>                          }
>>
>> ?
> Found old Kumar's reply:
> https://lore.kernel.org/bpf/20221120204625.ndtr7ygh7zgjxrsz@apollo/
>
> and my old reply:
> https://lore.kernel.org/bpf/20221120222922.udsuzkr5hcvjzot5@macbook-pro-5.dhcp.thefacebook.com/
>
> I think we need to remove special_kfunc_set,
> and then special_kfunc_list[] can stay as-is,
> and we can keep adding new kfuncs to it like bpf_unreachable in this case.

Okay, I will remove special_kfunc_set() then. Thanks!


  reply	other threads:[~2025-05-20 19:51 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-19 20:33 [PATCH bpf-next v3 0/2] bpf: Warn with bpf_unreachable() kfunc maybe due to uninitialized variable Yonghong Song
2025-05-19 20:33 ` [PATCH bpf-next v3 1/2] " Yonghong Song
2025-05-19 22:48   ` Alexei Starovoitov
2025-05-20 15:25     ` Yonghong Song
2025-05-20 16:29       ` Alexei Starovoitov
2025-05-20 18:01         ` Yonghong Song
2025-05-20 18:39           ` Alexei Starovoitov
2025-05-20 18:46             ` Alexei Starovoitov
2025-05-20 19:50               ` Yonghong Song [this message]
2025-05-20 19:40             ` Yonghong Song
2025-05-20 20:59             ` Yonghong Song
2025-05-20 21:14               ` Alexei Starovoitov
2025-05-19 20:33 ` [PATCH bpf-next v3 2/2] selftests/bpf: Add unit tests with bpf_unreachable() kfunc Yonghong Song

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=9a9d68fc-38c4-4c52-b62a-c0c4a522684d@linux.dev \
    --to=yonghong.song@linux.dev \
    --cc=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=memxor@gmail.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.