Revision 72cd652b73dd77df6f26bd450e804ee29232669f authored by Athira Rajeev on 05 September 2022, 14:19:28 UTC, committed by Arnaldo Carvalho de Melo on 06 September 2022, 12:45:23 UTC
The affinity code in "affinity_set" function access array named "sched_cpus". The size for this array is allocated in affinity_setup function which is nothing but value from get_cpu_set_size. This is used to contain the cpumask value for each cpu. While setting bit for each cpu, it calls "set_bit" function which access index in sched_cpus array. If we provide a command-line option to -C which is more than the number of CPU's present in the system, the set_bit could access an array member which is out-of the array size. This is because currently, there is no boundary check for the CPU. This will result in seg fault: <<>> ./perf stat -C 12323431 ls Perf can support 2048 CPUs. Consider raising MAX_NR_CPUS Segmentation fault (core dumped) <<>> Fix this by adding boundary check for the array. After the fix from powerpc system: <<>> ./perf stat -C 12323431 ls 1>out Perf can support 2048 CPUs. Consider raising MAX_NR_CPUS Performance counter stats for 'CPU(s) 12323431': <not supported> msec cpu-clock <not supported> context-switches <not supported> cpu-migrations <not supported> page-faults <not supported> cycles <not supported> instructions <not supported> branches <not supported> branch-misses 0.001192373 seconds time elapsed <<>> Reported-by: Nageswara R Sastry <rnsastry@linux.ibm.com> Signed-off-by: Athira Jajeev <atrajeev@linux.vnet.ibm.com> Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com> Tested-by: Nageswara R Sastry <rnsastry@linux.ibm.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Kajol Jain <kjain@linux.ibm.com> Cc: Madhavan Srinivasan <maddy@linux.vnet.ibm.com> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: linuxppc-dev@lists.ozlabs.org Link: https://lore.kernel.org/r/20220905141929.7171-1-atrajeev@linux.vnet.ibm.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 parent f0c86a2
File | Mode | Size |
---|---|---|
partitions | ||
Kconfig | -rw-r--r-- | 6.9 KB |
Kconfig.iosched | -rw-r--r-- | 1.3 KB |
Makefile | -rw-r--r-- | 1.8 KB |
badblocks.c | -rw-r--r-- | 14.1 KB |
bdev.c | -rw-r--r-- | 27.5 KB |
bfq-cgroup.c | -rw-r--r-- | 39.9 KB |
bfq-iosched.c | -rw-r--r-- | 258.8 KB |
bfq-iosched.h | -rw-r--r-- | 37.6 KB |
bfq-wf2q.c | -rw-r--r-- | 52.4 KB |
bio-integrity.c | -rw-r--r-- | 12.3 KB |
bio.c | -rw-r--r-- | 47.8 KB |
blk-cgroup-fc-appid.c | -rw-r--r-- | 1.4 KB |
blk-cgroup-rwstat.c | -rw-r--r-- | 3.4 KB |
blk-cgroup-rwstat.h | -rw-r--r-- | 3.9 KB |
blk-cgroup.c | -rw-r--r-- | 52.6 KB |
blk-cgroup.h | -rw-r--r-- | 16.4 KB |
blk-core.c | -rw-r--r-- | 33.5 KB |
blk-crypto-fallback.c | -rw-r--r-- | 18.7 KB |
blk-crypto-internal.h | -rw-r--r-- | 5.7 KB |
blk-crypto-profile.c | -rw-r--r-- | 16.4 KB |
blk-crypto-sysfs.c | -rw-r--r-- | 4.4 KB |
blk-crypto.c | -rw-r--r-- | 12.1 KB |
blk-flush.c | -rw-r--r-- | 15.5 KB |
blk-ia-ranges.c | -rw-r--r-- | 8.4 KB |
blk-integrity.c | -rw-r--r-- | 11.9 KB |
blk-ioc.c | -rw-r--r-- | 10.5 KB |
blk-iocost.c | -rw-r--r-- | 96.7 KB |
blk-iolatency.c | -rw-r--r-- | 29.2 KB |
blk-ioprio.c | -rw-r--r-- | 5.5 KB |
blk-ioprio.h | -rw-r--r-- | 552 bytes |
blk-lib.c | -rw-r--r-- | 8.8 KB |
blk-map.c | -rw-r--r-- | 14.5 KB |
blk-merge.c | -rw-r--r-- | 30.2 KB |
blk-mq-cpumap.c | -rw-r--r-- | 2.2 KB |
blk-mq-debugfs-zoned.c | -rw-r--r-- | 453 bytes |
blk-mq-debugfs.c | -rw-r--r-- | 21.6 KB |
blk-mq-debugfs.h | -rw-r--r-- | 2.4 KB |
blk-mq-pci.c | -rw-r--r-- | 1.3 KB |
blk-mq-rdma.c | -rw-r--r-- | 1.3 KB |
blk-mq-sched.c | -rw-r--r-- | 17.7 KB |
blk-mq-sched.h | -rw-r--r-- | 2.5 KB |
blk-mq-sysfs.c | -rw-r--r-- | 7.0 KB |
blk-mq-tag.c | -rw-r--r-- | 18.3 KB |
blk-mq-tag.h | -rw-r--r-- | 2.2 KB |
blk-mq-virtio.c | -rw-r--r-- | 1.3 KB |
blk-mq.c | -rw-r--r-- | 119.2 KB |
blk-mq.h | -rw-r--r-- | 11.1 KB |
blk-pm.c | -rw-r--r-- | 6.6 KB |
blk-pm.h | -rw-r--r-- | 763 bytes |
blk-rq-qos.c | -rw-r--r-- | 6.9 KB |
blk-rq-qos.h | -rw-r--r-- | 5.7 KB |
blk-settings.c | -rw-r--r-- | 30.2 KB |
blk-stat.c | -rw-r--r-- | 5.4 KB |
blk-stat.h | -rw-r--r-- | 4.8 KB |
blk-sysfs.c | -rw-r--r-- | 23.6 KB |
blk-throttle.c | -rw-r--r-- | 64.5 KB |
blk-throttle.h | -rw-r--r-- | 6.0 KB |
blk-timeout.c | -rw-r--r-- | 4.1 KB |
blk-wbt.c | -rw-r--r-- | 20.0 KB |
blk-wbt.h | -rw-r--r-- | 2.7 KB |
blk-zoned.c | -rw-r--r-- | 16.6 KB |
blk.h | -rw-r--r-- | 14.5 KB |
bounce.c | -rw-r--r-- | 6.8 KB |
bsg-lib.c | -rw-r--r-- | 9.8 KB |
bsg.c | -rw-r--r-- | 6.1 KB |
disk-events.c | -rw-r--r-- | 12.9 KB |
elevator.c | -rw-r--r-- | 19.2 KB |
elevator.h | -rw-r--r-- | 5.2 KB |
fops.c | -rw-r--r-- | 16.6 KB |
genhd.c | -rw-r--r-- | 36.9 KB |
holder.c | -rw-r--r-- | 4.1 KB |
ioctl.c | -rw-r--r-- | 16.4 KB |
ioprio.c | -rw-r--r-- | 5.8 KB |
kyber-iosched.c | -rw-r--r-- | 27.9 KB |
mq-deadline.c | -rw-r--r-- | 31.8 KB |
opal_proto.h | -rw-r--r-- | 9.4 KB |
sed-opal.c | -rw-r--r-- | 62.5 KB |
t10-pi.c | -rw-r--r-- | 12.5 KB |
Computing file changes ...