linux-yocto/tools/perf
Ian Rogers c9c4635a6d perf bpf-event: Fix use-after-free in synthesis
[ Upstream commit d7b67dd6f9db7bd2c49b415e901849b182ff0735 ]

Calls to perf_env__insert_bpf_prog_info may fail as a sideband thread
may already have inserted the bpf_prog_info. Such failures may yield
info_linear being freed which then causes use-after-free issues with
the internal bpf_prog_info info struct. Make it so that
perf_env__insert_bpf_prog_info trigger early non-error paths and fix
the use-after-free in perf_event__synthesize_one_bpf_prog. Add proper
return error handling to perf_env__add_bpf_info (that calls
perf_env__insert_bpf_prog_info) and propagate the return value in its
callers.

Closes: https://lore.kernel.org/lkml/CAP-5=fWJQcmUOP7MuCA2ihKnDAHUCOBLkQFEkQES-1ZZTrgf8Q@mail.gmail.com/
Fixes: 03edb7020b ("perf bpf: Fix two memory leakages when calling perf_env__insert_bpf_prog_info()")
Reviewed-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Ian Rogers <irogers@google.com>
Link: https://lore.kernel.org/r/20250902181713.309797-2-irogers@google.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-09-09 18:56:33 +02:00
..
arch perf intel-pt: Fix exclude_guest setting 2024-08-03 08:53:53 +02:00
bench perf bench: Fix perf bench syscall loop count 2025-04-10 14:37:33 +02:00
dlfilters
Documentation perf: script: add raw|disasm arguments to --insn-trace option 2024-06-27 13:49:14 +02:00
include/perf
jvmti
pmu-events perf stat: Do not fail on metrics on s390 z/VM systems 2024-06-12 11:12:15 +02:00
python
scripts perf scripts python: exported-sql-viewer.py: Fix pattern matching with Python 3 2025-06-19 15:28:27 +02:00
tests perf tests bp_account: Fix leaked file descriptor 2025-08-15 12:08:54 +02:00
trace
ui perf ui browser hists: Set actions->thread before calling do_zoom_thread() 2025-06-19 15:28:25 +02:00
util perf bpf-event: Fix use-after-free in synthesis 2025-09-09 18:56:33 +02:00
.gitignore perf tools: Remove libtraceevent in .gitignore 2025-08-15 12:08:56 +02:00
Build
builtin-annotate.c perf ui/browser/annotate: Use global annotation_options 2024-10-04 16:29:24 +02:00
builtin-bench.c
builtin-buildid-cache.c
builtin-buildid-list.c
builtin-c2c.c
builtin-config.c
builtin-daemon.c perf daemon: Fix file leak in daemon_session__control 2024-06-12 11:12:30 +02:00
builtin-data.c
builtin-diff.c
builtin-evlist.c
builtin-ftrace.c perf ftrace latency: Fix unit on histogram first entry when using --use-nsec 2024-12-09 10:32:25 +01:00
builtin-help.c
builtin-inject.c perf inject: Fix leader sampling inserting additional samples 2024-10-04 16:29:23 +02:00
builtin-kallsyms.c
builtin-kmem.c libsubcmd: Don't free the usage string 2024-10-17 15:24:13 +02:00
builtin-kvm.c libsubcmd: Don't free the usage string 2024-10-17 15:24:13 +02:00
builtin-kwork.c libsubcmd: Don't free the usage string 2024-10-17 15:24:13 +02:00
builtin-list.c perf list: Fix topic and pmu_name argument order 2024-12-09 10:32:28 +01:00
builtin-lock.c perf lock: Fix parse_lock_type which only retrieve one lock flag 2025-02-08 09:52:09 +01:00
builtin-mem.c libsubcmd: Don't free the usage string 2024-10-17 15:24:13 +02:00
builtin-probe.c
builtin-record.c perf record: Fix incorrect --user-regs comments 2025-06-19 15:28:28 +02:00
builtin-report.c perf report: Fix misleading help message about --demangle 2025-02-08 09:52:08 +01:00
builtin-sched.c perf sched: Fix memory leaks in 'perf sched latency' 2025-08-15 12:08:53 +02:00
builtin-script.c perf script: Show also errors for --insn-trace option 2024-06-27 13:49:14 +02:00
builtin-stat.c perf stat: Fix affinity memory leaks on error path 2024-12-09 10:32:24 +01:00
builtin-timechart.c
builtin-top.c perf top: Don't complain about lack of vmlinux when not resolving some kernel samples 2025-02-08 09:52:07 +01:00
builtin-trace.c perf trace: Always print return value for syscalls returning a pid 2025-06-19 15:28:28 +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:28:25 +02:00
Makefile.perf perf: build: Setup PKG_CONFIG_LIBDIR for cross compilation 2025-07-17 18:35:11 +02:00
MANIFEST
perf-archive.sh
perf-completion.sh
perf-iostat.sh
perf-read-vdso.c
perf-sys.h
perf.c
perf.h