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 1/7] bpf: Make KF_TRUSTED_ARGS the default for all kfuncs
Date: Tue, 30 Dec 2025 16:29:40 -0800	[thread overview]
Message-ID: <6d032492af465929e1e02c53a479f71ef8964d76.camel@gmail.com> (raw)
In-Reply-To: <CANk7y0g6s5C-mLTPUpGyvJC=ZA=v9WawYzbeVgocbsf4dcXJHw@mail.gmail.com>

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

[...]

> I wish to do a full review of all kfuncs and make
> sure either they are tagged with correct __nullable, __opt annotation
> or fixed to make sure they are doing the right thing. But currently I
> just made sure all selftests pass, some of the kfuncs might not have
> self tests and would need manual analysis and I will have to do that.

Ack, sounds like a plan.

> Some kfuncs will have breaking changes, I am not sure how to work
> around that case, for example css_rstat_updated() could be
> successfully called from fentry programs like the selftest fixed in
> Patch 7, it worked because css_rstat_updated() doesn't mark the
> parameters with KF_TRUSTED_ARGS, but now KF_TRUSTED_ARGS is the
> default so this kfunc can't be called from fentry programs as fentry's
> parameters are not marked as trusted.
> 
> 
> Looking at the code of css_rstat_updated() it seems that it assumes
> the parameters to be trusted and therefore not allowing it to be
> called from fentry would be the right thing to do,
> but it could break perfectly working BPF programs.

Indeed, it expects 'css' to be not NULL as it dereferences the
pointer immediately.

  reply	other threads:[~2025-12-31  0:29 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-24 19:24 [PATCH bpf-next 0/7] bpf: Make KF_TRUSTED_ARGS default Puranjay Mohan
2025-12-24 19:24 ` [PATCH bpf-next 1/7] bpf: Make KF_TRUSTED_ARGS the default for all kfuncs Puranjay Mohan
2025-12-30 23:49   ` Eduard Zingerman
2025-12-30 23:56     ` Alexei Starovoitov
2025-12-31  0:08     ` Puranjay Mohan
2025-12-31  0:29       ` Eduard Zingerman [this message]
2025-12-31 12:34         ` Puranjay Mohan
2025-12-31 16:45           ` Alexei Starovoitov
2025-12-24 19:24 ` [PATCH bpf-next 2/7] bpf: net: netfilter: Mark kfuncs accurately Puranjay Mohan
2025-12-24 19:24 ` [PATCH bpf-next 3/7] bpf: Remove redundant KF_TRUSTED_ARGS flag from all kfuncs Puranjay Mohan
2025-12-24 19:24 ` [PATCH bpf-next 4/7] selftests: bpf: Update kfunc_param_nullable test for new error message Puranjay Mohan
2025-12-24 19:24 ` [PATCH bpf-next 5/7] selftests: bpf: Update failure message for rbtree_fail Puranjay Mohan
2025-12-24 19:24 ` [PATCH bpf-next 6/7] selftests: bpf: fix test_kfunc_dynptr_param Puranjay Mohan
2025-12-31  2:04   ` Alexei Starovoitov
2025-12-24 19:24 ` [PATCH bpf-next 7/7] selftests: bpf: fix cgroup_hierarchical_stats Puranjay Mohan

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=6d032492af465929e1e02c53a479f71ef8964d76.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