]> git.baikalelectronics.ru Git - kernel.git/commit
perf intel-pt: Fix segfault in intel_pt_print_info() with uClibc
authorAdrian Hunter <adrian.hunter@intel.com>
Wed, 12 Oct 2022 08:22:58 +0000 (11:22 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Oct 2022 11:22:59 +0000 (13:22 +0200)
commit5bbd5774f3967744da8606fe26efc7f670222f14
tree4796f926510d8c153a63482b6f8e9a07024b3e7b
parent183aa392a994b8d2b5ec1866ea0e07732eb20d5c
perf intel-pt: Fix segfault in intel_pt_print_info() with uClibc

commit 727f9787b94331622ac9d7ab21a04497128acca8 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: bec9cb35e4ade7b8 ("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