summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/symbol-elf.c
diff options
context:
space:
mode:
authorRiccardo Mancini <rickyman7@gmail.com>2021-07-05 18:15:25 +0200
committerArnaldo Carvalho de Melo <acme@redhat.com>2021-07-07 15:28:10 +0200
commit5a4451e4d562d5c3d24e6ff75c75a29832f273f6 (patch)
tree152715fd3e9922ad79bda50b894e55864212b8ed /tools/perf/util/symbol-elf.c
parentperf probe: Do not show @plt function by default (diff)
downloadlinux-5a4451e4d562d5c3d24e6ff75c75a29832f273f6.tar.xz
linux-5a4451e4d562d5c3d24e6ff75c75a29832f273f6.zip
perf annotate: Fix 's' on source line when disasm is empty
If the disasm is empty, 's' should fail. Instead it seemingly works, hiding the empty lines and causing an assertion error on the next time annotate is called (from within perf report). The problem is caused by a buffer overflow, caused by a wrong exit condition in annotate_browser__find_next_asm_line, which checks browser->b.top instead of browser->b.entries. This patch fixes the issue, making annotate_browser__toggle_source fail if the disasm is empty (nothing happens to the user). Fixes: 6de249d66d2e7881 ("perf annotate: Allow 's' on source code lines") Signed-off-by: Riccardo Mancini <rickyman7@gmail.com> Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Ian Rogers <irogers@google.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Martin Liška <mliska@suse.cz> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lore.kernel.org/lkml/20210705161524.72953-1-rickyman7@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/symbol-elf.c')
0 files changed, 0 insertions, 0 deletions