]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.15-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 17 Oct 2022 05:25:23 +0000 (07:25 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 17 Oct 2022 05:25:23 +0000 (07:25 +0200)
added patches:
perf-intel-pt-fix-segfault-in-intel_pt_print_info-with-uclibc.patch

queue-5.15/perf-intel-pt-fix-segfault-in-intel_pt_print_info-with-uclibc.patch [new file with mode: 0644]
queue-5.15/series

diff --git a/queue-5.15/perf-intel-pt-fix-segfault-in-intel_pt_print_info-with-uclibc.patch b/queue-5.15/perf-intel-pt-fix-segfault-in-intel_pt_print_info-with-uclibc.patch
new file mode 100644 (file)
index 0000000..696c74c
--- /dev/null
@@ -0,0 +1,56 @@
+From 5a3d47071f0ced0431ef82a5fb6bd077ed9493db Mon Sep 17 00:00:00 2001
+From: Adrian Hunter <adrian.hunter@intel.com>
+Date: Wed, 12 Oct 2022 11:22:58 +0300
+Subject: perf intel-pt: Fix segfault in intel_pt_print_info() with uClibc
+
+From: Adrian Hunter <adrian.hunter@intel.com>
+
+commit 5a3d47071f0ced0431ef82a5fb6bd077ed9493db upstream.
+
+uClibc segfaulted because NULL was passed as the format to fprintf().
+
+That happened because one of the format strings was missing and
+intel_pt_print_info() didn't check that before calling fprintf().
+
+Add the missing format string, and check format is not NULL before calling
+fprintf().
+
+Fixes: 11fa7cb86b56d361 ("perf tools: Pass Intel PT information for decoding MTC and CYC")
+Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
+Acked-by: Namhyung Kim <namhyung@kernel.org>
+Cc: Adrian Hunter <adrian.hunter@intel.com>
+Cc: Ian Rogers <irogers@google.com>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Cc: stable@vger.kernel.org
+Link: https://lore.kernel.org/r/20221012082259.22394-2-adrian.hunter@intel.com
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ tools/perf/util/intel-pt.c |    9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+--- a/tools/perf/util/intel-pt.c
++++ b/tools/perf/util/intel-pt.c
+@@ -3591,6 +3591,7 @@ static const char * const intel_pt_info_
+       [INTEL_PT_SNAPSHOT_MODE]        = "  Snapshot mode       %"PRId64"\n",
+       [INTEL_PT_PER_CPU_MMAPS]        = "  Per-cpu maps        %"PRId64"\n",
+       [INTEL_PT_MTC_BIT]              = "  MTC bit             %#"PRIx64"\n",
++      [INTEL_PT_MTC_FREQ_BITS]        = "  MTC freq bits       %#"PRIx64"\n",
+       [INTEL_PT_TSC_CTC_N]            = "  TSC:CTC numerator   %"PRIu64"\n",
+       [INTEL_PT_TSC_CTC_D]            = "  TSC:CTC denominator %"PRIu64"\n",
+       [INTEL_PT_CYC_BIT]              = "  CYC bit             %#"PRIx64"\n",
+@@ -3605,8 +3606,12 @@ static void intel_pt_print_info(__u64 *a
+       if (!dump_trace)
+               return;
+-      for (i = start; i <= finish; i++)
+-              fprintf(stdout, intel_pt_info_fmts[i], arr[i]);
++      for (i = start; i <= finish; i++) {
++              const char *fmt = intel_pt_info_fmts[i];
++
++              if (fmt)
++                      fprintf(stdout, fmt, arr[i]);
++      }
+ }
+ static void intel_pt_print_info_str(const char *name, const char *str)
index 35e0fe0ca036a9ad76dc6c5e92392eab5f45e75f..18ccbd3b8663a90efdd9dbed3701b1fd0f80b23b 100644 (file)
@@ -354,8 +354,6 @@ mtd-rawnand-intel-remove-undocumented-compatible-str.patch
 mtd-rawnand-intel-don-t-re-define-nand_data_iface_ch.patch
 mtd-rawnand-fsl_elbc-fix-none-ecc-mode.patch
 rdma-irdma-align-ae-id-codes-to-correct-flush-code-a.patch
-rdma-irdma-remove-the-unnecessary-variable-saddr.patch
-rdma-irdma-move-union-irdma_sockaddr-to-header-file.patch
 rdma-srp-fix-srp_abort.patch
 rdma-siw-always-consume-all-skbuf-data-in-sk_data_re.patch
 rdma-siw-fix-qp-destroy-to-wait-for-all-references-d.patch
@@ -615,3 +613,4 @@ usb-idmouse-fix-an-uninit-value-in-idmouse_open.patch
 fsi-master-ast-cf-fix-missing-of_node_put-in-fsi_mas.patch
 clk-bcm2835-make-peripheral-pllc-critical.patch
 clk-bcm2835-round-uart-input-clock-up.patch
+perf-intel-pt-fix-segfault-in-intel_pt_print_info-with-uclibc.patch