perf intel-pt: Fix segfault in intel_pt_print_info() with uClibc
Adrian Hunter authored
commit 5a3d4707 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: 11fa7cb8

 ("perf tools: Pass Intel PT information for decoding MTC and CYC")
Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
Acked-by: default avatarNamhyung 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: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
b5dc2f25
Name Last commit Last update
..
accounting Merge tag 'spdx-5.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/spdx
arch x86/speculation: Add RSB VM Exit protections
bootconfig tools/bootconfig: Fix tracing_on option checking in ftrace2bconf.sh
bpf bpftool: Clear errno after libcap's checks
build tools build: Switch to new openssl API for test-libcrypto
cgroup tools/cgroup/slabinfo.py: updated to work on current kernel
debugging tools: add a kernel-chktaint to tools/debugging
edid tools/edid: Move EDID data sets from Documentation/
firewire treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156
firmware Merge tag 'driver-core-5.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
gpio tools: gpio: fix %llu warning in gpio-watch.c
hv tools: hv: change http to https in hv_kvp_daemon.c
iio iio: add IIO_MOD_O2 modifier
include tools/include/uapi: Fix <asm/errno.h> for parisc and xtensa
io_uring tools/io_uring: fix compile breakage
kvm/kvm_stat tools/kvm_stat: fix display of error when multiple processes are found
laptop change email address for Pali Rohár
leds .gitignore: add SPDX License Identifier
lib selftests/xsk: Avoid use-after-free on ctx
memory-model tools/memory-model: Expand the cheatsheet.txt notion of relaxed
objtool objtool: Preserve special st_shndx indexes in elf_update_symbol
pci tools: PCI: Add 'e' to clear IRQ
pcmcia .gitignore: add SPDX License Identifier
perf perf intel-pt: Fix segfault in intel_pt_print_info() with uClibc
power tools/power turbostat: fix ICX DRAM power numbers
scripts tools: Allow proper CC/CXX/... override with LLVM=1 in Makefile.include
spi spi: tools: Make default_tx/rx and input_tx static
testing kselftest/arm64: Fix validatation termination record after EXTRA_CONTEXT
thermal/tmon tools/thermal: Fix possible path truncations
time treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 282
usb usb: testusb: Fix for showing the connection speed
virtio tools/virtio: compile with -pthread
vm tools/vm/slabinfo: use alphabetic order when two values are equal
wmi treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500
Makefile bpf: Compile resolve_btfids tool at kernel compilation start