Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

perf header: Validate nr_domains when reading HEADER_CPU_DOMAIN_INFO

Further validate the HEADER_CPU_DOMAIN_INFO fields, this time checking
the nr_domains field.

Assisted-by: Claude Code:claude-opus-4-6
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>

authored by

Arnaldo Carvalho de Melo and committed by
Namhyung Kim
f823d7ef fab205e4

+6
+6
tools/perf/util/header.c
··· 3731 3731 if (do_read_u32(ff, &nr_domains)) 3732 3732 return -1; 3733 3733 3734 + if (nr_domains > max_sched_domains) { 3735 + pr_err("Invalid HEADER_CPU_DOMAIN_INFO: nr_domains %u > max_sched_domains (%u)\n", 3736 + nr_domains, max_sched_domains); 3737 + return -1; 3738 + } 3739 + 3734 3740 cd_map[cpu]->nr_domains = nr_domains; 3735 3741 3736 3742 cd_map[cpu]->domains = calloc(max_sched_domains, sizeof(*d_info));