BPF List
 help / color / mirror / Atom feed
From: Eduard Zingerman <eddyz87@gmail.com>
To: Puranjay Mohan <puranjay@kernel.org>
Cc: bpf@vger.kernel.org, Alexei Starovoitov <ast@kernel.org>,
	Andrii Nakryiko	 <andrii@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Martin KaFai Lau	 <martin.lau@kernel.org>,
	Kumar Kartikeya Dwivedi <memxor@gmail.com>,
		kernel-team@meta.com
Subject: Re: [PATCH bpf-next v2 1/9] bpf: Make KF_TRUSTED_ARGS the default for all kfuncs
Date: Wed, 31 Dec 2025 11:10:27 -0800	[thread overview]
Message-ID: <49cd9cf5a600e240e2ebea8098e25026688b4cb8.camel@gmail.com> (raw)
In-Reply-To: <CANk7y0js_-wvW281NAbr2eaCmvMxBAyCDd0wtdf+7XGKKRxEVw@mail.gmail.com>

On Wed, 2025-12-31 at 19:00 +0000, Puranjay Mohan wrote:

[...]

> There is another aspect I want your opinion one:
> 
> Assume a kfunc returns an error when you pass in a NULL pointer for
> some parameter, it checks for NULL as if it is not valid usage, it
> returns an error. After this change, this kfunc will not return an
> error at runtime, rather will be rejected by the verifier itself. This
> should not be a problem for real programs right?

Yes, makes sense.

> I think we should drop the second patch: "bpf: net: netfilter: Mark
> kfuncs accurately" because these kfuncs have no real use case with
> NULL being passed to them, only a self test tries to call them with
> NULL parameters, I think we should change the self test to detect
> load failure and leave these kfuncs without __nullable
> annotation. What do you think?

Actually, I was going to ack that patch :)
But you are right, each of those kfuncs is a wrapper and functions
they wrap, like __bpf_nf_ct_alloc_entry, require 'opts' not to be null
or return an error.

  reply	other threads:[~2025-12-31 19:10 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-31 17:08 [PATCH bpf-next v2 0/9] bpf: Make KF_TRUSTED_ARGS default Puranjay Mohan
2025-12-31 17:08 ` [PATCH bpf-next v2 1/9] bpf: Make KF_TRUSTED_ARGS the default for all kfuncs Puranjay Mohan
2025-12-31 17:37   ` bot+bpf-ci
2025-12-31 18:37   ` Eduard Zingerman
2025-12-31 19:00     ` Puranjay Mohan
2025-12-31 19:10       ` Eduard Zingerman [this message]
2025-12-31 19:15         ` Puranjay Mohan
2026-01-02  0:15   ` Emil Tsalapatis
2025-12-31 17:08 ` [PATCH bpf-next v2 2/9] bpf: net: netfilter: Mark kfuncs accurately Puranjay Mohan
2025-12-31 17:08 ` [PATCH bpf-next v2 3/9] bpf: Remove redundant KF_TRUSTED_ARGS flag from all kfuncs Puranjay Mohan
2025-12-31 19:13   ` Eduard Zingerman
2026-01-02  0:19   ` Emil Tsalapatis
2025-12-31 17:08 ` [PATCH bpf-next v2 4/9] selftests: bpf: Update kfunc_param_nullable test for new error message Puranjay Mohan
2025-12-31 19:21   ` Eduard Zingerman
2026-01-02  1:45   ` Emil Tsalapatis
2025-12-31 17:08 ` [PATCH bpf-next v2 5/9] selftests: bpf: Update failure message for rbtree_fail Puranjay Mohan
2025-12-31 19:27   ` Eduard Zingerman
2025-12-31 19:44     ` Puranjay Mohan
2025-12-31 19:45       ` Eduard Zingerman
2026-01-02  1:44   ` Emil Tsalapatis
2025-12-31 17:08 ` [PATCH bpf-next v2 6/9] selftests: bpf: fix test_kfunc_dynptr_param Puranjay Mohan
2025-12-31 19:29   ` Eduard Zingerman
2025-12-31 19:39     ` Puranjay Mohan
2025-12-31 19:44       ` Eduard Zingerman
2025-12-31 23:29         ` Puranjay Mohan
2026-01-02  1:44   ` Emil Tsalapatis
2025-12-31 17:08 ` [PATCH bpf-next v2 7/9] selftests: bpf: fix cgroup_hierarchical_stats Puranjay Mohan
2025-12-31 19:40   ` Eduard Zingerman
2026-01-02  1:48   ` Emil Tsalapatis
2025-12-31 17:08 ` [PATCH bpf-next v2 8/9] bpf: xfrm: drop dead NULL check in bpf_xdp_get_xfrm_state() Puranjay Mohan
2025-12-31 19:48   ` Eduard Zingerman
2025-12-31 17:08 ` [PATCH bpf-next v2 9/9] HID: bpf: drop dead NULL checks in kfuncs Puranjay Mohan
2025-12-31 18:20   ` Alexei Starovoitov
2025-12-31 18:25     ` Puranjay Mohan
2026-01-05 14:52       ` Benjamin Tissoires

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=49cd9cf5a600e240e2ebea8098e25026688b4cb8.camel@gmail.com \
    --to=eddyz87@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=kernel-team@meta.com \
    --cc=martin.lau@kernel.org \
    --cc=memxor@gmail.com \
    --cc=puranjay@kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox