linux/tools
Hui Su bac027175a perf synthetic-events: Check schedstat domain allocation failure
__synthesize_schedstat_domain() uses event after zalloc() without
checking for allocation failure, unlike __synthesize_schedstat_cpu().

If zalloc() fails and returns NULL, dereferencing ds->header.type
immediately crashes with a segmentation fault:

  Program received signal SIGSEGV, Segmentation fault.
  0x00005555558aed8a in __synthesize_schedstat_domain ()
  #0  0x00005555558aed8a in __synthesize_schedstat_domain ()
  #1  0x00005555558b889a in perf_event__synthesize_schedstat ()
  #2  0x000055555563c397 in cmd_sched ()
  #3  0x00005555556583a1 in handle_internal_command ()
  #4  0x00005555555bf739 in main ()

perf_event__synthesize_schedstat() already treats a NULL event as an
error and cleans up, so return NULL when the allocation fails.

After this fix, an allocation failure returns NULL safely, allowing the
caller to exit gracefully without crashing:

  [ perf sched stats: Failed !! ]

Fixes: c3030995f2 ("perf sched stats: Add record and rawdump support")
Signed-off-by: Hui Su <sh_def@163.com>
Cc: Swapnil Sapkal <swapnil.sapkal@amd.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2026-09-26 20:29:40 +02:00
..
accounting tools/accounting: fix macro typos in getdelays 2026-08-03 21:10:17 -07:00
arch perf headers: Sync perf_event.h/perf_regs.h with the kernel headers 2026-09-14 15:32:52 -03:00
bootconfig Bootconfig updates for v7.3: 2026-08-25 08:59:09 -07:00
bpf perf tools updates for v7.3 2026-08-22 08:47:50 -07:00
build perf dwarf-aux: Add die_same_file() and die_get_type_die() 2026-09-25 18:13:25 +02:00
certs
cgroup
counter
crypto
debugging
dma
docs doc tools: fix 'path' typos 2026-08-11 10:43:16 -06:00
firewire
firmware
gpio
hv
iio iio: types: add IIO_VOLUMEFLOW channel type 2026-08-05 00:02:55 +01:00
include tools include: Add missing stdarg.h include 2026-09-25 15:04:50 +02:00
kvm/kvm_stat
laptop
leds
lib perf evlist: Don't restrict uncore events to PMU CPUs 2026-09-25 15:29:56 +02:00
memory-model
mm mm.git review status for master..mm-nonmm-stable 2026-08-23 08:07:11 -07:00
net Including fixes from Bluetooth, IPSec and Netfilter. 2026-08-27 13:53:43 -07:00
objtool Rust fixes for v7.3 2026-08-30 09:47:39 -07:00
pcmcia
perf perf synthetic-events: Check schedstat domain allocation failure 2026-09-26 20:29:40 +02:00
platform/x86/amd
power linux-cpupower-7.3-rc1 2026-08-05 13:53:51 +02:00
rcu
sched
sched_ext sched_ext: Check bpf_timer_start return values in scx_qmap 2026-08-31 06:47:39 -10:00
scripts perf tools updates for v7.3 2026-08-22 08:47:50 -07:00
sound
spi
testing bpf-fixes 2026-09-06 13:49:44 -07:00
thermal tools/thermal/thermometer: close fd on realloc() failure 2026-07-22 17:43:55 +02:00
time
tracing rtla/cli: Unify and improve handling of invalid option arguments 2026-08-05 10:14:40 +02:00
unittests
usb
verification verification/rvgen: Use .old instead of .bak for kunit backup files 2026-08-25 13:56:53 +02:00
virtio tools/virtio: Fix control typo in trace agent comment 2026-08-19 06:38:48 -04:00
wmi
workqueue tools/workqueue/wq_dump.py: Support backward compatibility for wq->attrs rename 2026-08-31 10:17:08 -10:00
writeback
Makefile