linux-yocto/tools/perf
Ian Rogers 203719d829 perf bpf-utils: Harden get_bpf_prog_info_linear
[ Upstream commit 01be43f2a0eaeed83e94dee054742f37625c86d9 ]

In get_bpf_prog_info_linear two calls to bpf_obj_get_info_by_fd are
made, the first to compute memory requirements for a struct perf_bpil
and the second to fill it in. Previously the code would warn when the
second call didn't match the first. Such races can be common place in
things like perf test, whose perf trace tests will frequently load BPF
programs. Rather than a debug message, return actual errors for this
case. Out of paranoia also validate the read bpf_prog_info array
value. Change the type of ptr to avoid mismatched pointer type
compiler warnings. Add some additional debug print outs and sanity
asserts.

Closes: https://lore.kernel.org/lkml/CAP-5=fWJQcmUOP7MuCA2ihKnDAHUCOBLkQFEkQES-1ZZTrgf8Q@mail.gmail.com/
Fixes: 6ac22d036f ("perf bpf: Pull in bpf_program__get_prog_info_linear()")
Reviewed-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Ian Rogers <irogers@google.com>
Link: https://lore.kernel.org/r/20250902181713.309797-4-irogers@google.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-09-09 18:58:25 +02:00
..
arch perf tools: Fix up some comments and code to properly use the event_source bus 2025-04-07 10:08:36 +02:00
bench perf bench: Fix perf bench syscall loop count 2025-04-10 14:39:23 +02:00
check-header_ignore_hunks/lib
dlfilters
Documentation perf tools: Fix up some comments and code to properly use the event_source bus 2025-04-07 10:08:36 +02:00
include/perf
jvmti
pmu-events perf vendor events arm64 AmpereOneX: Fix frontend_bound calculation 2025-04-10 14:39:26 +02:00
python
scripts perf scripts python: exported-sql-viewer.py: Fix pattern matching with Python 3 2025-06-19 15:32:06 +02:00
tests perf tests bp_account: Fix leaked file descriptor 2025-08-15 12:13:54 +02:00
trace
ui perf ui browser hists: Set actions->thread before calling do_zoom_thread() 2025-06-19 15:32:04 +02:00
util perf bpf-utils: Harden get_bpf_prog_info_linear 2025-09-09 18:58:25 +02:00
.gitignore perf tools: Remove libtraceevent in .gitignore 2025-08-15 12:13:57 +02:00
Build
builtin-annotate.c
builtin-bench.c
builtin-buildid-cache.c
builtin-buildid-list.c
builtin-c2c.c
builtin-check.c
builtin-config.c
builtin-daemon.c
builtin-data.c
builtin-diff.c
builtin-evlist.c
builtin-ftrace.c
builtin-help.c
builtin-inject.c
builtin-kallsyms.c
builtin-kmem.c
builtin-kvm.c
builtin-kwork.c
builtin-list.c
builtin-lock.c
builtin-mem.c
builtin-probe.c
builtin-record.c perf record: Fix incorrect --user-regs comments 2025-06-19 15:32:08 +02:00
builtin-report.c perf report: Switch data file correctly in TUI 2025-04-10 14:39:22 +02:00
builtin-sched.c perf sched: Fix memory leaks in 'perf sched latency' 2025-08-15 12:13:52 +02:00
builtin-script.c
builtin-stat.c perf tools: Fix up some comments and code to properly use the event_source bus 2025-04-07 10:08:36 +02:00
builtin-timechart.c
builtin-top.c
builtin-trace.c perf trace: Set errpid to false for rseq and set_robust_list 2025-06-19 15:32:08 +02:00
builtin-version.c
builtin.h
check-headers.sh
command-list.txt
CREDITS
design.txt
Makefile
Makefile.config perf build: Warn when libdebuginfod devel files are not available 2025-06-19 15:32:04 +02:00
Makefile.perf perf tests: Fix 'perf report' tests installation 2025-06-19 15:32:06 +02:00
MANIFEST
perf-archive.sh
perf-completion.sh
perf-iostat.sh
perf-read-vdso.c
perf-sys.h
perf.c
perf.h