exynos-linux-stable/tools/perf
disconnect3d 6d5fd9db8c 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: eca8183699 ("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-02 17:20:41 +02:00
..
arch perf record: Fix module size on s390 2019-08-25 10:51:21 +02:00
bench perf bench numa: Fix cpu0 binding 2019-09-06 10:19:33 +02:00
Documentation perf config: Fix an error in the config template documentation 2019-04-20 09:07:48 +02:00
jvmti perf jit: Fix build issue on Ubuntu 2016-10-17 11:25:34 -03:00
pmu-events perf jevents: Fix period for Intel fixed counters 2019-11-06 12:18:06 +01:00
python perf python: Add tracepoint example 2016-07-12 16:23:35 -03:00
scripts perf script python: Fix export-to-postgresql.py occasional failure 2018-10-18 09:13:21 +02:00
tests perf test: Report failure for mmap events 2020-01-04 13:39:23 +01:00
trace perf trace: Check if MAP_32BIT is defined (again) 2017-01-26 08:24:36 +01:00
ui perf hists browser: Restore ESC as "Zoom out" of DSO/thread/etc 2020-03-11 07:53:08 +01:00
util perf map: Fix off by one in strncpy() size argument 2020-04-02 17:20:41 +02:00
.gitignore perf tools: Add arch/*/include/generated/ to .gitignore 2016-05-30 12:41:46 -03:00
Build perf tools: Set and pass DOCDIR to builtin-report.c 2016-01-12 12:42:07 -03:00
builtin-annotate.c perf annotate: Add branch stack / basic block 2016-09-08 13:44:03 -03:00
builtin-bench.c perf subcmd: Create subcmd library 2015-12-17 14:27:14 -03:00
builtin-buildid-cache.c tools: Introduce str_error_r() 2016-07-12 15:19:47 -03:00
builtin-buildid-list.c perf subcmd: Create subcmd library 2015-12-17 14:27:14 -03:00
builtin-config.c perf config: Reimplement show_config() using config_set__for_each 2016-06-23 17:23:00 -03:00
builtin-data.c perf data ctf: Add '--all' option for 'perf data convert' 2016-06-28 10:54:57 -03:00
builtin-diff.c perf diff: Fix -o/--order option behavior (again) 2017-02-14 15:25:42 -08:00
builtin-evlist.c perf evlist: Rename for_each() macros to for_each_entry() 2016-06-23 11:26:15 -03:00
builtin-help.c perf help: Remove needless use of strncpy() 2019-07-10 09:55:36 +02:00
builtin-inject.c perf symbols: Remove symbol_filter_t machinery 2016-09-05 11:14:50 -03:00
builtin-kmem.c perf kmem: Fix memory leak in compact_gfp_flags() 2019-11-10 11:23:16 +01:00
builtin-kvm.c perf kvm: Use NSEC_PER_USEC 2016-08-23 15:37:33 -03:00
builtin-list.c perf list: Support long jevents descriptions 2016-10-03 21:35:47 -03:00
builtin-lock.c perf subcmd: Create subcmd library 2015-12-17 14:27:14 -03:00
builtin-mem.c perf mem: Fix --all-user/--all-kernel options 2017-01-26 08:24:35 +01:00
builtin-probe.c perf probe: Avoid calling freeing routine multiple times for same pointer 2019-08-25 10:51:29 +02:00
builtin-record.c perf record: Add support for using symbols in address filters 2016-09-29 11:17:02 -03:00
builtin-report.c perf report: Fix incorrectly added dimensions as switch perf data file 2020-01-23 08:19:40 +01:00
builtin-sched.c perf sched: Use linux/time64.h 2016-08-23 15:37:33 -03:00
builtin-script.c perf symbols: Remove symbol_filter_t machinery 2016-09-05 11:14:50 -03:00
builtin-stat.c perf stat: Reset previous counts on repeat with interval 2019-10-17 13:42:17 -07:00
builtin-timechart.c perf timechart: Use NSEC_PER_U?SEC 2016-08-23 15:37:33 -03:00
builtin-top.c perf top: Fix error handling in cmd_top() 2019-04-20 09:07:49 +02:00
builtin-trace.c perf trace: Add mmap alias for s390 2018-04-13 19:48:17 +02:00
builtin-version.c
builtin.h perf tools: Remove needless 'extern' from function prototypes 2016-03-23 15:06:35 -03:00
check-headers.sh tools include: Adopt linux/bits.h 2019-05-31 06:48:13 -07:00
command-list.txt perf tools: Do not show trace command if it's not compiled in 2016-01-08 12:46:17 -03:00
CREDITS
design.txt
Makefile tools: Let O= makes handle a relative path with -C option 2020-04-02 17:20:36 +02:00
Makefile.config perf tools: Fix build with ARCH=x86_64 2018-01-23 19:57:07 +01:00
Makefile.perf perf tools: Move headers check into bash script 2018-06-05 10:28:56 +02:00
MANIFEST tools include: Introduce linux/bug.h, from the kernel sources 2018-06-05 10:28:56 +02:00
perf-archive.sh
perf-completion.sh
perf-read-vdso.c
perf-sys.h perf powerpc: Fix build-test failure 2016-09-08 13:44:07 -03:00
perf-with-kcore.sh
perf.c perf tools: Just pr_debug() about not being able to read cacheline_size 2016-07-15 10:08:29 -03:00
perf.h perf tools: Increase MAX_NR_CPUS and MAX_CACHES 2019-08-04 09:33:22 +02:00