linux-yocto/tools
Ian Rogers 25eac390c4 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:58:25 +02:00
..
accounting
arch x86/rdrand: Disable RDSEED on AMD Cyan Skillfish 2025-07-17 18:37:14 +02:00
bootconfig tools/bootconfig: Fix the wrong format specifier 2025-02-08 09:58:00 +01:00
bpf bpftool: Fix JSON writer resource leak in version command 2025-08-20 18:30:38 +02:00
build tools/build: Don't pass test log files to linker 2025-05-29 11:02:08 +02:00
certs
cgroup memcg_slabinfo: Fix use of PG_slab 2025-08-15 12:13:46 +02:00
counter
crypto
debugging
firewire
firmware
gpio
hv tools/hv: fcopy: Fix irregularities with size of ring buffer 2025-08-20 18:30:56 +02:00
iio
include tools/nolibc: fix spelling of FD_SETBITMASK in FD_* macros 2025-08-20 18:30:56 +02:00
kvm/kvm_stat
laptop
leds
lib libbpf: Verify that arena map exists when adding arena relocations 2025-08-20 18:30:29 +02:00
memory-model
mm
net tools: ynl-gen: validate 0 len strings from kernel 2025-05-29 11:03:12 +02:00
objtool objtool/rust: add one more noreturn Rust function for Rust 1.89.0 2025-07-24 08:56:22 +02:00
pci
pcmcia
perf perf bpf-event: Fix use-after-free in synthesis 2025-09-09 18:58:25 +02:00
power cpupower: Fix a bug where the -t option of the set subcommand was not working. 2025-09-09 18:58:02 +02:00
rcu
sched_ext tools/sched_ext: Add helper to check task migration state 2025-03-22 12:54:28 -07:00
scripts tools/build: Fix s390(x) cross-compilation with clang 2025-08-20 18:30:24 +02:00
sound ASoC: dapm-graph: set fill colour of turned on nodes 2025-03-22 12:54:20 -07:00
spi
testing selftest: net: Fix weird setsockopt() in bind_bhash.c. 2025-09-09 18:58:14 +02:00
thermal
time
tracing rtla: Check pkg-config install 2025-09-04 15:31:42 +02:00
usb
verification tools/rv: Do not skip idle in trace 2025-08-15 12:13:46 +02:00
virtio
wmi
workqueue
writeback
Makefile