From: "Alexei Starovoitov" <alexei.starovoitov@gmail.com>
To: "Jiri Olsa" <olsajiri@gmail.com>
Cc: "Daniel Borkmann" <daniel@iogearbox.net>,
"Andrii Nakryiko" <andrii@kernel.org>, <bpf@vger.kernel.org>,
"Martin KaFai Lau" <martin.lau@linux.dev>,
"Eduard Zingerman" <eddyz87@gmail.com>,
"Song Liu" <song@kernel.org>,
"Yonghong Song" <yonghong.song@linux.dev>,
"HyeongJun An" <sammiee5311@gmail.com>,
"Christian Simon" <simon@swine.de>
Subject: Re: [PATCH bpf-next 0/4] bpf: Disable private stacks for uprobe programs
Date: Fri, 06 Nov 2026 02:44:46 +0000 [thread overview]
Message-ID: <DMNS7EVJIZNH.2KVNGPHEJ2H60@gmail.com> (raw)
In-Reply-To: <aus-b8Lo2oCw_cGd@krava>
On Wed, Nov 04, 2026 at 06:17 AM Jiri Olsa <olsajiri@gmail.com> wrote:
> should we also ban all kprobe.multi programs in here?
>
> checking only jits_use_priv_stack on the entry program may miss a
> private-stack tail-call target, like:
Good point. Yes.
> + if (is_uprobe &&
> + (prog->aux->jits_use_priv_stack ||
> + prog->expected_attach_type == BPF_TRACE_KPROBE_MULTI ||
> + prog->expected_attach_type == BPF_TRACE_KPROBE_SESSION))
> return -EINVAL;
can we ban all four multi and session types, on kprobe events too ?
like your commit db8eae6bc5c7 did for perf_link.
The ioctl still has that crash: bpf_get_attach_cookie() in a kprobe.multi
prog reads bpf_trace_run_ctx as bpf_kprobe_multi_run_ctx.
Then no need for is_uprobe and jits_use_priv_stack in this check.
Like:
if (prog->type == BPF_PROG_TYPE_KPROBE &&
(prog->expected_attach_type == BPF_TRACE_KPROBE_MULTI ||
prog->expected_attach_type == BPF_TRACE_KPROBE_SESSION ||
prog->expected_attach_type == BPF_TRACE_UPROBE_MULTI ||
prog->expected_attach_type == BPF_TRACE_UPROBE_SESSION))
return -EINVAL;
prev parent reply other threads:[~2026-11-06 2:44 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-03 9:33 [PATCH bpf-next 0/4] bpf: Disable private stacks for uprobe programs Jiri Olsa
2026-11-03 9:33 ` [PATCH bpf-next 1/4] bpf: Disable private stack " Jiri Olsa
2026-11-03 9:33 ` [PATCH bpf-next 2/4] bpf: Add BPF_TRACE_UPROBE attach type Jiri Olsa
2026-11-03 9:59 ` sashiko-bot
2026-11-03 9:33 ` [PATCH bpf-next 3/4] libbpf: Detect BPF_TRACE_UPROBE support Jiri Olsa
2026-11-03 9:54 ` sashiko-bot
2026-11-03 9:34 ` [PATCH bpf-next 4/4] selftests/bpf: Verify classic uprobe attach types Jiri Olsa
2026-11-03 9:56 ` sashiko-bot
2026-11-04 4:33 ` [PATCH bpf-next 0/4] bpf: Disable private stacks for uprobe programs Alexei Starovoitov
2026-11-04 14:17 ` Jiri Olsa
2026-11-06 2:44 ` Alexei Starovoitov [this message]
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=DMNS7EVJIZNH.2KVNGPHEJ2H60@gmail.com \
--to=alexei.starovoitov@gmail.com \
--cc=andrii@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=martin.lau@linux.dev \
--cc=olsajiri@gmail.com \
--cc=sammiee5311@gmail.com \
--cc=simon@swine.de \
--cc=song@kernel.org \
--cc=yonghong.song@linux.dev \
/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.