From: "Kumar Kartikeya Dwivedi" <memxor@gmail.com>
To: "Mykyta Yatsenko" <mykyta.yatsenko5@gmail.com>,
"Daniel Borkmann" <daniel@iogearbox.net>, <ast@kernel.org>
Cc: <eddyz87@gmail.com>, <info@starlabs.sg>, <bpf@vger.kernel.org>
Subject: Re: [PATCH bpf 1/4] bpf: Add KF_PERFMON kfunc flag
Date: Thu, 10 Sep 2026 17:14:23 +0200 [thread overview]
Message-ID: <DLBQGB3CXTSB.EXQVL3ZIQ3QO@gmail.com> (raw)
In-Reply-To: <ea68b32c-1af2-47ae-b168-4fd6791f607b@gmail.com>
On Thu Sep 10, 2026 at 5:03 PM CEST, Mykyta Yatsenko wrote:
> On 9/10/26 3:21 PM, Daniel Borkmann wrote:
>> Tracing related BPF helpers e.g. under bpf_base_func_proto() are gated
>> behind CAP_PERFMON. However, the same is currently not true for kfuncs
>> and they are accessible via plain CAP_BPF. Add a new KF_PERFMON flag
>> which can be used such that check_kfunc_call() ensures env->allow_ptr_leaks
>> is permitted. This follows similar pattern to existing KF_DESTRUCTIVE flag.
>>
>
> This problem has been reported and patch sent some time ago:
> https://lore.kernel.org/all/20260615-f01-07-dynptr-probe-read-cap-v1-0-e626cd61a381@mails.tsinghua.edu.cn/
>
We ended up discussing this and decided to go ahead, since it's a bit weird to
continue to have the discrepancy against helpers that have similar restrictions.
In practice it won't matter much to actual users, but easier to just fix it and
put the thing to rest. This one is also a more comprehensive fix compared to
Nuoqi's.
> [...]
next prev parent reply other threads:[~2026-09-10 15:14 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-10 14:21 [PATCH bpf 1/4] bpf: Add KF_PERFMON kfunc flag Daniel Borkmann
2026-09-10 14:21 ` [PATCH bpf 2/4] bpf: Require CAP_PERFMON for kfuncs reading memory Daniel Borkmann
2026-09-10 15:10 ` bot+bpf-ci
2026-09-10 15:41 ` Alexei Starovoitov
2026-09-10 15:53 ` Daniel Borkmann
2026-09-10 14:21 ` [PATCH bpf 3/4] bpf: Require CAP_PERFMON for untrusted read-only memory reads Daniel Borkmann
2026-09-10 15:42 ` Alexei Starovoitov
2026-09-10 14:21 ` [PATCH bpf 4/4] selftests/bpf: Add tests for the KF_PERFMON gates Daniel Borkmann
2026-09-10 15:03 ` [PATCH bpf 1/4] bpf: Add KF_PERFMON kfunc flag Mykyta Yatsenko
2026-09-10 15:14 ` Kumar Kartikeya Dwivedi [this message]
2026-09-10 15:21 ` Mykyta Yatsenko
2026-09-10 15:10 ` bot+bpf-ci
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=DLBQGB3CXTSB.EXQVL3ZIQ3QO@gmail.com \
--to=memxor@gmail.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=info@starlabs.sg \
--cc=mykyta.yatsenko5@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox