android_kernel_xiaomi_sm8350/tools/perf
Benjamin Peterson 82137bab80 perf trace: Avoid garbage when not printing a syscall's arguments
[ Upstream commit 1302e352b26f34991b619b5d0b621b76d20a3883 ]

syscall__scnprintf_args may not place anything in the output buffer
(e.g., because the arguments are all zero). If that happened in
trace__fprintf_sys_enter, its fprintf would receive an unitialized
buffer leading to garbage output.

Fix the problem by passing the (possibly zero) bounds of the argument
buffer to the output fprintf.

Fixes: a98392bb1e ("perf trace: Use beautifiers on syscalls:sys_enter_ handlers")
Signed-off-by: Benjamin Peterson <benjamin@engflow.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Tested-by: Howard Chu <howardchu95@gmail.com>
Cc: 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: Kan Liang <kan.liang@linux.intel.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20241107232128.108981-2-benjamin@engflow.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-12-14 19:44:32 +01:00
..
arch
bench parisc: Align parisc MADV_XXX constants with all other architectures 2023-01-18 11:42:00 +01:00
Documentation
examples/bpf
include/bpf
jvmti
lib
pmu-events perf jevents: Make build dependency on test JSONs 2023-09-23 11:00:05 +02:00
python
scripts
tests perf test uprobe_from_different_cu: Skip if there is no gcc 2023-08-11 11:53:55 +02:00
trace perf trace: Add the syscall_arg_fmt pointer to syscall_arg 2023-01-18 11:41:28 +01:00
ui perf hists browser: Fix hierarchy mode header 2023-09-23 11:00:00 +02:00
util perf probe: Correct demangled symbols in C++ program 2024-12-14 19:44:31 +01:00
.gitignore
Build
builtin-annotate.c
builtin-bench.c
builtin-buildid-cache.c
builtin-buildid-list.c
builtin-c2c.c
builtin-config.c
builtin-data.c
builtin-diff.c
builtin-evlist.c
builtin-ftrace.c
builtin-help.c
builtin-inject.c
builtin-kallsyms.c
builtin-kmem.c
builtin-kvm.c
builtin-list.c
builtin-lock.c
builtin-mem.c
builtin-probe.c
builtin-record.c perf record: Fix possible incorrect free in record__switch_output() 2024-03-26 18:22:19 -04:00
builtin-report.c
builtin-sched.c perf sched timehist: Fixed timestamp error when unable to confirm event sched_in time 2024-11-08 16:20:31 +01:00
builtin-script.c
builtin-stat.c
builtin-timechart.c
builtin-top.c perf top: Skip side-band event setup if HAVE_LIBBPF_SUPPORT is not set 2024-01-25 14:34:33 -08:00
builtin-trace.c perf trace: Avoid garbage when not printing a syscall's arguments 2024-12-14 19:44:32 +01:00
builtin-version.c
builtin.h
check-headers.sh
command-list.txt
CREDITS
design.txt
Makefile
Makefile.config perf tools: Add an option to build without libbfd 2023-09-23 11:00:05 +02:00
Makefile.perf
MANIFEST
perf-archive.sh
perf-completion.sh perf tools: Fix auto-complete on aarch64 2023-03-11 16:43:49 +01:00
perf-read-vdso.c
perf-sys.h
perf-with-kcore.sh
perf.c
perf.h