1
0
Fork 0
alistair23-linux/tools
disconnect3d a1081413e8 perf map: Fix off by one in strncpy() size argument
commit db2c549407 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 15:11:02 +02:00
..
accounting
arch x86/decoder: Add TEST opcode to Group3-2 2020-02-24 08:36:55 +01:00
bpf bpf: Print error message for bpftool cgroup show 2020-02-24 08:36:40 +01:00
build tools build: Add capability-related feature detection 2019-08-12 17:14:14 -03:00
cgroup iocost_monitor: Report debt 2019-09-10 12:31:39 -06:00
debugging
firewire treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
firmware Driver Core and debugfs changes for 5.3-rc1 2019-07-12 12:24:03 -07:00
gpio tools: gpio: Correctly add make dependencies for gpio_utils 2019-11-13 13:46:04 +01:00
hv - First round of vmbus hibernation support from Dexuan Cui. 2019-09-24 12:36:31 -07:00
iio tools: iio: add .gitignore 2019-08-18 20:45:57 +01:00
include tools lib: Fix builds when glibc contains strlcpy() 2020-02-05 21:22:40 +00:00
io_uring tools/io_uring: sync with liburing 2019-05-23 10:25:26 -06:00
kvm/kvm_stat tools/kvm_stat: Fix kvm_exit filter name 2020-02-11 04:35:36 -08:00
laptop treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 505 2019-06-19 17:11:22 +02:00
leds leds: core: Add support for composing LED class device names 2019-07-25 20:07:52 +02:00
lib tools lib api fs: Fix gcc9 stringop-truncation compilation error 2020-02-24 08:36:43 +01:00
memory-model tools/memory-model: Fix data race detection for unordered store and load 2019-12-31 16:43:40 +01:00
nfsd
objtool objtool: Fix ARCH=x86_64 build error 2020-02-24 08:36:55 +01:00
pci tools: PCI: Fix fd leakage 2020-01-17 19:48:54 +01:00
pcmcia treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 247 2019-06-19 17:09:08 +02:00
perf perf map: Fix off by one in strncpy() size argument 2020-04-02 15:11:02 +02:00
power cpupower: avoid multiple definition with gcc -fno-common 2020-04-01 11:01:51 +02:00
scripts tools: Let O= makes handle a relative path with -C option 2020-04-01 11:02:00 +02:00
spi treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 178 2019-05-30 11:29:19 -07:00
testing selftests/rseq: Fix out-of-tree compilation 2020-03-21 08:11:49 +01:00
thermal/tmon treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 89 2019-05-24 17:37:52 +02:00
time treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 282 2019-06-05 17:36:37 +02:00
usb usbip: Fix unsafe unaligned pointer usage 2020-02-24 08:36:44 +01:00
virtio tools/virtio: xen stub 2019-10-13 09:38:27 -04:00
vm tools/vm/slabinfo: add sorting info to help menu 2019-07-12 11:05:46 -07:00
wmi treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
Makefile tools: Keep list of tools in alphabetical order 2019-08-14 10:59:59 -03:00