Thread (7 messages) 7 messages, 5 authors, 2026-08-25

Re: [PATCH] perf/bpf: Fix lockless access to parent_event->prog in perf_event_alloc()

flat view

From: Deepanshu Kartikey <hidden>
Date: 2026-08-25 01:38:37
Also in: bpf, linux-perf-users, lkml

On Sat, Aug 22, 2026 at 12:04 AM Andrii Nakryiko
[off-list ref] wrote:
exposing this mutex like that is definitely a smell.

AI tells me that this perf event inheritance case can happen for
non-tracing (i.e., BPF_PROG_TYPE_PERF_EVENT) events, which are
attached while holding perf_event_ctx_lock, not the bpf_event_mutex
(this one is held for tracepoint/kprobe/uprobe programs).

Please validate and adjust the fix.
Thank you! You are correct.

perf_event_set_bpf_handler() is called
via two paths:
1. perf_event_set_bpf_prog() with ctx_lock
2. _perf_ioctl() with no lock

I will investigate the correct fix.

Thanks

Deepanshu
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help