]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.19-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 25 Nov 2020 11:48:56 +0000 (12:48 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 25 Nov 2020 11:48:56 +0000 (12:48 +0100)
added patches:
perf-event-check-ref_reloc_sym-before-using-it.patch

queue-4.19/perf-event-check-ref_reloc_sym-before-using-it.patch [new file with mode: 0644]
queue-4.19/series

diff --git a/queue-4.19/perf-event-check-ref_reloc_sym-before-using-it.patch b/queue-4.19/perf-event-check-ref_reloc_sym-before-using-it.patch
new file mode 100644 (file)
index 0000000..36c6889
--- /dev/null
@@ -0,0 +1,58 @@
+From e9a6882f267a8105461066e3ea6b4b6b9be1b807 Mon Sep 17 00:00:00 2001
+From: Igor Lubashev <ilubashe@akamai.com>
+Date: Mon, 26 Aug 2019 21:39:12 -0400
+Subject: perf event: Check ref_reloc_sym before using it
+
+From: Igor Lubashev <ilubashe@akamai.com>
+
+commit e9a6882f267a8105461066e3ea6b4b6b9be1b807 upstream.
+
+Check for ref_reloc_sym before using it instead of checking
+symbol_conf.kptr_restrict and relying solely on that check.
+
+Reported-by: Mathieu Poirier <mathieu.poirier@linaro.org>
+Signed-off-by: Igor Lubashev <ilubashe@akamai.com>
+Tested-by: Mathieu Poirier <mathieu.poirier@linaro.org>
+Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
+Cc: Alexey Budankov <alexey.budankov@linux.intel.com>
+Cc: James Morris <jmorris@namei.org>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: Namhyung Kim <namhyung@kernel.org>
+Cc: Peter Zijlstra <peterz@infradead.org>
+Cc: Suzuki Poulouse <suzuki.poulose@arm.com>
+Cc: linux-arm-kernel@lists.infradead.org
+Link: http://lkml.kernel.org/r/1566869956-7154-2-git-send-email-ilubashe@akamai.com
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+Cc: Alexander Dahl <ada@thorsis.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ tools/perf/util/event.c |    7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+--- a/tools/perf/util/event.c
++++ b/tools/perf/util/event.c
+@@ -912,11 +912,13 @@ static int __perf_event__synthesize_kern
+       int err;
+       union perf_event *event;
+-      if (symbol_conf.kptr_restrict)
+-              return -1;
+       if (map == NULL)
+               return -1;
++      kmap = map__kmap(map);
++      if (!kmap->ref_reloc_sym)
++              return -1;
++
+       /*
+        * We should get this from /sys/kernel/sections/.text, but till that is
+        * available use this, and after it is use this as a fallback for older
+@@ -939,7 +941,6 @@ static int __perf_event__synthesize_kern
+               event->header.misc = PERF_RECORD_MISC_GUEST_KERNEL;
+       }
+-      kmap = map__kmap(map);
+       size = snprintf(event->mmap.filename, sizeof(event->mmap.filename),
+                       "%s%s", machine->mmap_name, kmap->ref_reloc_sym->name) + 1;
+       size = PERF_ALIGN(size, sizeof(u64));
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..3cad090402b45cf0b778624c75ee2c13045c0ebd 100644 (file)
@@ -0,0 +1 @@
+perf-event-check-ref_reloc_sym-before-using-it.patch