linux-stable/tools/perf
Yang Jihong 7a4db11f00 perf symbols: Fix return incorrect build_id size in elf_read_build_id()
[ Upstream commit 1511e4696a ]

In elf_read_build_id(), if gnu build_id is found, should return the size of
the actually copied data. If descsz is greater thanBuild_ID_SIZE,
write_buildid data access may occur.

Fixes: be96ea8ffa ("perf symbols: Fix issue with binaries using 16-bytes buildids (v2)")
Reported-by: Will Ochowicz <Will.Ochowicz@genusplc.com>
Signed-off-by: Yang Jihong <yangjihong1@huawei.com>
Tested-by: Will Ochowicz <Will.Ochowicz@genusplc.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Leo Yan <leo.yan@linaro.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: https://lore.kernel.org/lkml/CWLP265MB49702F7BA3D6D8F13E4B1A719C649@CWLP265MB4970.GBRP265.PROD.OUTLOOK.COM/T/
Link: https://lore.kernel.org/r/20230427012841.231729-1-yangjihong1@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-05-17 11:48:13 +02:00
..
arch perf symbol: Remove arch__symbols__fixup_end() 2022-05-09 09:05:09 +02:00
bench parisc: Align parisc MADV_XXX constants with all other architectures 2023-01-14 10:16:51 +01:00
Documentation
examples/bpf
include/bpf
jvmti
pmu-events perf vendor events power9: Remove UTF-8 characters from JSON files 2023-05-17 11:48:12 +02:00
python
scripts
tests perf tests: Remove bash construct from record+zstd_comp_decomp.sh 2021-11-26 10:39:13 +01:00
trace
ui perf hist: Fix memory leak of a perf_hpp_fmt 2021-12-08 09:03:20 +01:00
util perf symbols: Fix return incorrect build_id size in elf_read_build_id() 2023-05-17 11:48:13 +02:00
.gitignore
Build
builtin-annotate.c
builtin-bench.c
builtin-buildid-cache.c
builtin-buildid-list.c
builtin-c2c.c perf c2c: Fix sorting in percent_rmt_hitm_cmp() 2022-06-14 18:32:37 +02:00
builtin-config.c
builtin-data.c
builtin-diff.c
builtin-evlist.c
builtin-ftrace.c
builtin-help.c
builtin-inject.c perf inject: Fix itrace space allowed for new attributes 2021-12-17 10:14:41 +01:00
builtin-kallsyms.c
builtin-kmem.c
builtin-kvm.c
builtin-list.c
builtin-lock.c
builtin-mem.c
builtin-probe.c
builtin-record.c
builtin-report.c perf report: Set PERF_SAMPLE_DATA_SRC bit for Arm SPE event 2022-04-27 13:53:56 +02:00
builtin-sched.c perf sched: Cast PTHREAD_STACK_MIN to int as it may turn into sysconf(__SC_THREAD_STACK_MIN_VALUE) 2023-05-17 11:47:31 +02:00
builtin-script.c perf script: Fix CPU filtering of a script's switch events 2022-01-05 12:40:34 +01:00
builtin-stat.c
builtin-timechart.c
builtin-top.c
builtin-trace.c perf trace: Handle failure when trace point folder is missed 2023-01-14 10:16:02 +01:00
builtin-version.c
builtin.h
check-headers.sh x86/insn: Add a __ignore_sync_check__ marker 2022-07-25 11:26:11 +02:00
command-list.txt
CREDITS
design.txt
Makefile
Makefile.config perf python: Fix build when PYTHON_CONFIG is user supplied 2022-08-31 17:15:24 +02:00
Makefile.perf
MANIFEST
perf-archive.sh
perf-completion.sh perf tools: Fix auto-complete on aarch64 2023-03-11 16:39:40 +01:00
perf-read-vdso.c
perf-sys.h
perf-with-kcore.sh
perf.c perf tools: Fix perf's libperf_print callback 2022-04-13 21:01:07 +02:00
perf.h