linux/kernel/irq
Daniel Wagner b6139a6abf lib/group_cpus: Let group_cpu_evenly() return the number of initialized masks
group_cpu_evenly() might have allocated less groups then requested:

group_cpu_evenly()
  __group_cpus_evenly()
    alloc_nodes_groups()
      # allocated total groups may be less than numgrps when
      # active total CPU number is less then numgrps

In this case, the caller will do an out of bound access because the
caller assumes the masks returned has numgrps.

Return the number of groups created so the caller can limit the access
range accordingly.

Acked-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Daniel Wagner <wagi@kernel.org>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20250617-isolcpus-queue-counters-v1-1-13923686b54b@kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2025-07-01 10:24:11 -06:00
..
affinity.c lib/group_cpus: Let group_cpu_evenly() return the number of initialized masks 2025-07-01 10:24:11 -06:00
autoprobe.c genirq/autoprobe: Switch to lock guards 2025-05-07 09:08:11 +02:00
chip.c genirq/cpuhotplug: Rebalance managed interrupts across multi-CPU hotplug 2025-06-13 15:13:35 +02:00
cpuhotplug.c genirq/cpuhotplug: Restore affinity even for suspended IRQ 2025-06-13 15:13:35 +02:00
debug.h Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/pmladek/printk 2018-02-01 13:36:15 -08:00
debugfs.c genirq: Bump the size of the local variable for sprintf() 2025-05-15 16:28:09 +02:00
devres.c genirq/devres: Don't free interrupt which is not managed by devres 2024-10-24 11:20:06 +02:00
dummychip.c irq: Fix typos in comments 2021-03-22 04:23:14 +01:00
generic-chip.c genirq/generic-chip: Fix incorrect lock guard conversions 2025-04-08 22:49:02 +02:00
handle.c irq: remove unused flags argument from __handle_irq_event_percpu() 2022-01-07 00:25:25 +01:00
internals.h genirq: Retain disable depth for managed interrupts across CPU hotplug 2025-05-15 16:44:25 +02:00
ipi-mux.c genirq/ipi-mux: Use irq_domain_alloc_irqs() 2023-02-06 17:21:15 +00:00
ipi.c genirq/ipi: Fix NULL pointer deref in irq_data_get_affinity_mask() 2023-02-20 13:53:41 +01:00
irq_sim.c genirq/irq_sim: Initialize work context pointers properly 2025-06-13 15:36:35 +02:00
irqdesc.c genirq/irqdesc: Remove double locking in hwirq_show() 2025-05-21 17:48:23 +02:00
irqdomain.c irqdomain: Fix kernel-doc and add it to Documentation 2025-05-16 21:06:13 +02:00
Kconfig powerpc updates for 6.15 2025-03-27 19:39:08 -07:00
kexec.c genirq/kexec: Prevent redundant IRQ masking by checking state before shutdown 2024-12-11 20:32:34 +01:00
Makefile kexec: Consolidate machine_kexec_mask_interrupts() implementation 2024-12-11 20:32:34 +01:00
manage.c genirq/manage: Use the correct lock guard in irq_set_irq_wake() 2025-05-14 12:05:58 +02:00
matrix.c genirq/matrix: Dynamic bitmap allocation 2024-02-23 10:18:44 +01:00
migration.c genirq/migration: Use irqd_get_parent_data() in irq_force_complete_move() 2025-04-04 17:08:36 +02:00
msi.c Updates for the MSI subsystem (core code and PCI): 2025-05-27 08:15:26 -07:00
pm.c genirq/pm: Switch to lock guards 2025-05-07 09:08:11 +02:00
proc.c genirq: Consistently use '%u' format specifier for unsigned int variables 2025-05-13 09:43:32 +02:00
resend.c genirq/resend: Switch to lock guards 2025-05-07 09:08:11 +02:00
settings.h genirq: Remove IRQ_MOVE_PCNTXT and related code 2025-01-15 21:38:53 +01:00
spurious.c genirq/spurious: Switch to lock guards 2025-05-07 09:08:12 +02:00
timings.c genirq/timings: Add kernel-doc for a function parameter 2025-01-15 21:38:53 +01:00