android_kernel_sony_sdm845/tools/perf/tests
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Namhyung Kim f5d476c628 perf test: Fix unaligned access in sample parsing test
[ Upstream commit c5c97cadd7ed13381cb6b4bef5c841a66938d350 ]

The ubsan reported the following error.  It was because sample's raw
data missed u32 padding at the end.  So it broke the alignment of the
array after it.

The raw data contains an u32 size prefix so the data size should have
an u32 padding after 8-byte aligned data.

27: Sample parsing  :util/synthetic-events.c:1539:4:
  runtime error: store to misaligned address 0x62100006b9bc for type
  '__u64' (aka 'unsigned long long'), which requires 8 byte alignment
0x62100006b9bc: note: pointer points here
  00 00 00 00 ff ff ff ff  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff
              ^
    #0 0x561532a9fc96 in perf_event__synthesize_sample util/synthetic-events.c:1539:13
    #1 0x5615327f4a4f in do_test tests/sample-parsing.c:284:8
    #2 0x5615327f3f50 in test__sample_parsing tests/sample-parsing.c:381:9
    #3 0x56153279d3a1 in run_test tests/builtin-test.c:424:9
    #4 0x56153279c836 in test_and_print tests/builtin-test.c:454:9
    #5 0x56153279b7eb in __cmd_test tests/builtin-test.c:675:4
    #6 0x56153279abf0 in cmd_test tests/builtin-test.c:821:9
    #7 0x56153264e796 in run_builtin perf.c:312:11
    #8 0x56153264cf03 in handle_internal_command perf.c:364:8
    #9 0x56153264e47d in run_argv perf.c:408:2
    #10 0x56153264c9a9 in main perf.c:538:3
    #11 0x7f137ab6fbbc in __libc_start_main (/lib64/libc.so.6+0x38bbc)
    #12 0x561532596828 in _start ...

SUMMARY: UndefinedBehaviorSanitizer: misaligned-pointer-use
 util/synthetic-events.c:1539:4 in

Fixes: 045f8cd854 ("perf tests: Add a sample parsing test")
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: https://lore.kernel.org/r/20210214091638.519643-1-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-03-03 17:44:39 +01:00
..
attr
.gitignore
attr.c perf tools: Fix snprint warnings for gcc 8 2020-07-31 16:44:07 +02:00
attr.py
backward-ring-buffer.c
bitmap.c
bp_signal.c
bp_signal_overflow.c
bpf-script-example.c
bpf-script-test-kbuild.c
bpf-script-test-prologue.c
bpf-script-test-relocation.c
bpf.c
Build perf tools: Fix build with ARCH=x86_64 2018-01-23 19:57:07 +01:00
builtin-test.c perf tests: Fix indexing when invoking subtests 2018-11-10 07:42:56 -08:00
code-reading.c Revert "perf tests: Decompress kernel module before objdump" 2018-04-20 08:21:06 +02:00
cpumap.c
dso-data.c
dwarf-unwind.c perf tests: Add dwarf unwind test for powerpc 2016-09-29 11:18:21 -03:00
event-times.c
event_update.c
evsel-roundtrip-name.c
evsel-tp-sched.c perf tests: Fix a memory leak in test__perf_evsel__tp_sched_test() 2019-04-20 09:07:49 +02:00
fdarray.c
hists_common.c
hists_common.h
hists_cumulate.c
hists_filter.c
hists_link.c
hists_output.c
is_printable_array.c
keep-tracking.c
kmod-path.c perf tests kmod-path: Don't fail if compressed modules aren't supported 2018-03-24 11:00:22 +01:00
llvm.c
llvm.h
make
mmap-basic.c
mmap-thread-lookup.c perf test mmap-thread-lookup: Initialize variable to suppress memory sanitizer warning 2019-08-04 09:33:40 +02:00
openat-syscall-all-cpus.c perf tests: Fix a memory leak of cpu_map object in the openat_syscall_event_on_all_cpus test 2019-04-20 09:07:49 +02:00
openat-syscall-tp-fields.c
openat-syscall.c
parse-events.c Revert "perf test 6: Fix missing kvm module load for s390" 2019-09-06 10:19:40 +02:00
parse-no-sample-id-all.c
perf-record.c
perf-targz-src-pkg
pmu.c perf test: Free formats for perf pmu parse test 2020-09-23 08:46:15 +02:00
python-use.c
sample-parsing.c perf test: Fix unaligned access in sample parsing test 2021-03-03 17:44:39 +01:00
sdt.c
stat.c
sw-clock.c
switch-tracking.c
task-exit.c perf test: Report failure for mmap events 2020-01-04 13:39:23 +01:00
tests.h
thread-map.c
thread-mg-share.c
topology.c perf test session topology: Fix test on s390 2018-08-24 13:12:32 +02:00
vmlinux-kallsyms.c perf tests: Use arch__compare_symbol_names to compare symbols 2018-05-30 07:50:50 +02:00