android_kernel_samsung_a7y1.../tools/perf/util
disconnect3d a9c51ea1dd perf map: Fix off by one in strncpy() size argument
commit db2c549407d4a76563c579e4768f7d6d32afefba upstream.

This patch fixes an off-by-one error in strncpy size argument in
tools/perf/util/map.c. The issue is that in:

        strncmp(filename, "/system/lib/", 11)

the passed string literal: "/system/lib/" has 12 bytes (without the NULL
byte) and the passed size argument is 11. As a result, the logic won't
match the ending "/" byte and will pass filepaths that are stored in
other directories e.g. "/system/libmalicious/bin" or just
"/system/libmalicious".

This functionality seems to be present only on Android. I assume the
/system/ directory is only writable by the root user, so I don't think
this bug has much (or any) security impact.

Fixes: eca818369996 ("perf tools: Add automatic remapping of Android libraries")
Signed-off-by: disconnect3d <dominik.b.czarnota@gmail.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Changbin Du <changbin.du@intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: John Keeping <john@metanate.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Michael Lentine <mlentine@google.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Song Liu <songliubraving@fb.com>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lore.kernel.org/lkml/20200309104855.3775-1-dominik.b.czarnota@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-07 14:25:24 +02:00
..
include
intel-pt-decoder x86/insn: Fix awk regexp warnings 2020-04-07 12:37:06 +02:00
scripting-engines
abspath.c
alias.c
annotate.c
annotate.h
auxtrace.c
auxtrace.h
bitmap.c
bpf-loader.c
bpf-loader.h
Build
build-id.c
build-id.h
cache.h
callchain.c
callchain.h
cgroup.c
cgroup.h
cloexec.c
cloexec.h
color.c
color.h
comm.c
comm.h
config.c
counts.c
counts.h
cpumap.c
cpumap.h
ctype.c
data-convert-bt.c
data-convert-bt.h
data.c
data.h
db-export.c
db-export.h
debug.c
debug.h
dso.c
dso.h
dwarf-aux.c perf probe: Fix to show function entry line as probe-able 2020-04-07 13:22:37 +02:00
dwarf-aux.h perf probe: Fix to show function entry line as probe-able 2020-04-07 13:22:37 +02:00
env.c
env.h
environment.c
event.c
event.h
evlist.c
evlist.h
evsel.c perf evsel: Make perf_evsel__name() accept a NULL argument 2020-04-06 19:55:01 +02:00
evsel.h
exec_cmd.c
exec_cmd.h
find-vdso-map.c
generate-cmdlist.sh
header.c perf header: Fix use of unitialized value warning 2020-04-06 20:48:56 +02:00
header.h
help.c
help.h
hist.c perf tools: Fix time sorting 2020-04-07 11:48:37 +02:00
hist.h
intel-bts.c
intel-bts.h
intel-pt.c
intel-pt.h
intlist.c
intlist.h
kvm-stat.h
levenshtein.c
levenshtein.h
llvm-utils.c perf llvm: Don't access out-of-scope array 2020-04-07 08:09:48 +02:00
llvm-utils.h
lzma.c
machine.c
machine.h
map.c perf map: Fix off by one in strncpy() size argument 2020-04-07 14:25:24 +02:00
map.h
ordered-events.c
ordered-events.h
pager.c
parse-branch-options.c
parse-branch-options.h
parse-events.c
parse-events.h
parse-events.l
parse-events.y
parse-options.c
parse-options.h
parse-regs-options.c
parse-regs-options.h
path.c
perf_regs.c
perf_regs.h perf regs: Make perf_reg_name() return "unknown" instead of NULL 2020-04-07 13:23:37 +02:00
PERF-VERSION-GEN
pmu.c
pmu.h
pmu.l
pmu.y
probe-event.c
probe-event.h
probe-file.c
probe-file.h
probe-finder.c perf probe: Do not depend on dwfl_module_addrsym() 2020-04-07 14:24:09 +02:00
probe-finder.h
pstack.c
pstack.h
python-ext-sources
python.c
quote.c
quote.h
rblist.c
rblist.h
record.c
run-command.c
run-command.h
session.c
session.h
setup.py
sigchain.c
sigchain.h
sort.c
sort.h
srcline.c
stat-shadow.c
stat.c
stat.h
strbuf.c
strbuf.h
strfilter.c
strfilter.h
string.c perf tools: No need to include bitops.h in util.h 2020-04-06 18:15:24 +02:00
strlist.c
strlist.h
svghelper.c
svghelper.h
symbol-elf.c
symbol-minimal.c
symbol.c
symbol.h
target.c
target.h
thread_map.c
thread_map.h
thread-stack.c
thread-stack.h
thread.c perf db-export: Fix thread__exec_comm() 2020-04-06 20:38:26 +02:00
thread.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
tsc.c
tsc.h
unwind-libdw.c
unwind-libdw.h
unwind-libunwind.c
unwind.h
usage.c
util.c
util.h perf tools: No need to include bitops.h in util.h 2020-04-06 18:15:24 +02:00
values.c
values.h
vdso.c
vdso.h
wrapper.c
xyarray.c
xyarray.h
zlib.c