kernel-fxtec-pro1x/tools/perf/util
Guenter Roeck 3ab5872df9 tools: perf: Fix build error in v4.19.y
perf may fail to build in v4.19.y with the following error.

util/evsel.c: In function ‘perf_evsel__exit’:
util/util.h:25:28: error:
	passing argument 1 of ‘free’ discards ‘const’ qualifier from pointer target type

This is observed (at least) with gcc v6.5.0. The underlying problem is
the following statement.
	zfree(&evsel->pmu_name);
evsel->pmu_name is decared 'const *'. zfree in turn is defined as
	#define zfree(ptr) ({ free(*ptr); *ptr = NULL; })
and thus passes the const * to free(). The problem is not seen
in the upstream kernel since zfree() has been rewritten there.

The problem has been introduced into v4.19.y with the backport of upstream
commit d4953f7ef1a2 (perf parse-events: Fix 3 use after frees found with
clang ASAN).

One possible fix of this problem would be to not declare pmu_name
as const. This patch chooses to typecast the parameter of zfree()
to void *, following the guidance from the upstream kernel which
does the same since commit 7f7c536f23e6a ("tools lib: Adopt
zalloc()/zfree() from tools/perf")

Fixes: a0100a3630 ("perf parse-events: Fix 3 use after frees found with clang ASAN")
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-10 12:36:02 +01:00
..
c++
cs-etm-decoder
include
intel-pt-decoder perf intel-pt: Fix FUP packet state 2020-08-21 11:05:34 +02:00
libunwind
scripting-engines perf script python: Add trace_context extension module to sys.modules 2019-04-05 22:33:14 +02:00
annotate.c perf annotate: Return appropriate error code for allocation failures 2019-11-06 13:05:44 +01:00
annotate.h
arm-spe-pkt-decoder.c
arm-spe-pkt-decoder.h
arm-spe.c
arm-spe.h
auxtrace.c perf auxtrace: Define auxtrace record alignment 2019-03-23 20:10:11 +01:00
auxtrace.h perf auxtrace: Define auxtrace record alignment 2019-03-23 20:10:11 +01:00
block-range.c
block-range.h
bpf-loader.c
bpf-loader.h
bpf-prologue.c
bpf-prologue.h
branch.c
branch.h
Build
build-id.c perf build-id: Fix memory leak in print_sdt_events() 2019-04-20 09:15:57 +02:00
build-id.h
cache.h
call-path.c
call-path.h
callchain.c
callchain.h
cgroup.c
cgroup.h
cloexec.c
cloexec.h
color.c
color.h
comm.c
comm.h
compress.h
config.c perf config: Fix a memory leak in collect_config() 2019-04-20 09:15:57 +02:00
config.h
counts.c
counts.h
cpumap.c perf cpumap: Fix snprintf overflow check 2020-10-01 13:14:39 +02:00
cpumap.h
cs-etm.c perf cs-etm: Move definition of 'traceid_list' global variable from header file 2020-10-17 10:12:56 +02:00
cs-etm.h perf cs-etm: Move definition of 'traceid_list' global variable from header file 2020-10-17 10:12:56 +02:00
ctype.c
data-convert-bt.c perf data: Fix 'strncat may truncate' build failure with recent gcc 2019-06-22 08:15:18 +02:00
data-convert-bt.h
data-convert.h
data.c
data.h
db-export.c
db-export.h
debug.c
debug.h
demangle-java.c
demangle-java.h
demangle-rust.c
demangle-rust.h
drv_configs.c
drv_configs.h
dso.c perf symbols: Fix debuginfo search for Ubuntu 2020-06-22 09:05:30 +02:00
dso.h perf symbols: Fix debuginfo search for Ubuntu 2020-06-22 09:05:30 +02:00
dump-insn.c
dump-insn.h
dwarf-aux.c perf probe: Fix to show function entry line as probe-able 2019-12-31 16:36:37 +01:00
dwarf-aux.h perf probe: Fix to show function entry line as probe-able 2019-12-31 16:36:37 +01:00
dwarf-regs.c
env.c
env.h
event.c
event.h
evlist.c
evlist.h
evsel.c perf evsel: Fix 2 memory leaks 2020-10-01 13:14:46 +02:00
evsel.h
evsel_fprintf.c
expr.h
expr.y
find-vdso-map.c
genelf.c
genelf.h
genelf_debug.c
generate-cmdlist.sh
group.h
header.c perf tools: Fix segfault in cpu_cache_level__read() 2019-10-11 18:21:28 +02:00
header.h
help-unknown-cmd.c
help-unknown-cmd.h
hist.c perf tools: Fix time sorting 2019-11-12 19:20:37 +01:00
hist.h perf hists: Fix variable name's inconsistency in hists__for_each() macro 2020-01-23 08:21:30 +01:00
intel-bts.c
intel-bts.h
intel-pt.c perf intel-pt: Fix "context_switch event has no tid" error 2020-10-30 10:38:19 +01:00
intel-pt.h
intlist.c
intlist.h
jit.h
jitdump.c perf inject jit: Fix JIT_CODE_MOVE filename 2019-10-17 13:45:15 -07:00
jitdump.h
kvm-stat.h
levenshtein.c
levenshtein.h
llvm-utils.c perf llvm: Don't access out-of-scope array 2019-10-17 13:45:14 -07:00
llvm-utils.h
lzma.c
machine.c perf map: No need to adjust the long name of modules 2020-01-27 14:49:53 +01:00
machine.h perf record: Fix module size on s390 2019-08-16 10:12:41 +02:00
map.c perf map: Fix off by one in strncpy() size argument 2020-04-02 15:28:24 +02:00
map.h
mem-events.c
mem-events.h
mem2node.c perf mem2node: Avoid double free related to realloc 2020-10-01 13:14:43 +02:00
mem2node.h
memswap.c
memswap.h
metricgroup.c perf metricgroup: Free metric_events on error 2020-10-01 13:14:46 +02:00
metricgroup.h
mmap.c
mmap.h
namespaces.c
namespaces.h
ordered-events.c
ordered-events.h
parse-branch-options.c
parse-branch-options.h
parse-events.c perf parse-events: Use strcmp() to compare the PMU name 2020-10-01 13:14:49 +02:00
parse-events.h
parse-events.l
parse-events.y
parse-regs-options.c
parse-regs-options.h
path.c
path.h
perf-hooks-list.h
perf-hooks.c
perf-hooks.h
PERF-VERSION-GEN
perf_regs.c
perf_regs.h perf regs: Make perf_reg_name() return "unknown" instead of NULL 2020-01-04 19:13:14 +01:00
pmu.c perf test: Free formats for perf pmu parse test 2020-09-23 12:11:00 +02:00
pmu.h perf test: Free formats for perf pmu parse test 2020-09-23 12:11:00 +02:00
pmu.l
pmu.y
print_binary.c perf python scripting: Fix printable strings in python3 scripts 2020-11-05 11:08:52 +01:00
print_binary.h
probe-event.c perf probe: Check address correctness by map instead of _etext 2020-06-22 09:05:30 +02:00
probe-event.h
probe-file.c
probe-file.h
probe-finder.c perf probe: Fix memory leakage when the probe point is not found 2020-08-26 10:30:58 +02:00
probe-finder.h
pstack.c
pstack.h
python-ext-sources
python.c
rb_resort.h
rblist.c
rblist.h
record.c
rwsem.c
rwsem.h
s390-cpumsf-kernel.h
s390-cpumsf.c perf report: Add s390 diagnosic sampling descriptor size 2019-04-05 22:33:07 +02:00
s390-cpumsf.h
sane_ctype.h
session.c perf session: Fix potential NULL pointer dereference found by the smatch tool 2019-07-31 07:27:06 +02:00
session.h
setns.c
setup.py
smt.c
smt.h
sort.c perf util: Fix memory leak of prefix_if_not_in 2020-10-01 13:14:46 +02:00
sort.h
srcline.c perf: Make perf able to build with latest libbfd 2020-07-22 09:31:58 +02:00
srcline.h
stat-shadow.c perf stat: Fix shadow stats for clock events 2020-03-05 16:42:22 +01:00
stat.c perf stat: Zero all the 'ena' and 'run' array slot stats for interval mode 2020-07-22 09:32:06 +02:00
stat.h perf stat: Reset previous counts on repeat with interval 2019-10-11 18:21:29 +02:00
strbuf.c perf strbuf: Remove redundant va_end() in strbuf_addv() 2020-01-04 19:13:24 +01:00
strbuf.h
strfilter.c
strfilter.h
string.c
string2.h
strlist.c
strlist.h
svghelper.c
svghelper.h
symbol-elf.c perf kcore_copy: Fix module map when there are no modules loaded 2020-10-01 13:14:47 +02:00
symbol-minimal.c
symbol.c perf symbols: Fix debuginfo search for Ubuntu 2020-06-22 09:05:30 +02:00
symbol.h perf annotate: Fix s390 gap between kernel end and module start 2019-08-16 10:12:41 +02:00
symbol_fprintf.c
syscalltbl.c
syscalltbl.h
target.c
target.h
term.c
term.h
thread-stack.c
thread-stack.h
thread.c perf db-export: Fix thread__exec_comm() 2019-08-16 10:12:41 +02:00
thread.h
thread_map.c
thread_map.h
time-utils.c
time-utils.h
tool.h
top.c
top.h
trace-event-info.c
trace-event-parse.c
trace-event-read.c
trace-event-scripting.c
trace-event.c
trace-event.h
trigger.h
tsc.c
tsc.h
units.c
units.h
unwind-libdw.c
unwind-libdw.h
unwind-libunwind-local.c
unwind-libunwind.c
unwind.h
usage.c
util-cxx.h
util.c
util.h tools: perf: Fix build error in v4.19.y 2020-11-10 12:36:02 +01:00
values.c
values.h
vdso.c
vdso.h
xyarray.c
xyarray.h libperf: Fix alignment trap with xyarray contents in 'perf stat' 2019-10-05 13:09:47 +02:00
zlib.c