milos-linux/tools/perf
Ian Rogers c9ef786c09 perf cgroup: Update metric leader in evlist__expand_cgroup
When the evlist is expanded the metric leader wasn't being updated. As
the original evsel is deleted this creates a use-after-free in
stat-shadow's prepare_metric. This was detected running the "perf stat
--bpf-counters --for-each-cgroup test" with sanitizers.

The change itself puts the copied evsel into the priv field (known
unused because of evsel__clone use) and then in a second pass over the
list updates the copied values using the priv pointer.

Fixes: d1c5a0e86a ("perf stat: Add --for-each-cgroup option")
Signed-off-by: Ian Rogers <irogers@google.com>
Acked-by: Sun Jian <sun.jian.kdev@gmail.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
2026-04-05 23:23:33 -07:00
..
arch libperf cpumap: Make index and nr types unsigned 2026-04-01 14:50:53 -07:00
bench perf bench: Add -t/--threads option to perf bench mem mmap 2026-02-26 10:54:12 -08:00
check-header_ignore_hunks/lib
dlfilters
Documentation perf tools: Add --pmu-filter option for filtering PMUs 2026-03-27 13:58:01 -07:00
include/perf
jvmti perf tools: Use const for variables receiving str{str,r?chr}() returns 2025-12-17 09:30:37 -03:00
pmu-events perf metrics: Make common stalled metrics conditional on having the event 2026-04-02 20:12:28 -07:00
python
scripts perf script: Fix script_fetch_insn for more than just x86 2026-01-27 01:35:22 -03:00
tests perf sample: Add evsel to struct perf_sample 2026-04-05 23:12:15 -07:00
trace perf beauty: Move copy of fadvise.h from tools/include/ to tools/perf/trace/beauty/include/ 2026-03-31 20:23:06 -07:00
ui perf disasm: Refactor arch__find and initialization of arch structs 2026-01-23 16:58:39 -03:00
util perf cgroup: Update metric leader in evlist__expand_cgroup 2026-04-05 23:23:33 -07:00
.gitignore perf jevents: Build support for generating metrics from python 2026-01-28 15:18:44 -03:00
Build
builtin-annotate.c perf header: Refactor pipe mode end marker handling 2026-04-02 19:35:16 -07:00
builtin-bench.c
builtin-buildid-cache.c perf symbol: Fix ENOENT case for filename__read_build_id 2025-12-17 07:30:51 -08:00
builtin-buildid-list.c
builtin-c2c.c libperf cpumap: Make index and nr types unsigned 2026-04-01 14:50:53 -07:00
builtin-check.c perf check: Add libbabeltrace to the listed features 2026-02-12 17:45:22 -03:00
builtin-config.c
builtin-daemon.c perf tools: Switch printf("...%s", strerror(errno)) to printf("...%m") 2026-01-14 17:22:50 -03:00
builtin-data.c perf data: Allow filtering conversion by time range 2026-01-06 19:20:02 -03:00
builtin-diff.c perf tools: Add layout support for --symfs option 2026-03-10 23:13:30 -07:00
builtin-evlist.c
builtin-ftrace.c perf ftrace: Fix hashmap__new() error checking 2026-03-10 11:53:27 -03:00
builtin-help.c perf help: Move common_cmds into builtin-help 2026-01-14 17:22:50 -03:00
builtin-inject.c perf sample: Add evsel to struct perf_sample 2026-04-05 23:12:15 -07:00
builtin-kallsyms.c
builtin-kmem.c
builtin-kvm.c perf session: Add e_flags to the e_machine helper 2026-02-03 18:01:27 -03:00
builtin-kwork.c perf tools: Add layout support for --symfs option 2026-03-10 23:13:30 -07:00
builtin-list.c Merge remote-tracking branch 'torvalds/master' into perf-tools-next 2026-01-26 17:03:53 -03:00
builtin-lock.c perf lock: Fix option value type in parse_max_stack 2026-03-26 15:02:42 -07:00
builtin-mem.c
builtin-probe.c perf tools: Add layout support for --symfs option 2026-03-10 23:13:30 -07:00
builtin-record.c libperf cpumap: Make index and nr types unsigned 2026-04-01 14:50:53 -07:00
builtin-report.c perf header: Refactor pipe mode end marker handling 2026-04-02 19:35:16 -07:00
builtin-sched.c perf sched: Avoid crash for unexpected perf sched stats report 2026-04-05 22:21:42 -07:00
builtin-script.c perf sample: Add evsel to struct perf_sample 2026-04-05 23:12:15 -07:00
builtin-stat.c perf stat: Fix crash on arm64 2026-04-02 12:51:09 -07:00
builtin-timechart.c perf tools: Add layout support for --symfs option 2026-03-10 23:13:30 -07:00
builtin-top.c perf evlist: Improve default event for s390 2026-03-19 14:42:46 -07:00
builtin-trace.c perf trace: Fix potential u64 underflow in duration calculation 2026-04-02 18:43:35 -07:00
builtin-version.c
builtin.h
check-headers.sh perf beauty: Move copy of fadvise.h from tools/include/ to tools/perf/trace/beauty/include/ 2026-03-31 20:23:06 -07:00
CREDITS
design.txt
Makefile
Makefile.config perf build: Add -funsigned-char to default CFLAGS 2026-03-31 20:22:02 -07:00
Makefile.perf perf beauty: Move copy of fadvise.h from tools/include/ to tools/perf/trace/beauty/include/ 2026-03-31 20:23:06 -07:00
MANIFEST
perf-archive.sh
perf-completion.sh
perf-iostat.sh
perf-read-vdso.c
perf-sys.h
perf.c perf tool: Constify the command and option arrays 2026-03-13 14:26:27 -07:00
perf.h