All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leon Hwang <hffilwlqm@gmail.com>
To: Kumar Kartikeya Dwivedi <memxor@gmail.com>, bpf@vger.kernel.org
Cc: Alexei Starovoitov <ast@kernel.org>,
	Andrii Nakryiko <andrii@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Martin KaFai Lau <martin.lau@kernel.org>,
	Eduard Zingerman <eddyz87@gmail.com>,
	Ihor Solodrai <ihor.solodrai@linux.dev>,
	kkd@meta.com, kernel-team@meta.com
Subject: Re: [PATCH bpf-next v2 0/6] Add support to emit verifier warnings
Date: Wed, 8 Apr 2026 22:55:59 +0800	[thread overview]
Message-ID: <1a7aea41-cc64-4277-a08d-1cee1ad6024b@gmail.com> (raw)
In-Reply-To: <20260408021359.3786905-1-memxor@gmail.com>



On 2026/4/8 10:13, Kumar Kartikeya Dwivedi wrote:
> Currently, there are only two ways of communicating information to the user
> when a program is verified, success or failure with a verbose verifier log.
> Some information is meant to be more discretionary, e.g. warning about use of
> kfuncs that are deprecated, and may be removed in future kernel releases.
> 
> An example is shown below.
> 
> $ ./test_progs -t kfunc_implicit_args/test_kfunc_implicit_arg_legacy_impl -v
> ...
> 2: (b7) r3 = 0                        ; R3=0
> 3: (85) call bpf_kfunc_implicit_arg_legacy_impl#114683
> kfunc_implicit_args.c:40 (insn #3) uses deprecated kfunc bpf_kfunc_implicit_arg_legacy_impl(), which will be removed.
> Switch to kfunc bpf_kfunc_implicit_arg_legacy() instead.
> For older kernels, choose the correct kfunc using bpf_ksym_exists().
> 4: R0=scalar()
> 4: (95) exit
> ...
> 
> With verbose logging, the deprecation warnings are printed inline in the
> verifier log. When no log level is chosen, the warning is printed in a
> block, as follows:
> 
> libbpf: prog 'test_kfunc_implicit_arg_legacy_impl': -- BEGIN PROG LOAD WARNINGS --
> kfunc_implicit_args.c:40 (insn #3) uses deprecated kfunc bpf_kfunc_implicit_arg_legacy_impl(), which will be removed.
> Switch to kfunc bpf_kfunc_implicit_arg_legacy() instead.
> For older kernels, choose the correct kfunc using bpf_ksym_exists().
> -- END PROG LOAD WARNINGS --
> 
> The set was tested with and without kernel changes applied, so that we
> could conclude that libbpf feature detection works correctly and
> backwards compatibility is not violated on older kernels. Still, it
> would be helpful if other reviewers could recheck all assumptions and
> make sure I didn't miss any corner case.
> 
> One case I need more opinions on: log_buf.c passes log_buf with
> log_level=0 and expects it to be empty, with newer libbpf that won't be
> true on older kernels anymore. I don't think this is something that
> needs to be addressed, but explicitly noting it here since I saw that
> test fail when testing new libbpf on older kernels. The kernel will now
> populate such log_buf will "processed N insns ..." log since on failure
> libbpf will retry with log_level=1, so unless applications are relying
> on log_buf to be empty for correctness it should be ok.
> 

Since I'm going to add common attributes [1] support for BPF syscall,
how about reporting the warnings via the common attributes? Even though,
the original intent of common attributes support for BPF_LOAD was to
report the verifier log too.

[1] https://lore.kernel.org/bpf/20260216150445.68278-1-leon.hwang@linux.dev/

Thanks,
Leon


  parent reply	other threads:[~2026-04-08 14:56 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-08  2:13 [PATCH bpf-next v2 0/6] Add support to emit verifier warnings Kumar Kartikeya Dwivedi
2026-04-08  2:13 ` [PATCH bpf-next v2 1/6] bpf: Add support for verifier warning messages Kumar Kartikeya Dwivedi
2026-04-08  8:46   ` sun jian
2026-04-08  2:13 ` [PATCH bpf-next v2 2/6] bpf: Extract bpf_get_linfo_file_line Kumar Kartikeya Dwivedi
2026-04-08  2:13 ` [PATCH bpf-next v2 3/6] bpf: Make find_linfo widely available Kumar Kartikeya Dwivedi
2026-04-08 15:46   ` Mykyta Yatsenko
2026-04-08  2:13 ` [PATCH bpf-next v2 4/6] bpf: Use KF_DEPRECATED to emit verifier warnings Kumar Kartikeya Dwivedi
2026-04-08  2:13 ` [PATCH bpf-next v2 5/6] bpf: Add __bpf_kfunc_replacement() annotation Kumar Kartikeya Dwivedi
2026-04-08  2:13 ` [PATCH bpf-next v2 6/6] libbpf: Flush verifier warning messages by default Kumar Kartikeya Dwivedi
2026-04-08  2:21   ` Kumar Kartikeya Dwivedi
2026-04-08 14:55 ` Leon Hwang [this message]
2026-04-08 15:30   ` [PATCH bpf-next v2 0/6] Add support to emit verifier warnings Leon Hwang
2026-04-18 11:06     ` Kumar Kartikeya Dwivedi
2026-04-20  5:45       ` Leon Hwang
2026-04-09  1:20 ` 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=1a7aea41-cc64-4277-a08d-1cee1ad6024b@gmail.com \
    --to=hffilwlqm@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=ihor.solodrai@linux.dev \
    --cc=kernel-team@meta.com \
    --cc=kkd@meta.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.