android_kernel_samsung_a7y1.../tools/perf
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
..
arch
bench perf bench numa: Fix cpu0 binding 2020-04-06 20:53:08 +02:00
config
Documentation
python
scripts
tests Revert "perf test 6: Fix missing kvm module load for s390" 2020-04-06 21:32:51 +02:00
trace/strace/groups
ui perf ui helpline: Use strlcpy() as a shorter form of strncpy() + explicit set nul 2020-04-06 19:17:02 +02:00
util perf map: Fix off by one in strncpy() size argument 2020-04-07 14:25:24 +02:00
Build
builtin-annotate.c
builtin-bench.c
builtin-buildid-cache.c
builtin-buildid-list.c
builtin-data.c
builtin-diff.c
builtin-evlist.c
builtin-help.c perf help: Remove needless use of strncpy() 2020-04-06 19:17:04 +02:00
builtin-inject.c
builtin-kmem.c perf kmem: Fix memory leak in compact_gfp_flags() 2020-04-07 09:29:05 +02:00
builtin-kvm.c
builtin-list.c
builtin-lock.c
builtin-mem.c
builtin-probe.c perf probe: Avoid calling freeing routine multiple times for same pointer 2020-04-06 20:39:06 +02:00
builtin-record.c
builtin-report.c Revert "perf report: Add warning when libunwind not compiled in" 2020-04-07 13:24:34 +02:00
builtin-sched.c
builtin-script.c
builtin-stat.c perf stat: Fix a segmentation fault when using repeat forever 2020-04-07 08:08:14 +02:00
builtin-timechart.c
builtin-top.c
builtin-trace.c
builtin.h
command-list.txt
CREDITS
design.txt
Makefile tools: Let O= makes handle a relative path with -C option 2020-04-07 14:24:33 +02:00
Makefile.perf
MANIFEST
perf-archive.sh
perf-completion.sh
perf-read-vdso.c
perf-sys.h
perf-with-kcore.sh
perf.c
perf.h