group_cpu_evenly might allocated less groups then the requested:Reviewed-by: Hannes Reinecke <hare@xxxxxxx>
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.
Signed-off-by: Daniel Wagner <wagi@xxxxxxxxxx>
---
block/blk-mq-cpumap.c | 6 +++---
drivers/virtio/virtio_vdpa.c | 9 +++++----
fs/fuse/virtio_fs.c | 6 +++---
include/linux/group_cpus.h | 3 ++-
kernel/irq/affinity.c | 9 +++++----
lib/group_cpus.c | 12 +++++++++---
6 files changed, 27 insertions(+), 18 deletions(-)