From: Puranjay Mohan <puranjay@kernel.org>
To: Mykyta Yatsenko <mykyta.yatsenko5@gmail.com>,
bpf@vger.kernel.org, ast@kernel.org, andrii@kernel.org,
daniel@iogearbox.net, kafai@meta.com, kernel-team@meta.com,
eddyz87@gmail.com
Cc: Mykyta Yatsenko <yatsenko@meta.com>
Subject: Re: [PATCH bpf-next v3 2/4] bpf: Verifier support for sleepable raw tracepoint programs
Date: Wed, 11 Mar 2026 23:40:27 +0000 [thread overview]
Message-ID: <m2h5qmj5p0.fsf@kernel.org> (raw)
In-Reply-To: <20260311-sleepable_tracepoints-v3-2-3e9bbde5bd22@meta.com>
Mykyta Yatsenko <mykyta.yatsenko5@gmail.com> writes:
> From: Mykyta Yatsenko <yatsenko@meta.com>
>
> Add BPF_TRACE_RAW_TP to the set of tracing program attach types
> that can be loaded as sleepable in can_be_sleepable().
>
> Reject sleepable programs that target non-faultable tracepoints
> at load time in bpf_check_attach_target(), providing a clear
> verifier error message.
>
> Signed-off-by: Mykyta Yatsenko <yatsenko@meta.com>
Acked-by: Puranjay Mohan <puranjay@kernel.org>
> ---
> kernel/bpf/verifier.c | 9 ++++++++-
> 1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
> index 8e4f69918693..95b33b85698f 100644
> --- a/kernel/bpf/verifier.c
> +++ b/kernel/bpf/verifier.c
> @@ -25216,6 +25216,12 @@ int bpf_check_attach_target(struct bpf_verifier_log *log,
> btp = bpf_get_raw_tracepoint(tname);
> if (!btp)
> return -EINVAL;
> + if (prog->sleepable && !tracepoint_is_faultable(btp->tp)) {
> + bpf_log(log, "Sleepable program cannot attach to non-faultable tracepoint %s\n",
> + tname);
> + bpf_put_raw_tracepoint(btp);
> + return -EINVAL;
> + }
> fname = kallsyms_lookup((unsigned long)btp->bpf_func, NULL, NULL, NULL,
> trace_symbol);
> bpf_put_raw_tracepoint(btp);
> @@ -25432,6 +25438,7 @@ static bool can_be_sleepable(struct bpf_prog *prog)
> case BPF_MODIFY_RETURN:
> case BPF_TRACE_ITER:
> case BPF_TRACE_FSESSION:
> + case BPF_TRACE_RAW_TP:
> return true;
> default:
> return false;
> @@ -25461,7 +25468,7 @@ static int check_attach_btf_id(struct bpf_verifier_env *env)
> }
>
> if (prog->sleepable && !can_be_sleepable(prog)) {
> - verbose(env, "Only fentry/fexit/fmod_ret, lsm, iter, uprobe, and struct_ops programs can be sleepable\n");
> + verbose(env, "Only fentry/fexit/fmod_ret, lsm, iter, uprobe, struct_ops, and raw_tp programs can be sleepable\n");
> return -EINVAL;
> }
>
>
> --
> 2.52.0
next prev parent reply other threads:[~2026-03-11 23:40 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-11 18:22 [PATCH bpf-next v3 0/4] bpf: Add support for sleepable raw tracepoint programs Mykyta Yatsenko
2026-03-11 18:22 ` [PATCH bpf-next v3 1/4] bpf: Add sleepable execution path for " Mykyta Yatsenko
2026-03-11 19:25 ` Emil Tsalapatis
2026-03-11 23:39 ` Puranjay Mohan
2026-03-12 20:51 ` Andrii Nakryiko
2026-03-11 18:22 ` [PATCH bpf-next v3 2/4] bpf: Verifier support for sleepable " Mykyta Yatsenko
2026-03-11 18:49 ` Emil Tsalapatis
2026-03-11 18:53 ` bot+bpf-ci
2026-03-11 23:07 ` Kumar Kartikeya Dwivedi
2026-03-12 5:50 ` Leon Hwang
2026-03-12 6:21 ` Menglong Dong
2026-03-12 6:43 ` Leon Hwang
2026-03-11 23:08 ` Kumar Kartikeya Dwivedi
2026-03-11 23:40 ` Puranjay Mohan [this message]
2026-03-12 20:59 ` Andrii Nakryiko
2026-03-11 18:22 ` [PATCH bpf-next v3 3/4] libbpf: Add tp_btf.s section handler for sleepable raw tracepoints Mykyta Yatsenko
2026-03-11 18:54 ` Emil Tsalapatis
2026-03-11 23:40 ` Puranjay Mohan
2026-03-12 20:59 ` Andrii Nakryiko
2026-03-11 18:22 ` [PATCH bpf-next v3 4/4] selftests/bpf: Add tests for sleepable raw tracepoint programs Mykyta Yatsenko
2026-03-11 19:12 ` Emil Tsalapatis
2026-03-11 23:41 ` Puranjay Mohan
2026-03-12 21:03 ` Andrii Nakryiko
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=m2h5qmj5p0.fsf@kernel.org \
--to=puranjay@kernel.org \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=kafai@meta.com \
--cc=kernel-team@meta.com \
--cc=mykyta.yatsenko5@gmail.com \
--cc=yatsenko@meta.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.