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 A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
bench perf bench numa: Fix cpu0 binding 2020-04-06 20:53:08 +02:00
config A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Documentation A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
python A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
scripts A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
tests Revert "perf test 6: Fix missing kvm module load for s390" 2020-04-06 21:32:51 +02:00
trace/strace/groups A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
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 A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
builtin-annotate.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
builtin-bench.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
builtin-buildid-cache.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
builtin-buildid-list.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
builtin-data.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
builtin-diff.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
builtin-evlist.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
builtin-help.c perf help: Remove needless use of strncpy() 2020-04-06 19:17:04 +02:00
builtin-inject.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
builtin-kmem.c perf kmem: Fix memory leak in compact_gfp_flags() 2020-04-07 09:29:05 +02:00
builtin-kvm.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
builtin-list.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
builtin-lock.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
builtin-mem.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
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 A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
builtin-report.c Revert "perf report: Add warning when libunwind not compiled in" 2020-04-07 13:24:34 +02:00
builtin-sched.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
builtin-script.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
builtin-stat.c perf stat: Fix a segmentation fault when using repeat forever 2020-04-07 08:08:14 +02:00
builtin-timechart.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
builtin-top.c perf top: Fix error handling in cmd_top() 2020-04-06 15:17:13 +02:00
builtin-trace.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
builtin.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
command-list.txt A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
CREDITS A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
design.txt A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Makefile tools: Let O= makes handle a relative path with -C option 2020-04-07 14:24:33 +02:00
Makefile.perf A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
MANIFEST A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
perf-archive.sh A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
perf-completion.sh A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
perf-read-vdso.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
perf-sys.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
perf-with-kcore.sh A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
perf.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
perf.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30